Users can't see files on desktop or mobile

Steps to reproduce

  1. Upload files to user directory (e.g. X:\nc_datadir<username>\files\Photos)
  2. Run sudo -u www-data php occ files:scan <username> on the nextcloud container to index new files
  3. Output confirms the new files were indexed
  4. Logging in as user and viewing Files > All Files now shows no files, whereas previously it showed the files prior to the upload
  5. Viewing Photos > All Media or Photos > Folders shows the files and folders which were uploaded and indexed
  6. Double-checking the server drive, the files and folders are all still there and intact.

Expected behavior

The files and folders should also show up under All Files.

Actual behavior

Users can no longer see the files that were visible prior to the upload, or the files which were uploaded. Viewing the All Files location on both Desktop and Mobile shows a blank page - “No files in here. Upload some content or sync with your devices!”

Host OS

Windows 11 running the all-in-one install on Docker Desktop. Docker Engine v26.1.4 and Docker Desktop 4.31.1 (153621) both latest available versions at this time

Nextcloud AIO version

Nextcloud AIO v9.0.1

Current channel

latest

Other valuable info

Images are still visible in the Media folder (black boxes added for privacy):

Hi poncho-713,

Is nextcloud’s main storage local in your configuration?
Was there any particular operation before this happened?

Have a nice day,

Sharkof

Yes, the storage is local and the “steps to reproduce” section at the top contain the events that happened prior to this issue occurring.

Hi Poncho-713,

I don’t have more idea for your issue but I’ve found this topic on the forum : nextcloud-does-not-show-folder-contents

Perhaps you could find something to help you or find an order you haven’t tried.

Have a nice day,

Sharkof

Thanks @Sharkof, I worked through the steps and realised the files were owned by root, so I changed the ownership to www-data and re-scanned them and they’re now showing up!

Steps to fix:

  1. Figure out your data directory location grep datadirectory /var/www/html/config/config.php
  2. Check permissions on the folder structure (go down deeper if it looks fine at the top level, it may be misconfigured lower down) sudo -u www-data ls -l <data_directory>
  3. Recursively change ownership to www-data chown -R www-data:www-data <data_directory_root>
  4. Re-scan files sudo -u www-data php occ files:scan --all
1 Like