Understanding the Issue
To rectify this, you can adjust the ownership of your Nextcloud directory using the chown command. The following command changes the ownership of the Nextcloud directory to the nginx user and group:
sudo chown nginx. -R /PATH TO THE NEXTCLOUD DIRECTORY/ABC/nextcloudThis ensures that the Nextcloud server has access to your files for indexing and synchronization. In case we are using an Apache server relevant user has to be added.
Triggering File Indexing
sudo -u nginx /PATH TO THE NEXTCLOUD DIRECTORY/ABC/nextcloud/occ files:scan --allThis command runs the indexing process under the nginx user, ensuring that the permissions are correctly managed throughout the process.