Dear friends,
After upgrading our environment to Nextcloud 29, I noticed that running the occ command to rescan files produces numerous errors:
sudo -u nginx php occ files:scan --all
Observed behavior:
- Many “Catalog not found” errors appear.
- The paths of the files seem to point to the root directory, e.g.,
/john-smith
, instead of the correct user directories.
- The system otherwise functions normally, and users can access their files.
Environment:
- Nextcloud version: 29.x
- PHP version: PHP 8.2.29 (cli) (built: Jul 1 2025 16:29:21) (NTS gcc x86_64)
- Database: mysql Ver 15.1 Distrib 10.5.27-MariaDB, for Linux (x86_64) using EditLine wrappe
- OS: [your OS and version] Oracle Linux Server 9.6
- Storage backend: local
What I checked:
config.php
entries for data directory
- Permissions and ownership on data directories are correct.
- Re-running
occ files:scan
multiple times does not resolve the issue.
Expected behavior:
- The scan should correctly map files to user directories without producing errors.
Additional information:
- It seems this issue is related to database entries for file paths rather than actual filesystem paths.
- We have not applied any custom modifications to Nextcloud.
Could you please advise if this is a known issue in version 29, and if there is a recommended way to fix the file path mappings or a patch available?
Thank you in advance for your help.
Please first check, whether this username really is correct, the Nextcloud default username in most cases is www-data.
Please run the occ command after you moved into the Nextcloud data folder f.ex. /mnt/ncdata , where you will find the user directories.
Hint:
in some cases the full path to occ is needed to be added
cd /mnt/ncdata
sudo -u www-data php /path/to/occ/occ files:scan all
jtr
3
Upgraded how? There are multiple installation and update methods.
Also please post the exact output (you can censor our file/user names of course). And also check your Nextcloud log, post your config, apps, etc.
There is a support template which exists for a reason. It asks for all this info and more, which is needed to help you.
I used full path to the occ script and the Nginx home directory.
The output of the command looks like this:
cd /path-to-nextcloud/
sudo -u nginx php /path-to-nextcloud/nextcloud/occ files:scan --all
Starting scan for user 1 out of 193 (a.smith)
Path not found: /a.smith
Starting scan for user 2 out of 193 (a.wilson)
Path not found: /a.wilson
…
Almost all of the user accounts return the same error.
I would appreciate any further assistance with this issue. Thank you very much for your help.
Thank you for your suggestion. I have double-checked, and the usernames are correct. They correspond to the actual Nextcloud user accounts.
What about the folder-permissions? - The owner of folders and files must be www-data (in your case nginx).
The admin guide gives you the exact chmod command for the data folders and files.
It was upgreded to Nextcloud version 29 by the API. Option Update
The permissions to the catalogs are OK. Owner is nginx and group nginx and in case of the files are 644 , catalogs 755