Nextcloud does not show folder contents

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version : 27.0.2
Operating system and version : Debian 11, Docker
Apache or nginx version (eg, Apache 2.4.25): replace me
PHP version: 8.2

The issue you are facing: <<i am facing the following problem in my nextcloud instance. There are folders that nextcloud cannot/will not show their content. I am attaching a screenshot in order for you to see and understand. in the folder i am trying to navigate, i should expect to see at least 20 subfolder and some more files contained therein.
I have run occ: files:index --all two times already but in vain.
The proble appeared when i upgraded from 27.0 to 27.0.2
I running nextcloud under docker and using mariadb for database.
Can someone help me solving this issue?
I have been using nextcloud from NC23 and this is the first time i am dealing with this problem.>>

Is this the first time you’ve seen this error? (Y/N): y

Steps to replicate it:

The output of your Nextcloud log in Admin > Logging:

PASTE HERE

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

PASTE HERE

The output of your Apache/nginx/system log in /var/log/____:

PASTE HERE

PASTE HERE


Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.

PASTE HERE

should use occ files:scan --all instead

and as well the others if needed

  files:scan                  
  files:scan-app-data         
  groupfolders:scan

Thank you for your reply. I will try again today and i will revert with updates.

I carried your advise but still no improvement.

errors during files scan?
Output?

What do you get by command

grep datadirectory /var/www/nextcloud/config/config.php

→ is the data directiory fully in hand of www user e.g. www-data?

sudo -u www-data ls -l /YOUR-DATA-DIRECTORY

?

What do you get by command :: grep datadirectory /var/www/nextcloud/config/config.php → ‘datadirectory’ => ‘/var/www/html/data’,

→ is the data directiory fully in hand of www user e.g. www-data? sudo -u www-data ls -l /YOUR-DATA-DIRECTORY

This is what I get:

drwxr-sr-x+ 45 www-data www-data 4096 Aug 25 00:59 3rdparty
-rw-r–r–+ 1 www-data www-data 23796 Aug 25 00:59 AUTHORS
-rw-r–r–+ 1 www-data www-data 34520 Aug 25 00:59 COPYING
drwxr-sr-x+ 50 www-data www-data 4096 Aug 25 00:59 apps
drwxr-sr-x+ 2 root root 4096 Aug 25 00:59 config
-rw-r–r–+ 1 www-data www-data 4095 Aug 25 00:59 console.php
drwxr-sr-x+ 24 www-data www-data 4096 Aug 25 00:59 core
-rw-r–r–+ 1 www-data www-data 6317 Aug 25 00:59 cron.php
drwxr-sr-x+ 2 root root 4096 Aug 25 00:59 custom_apps
drwxrwx—+ 6 www-data www-data 4096 Aug 25 01:14 data
drwxr-sr-x+ 2 www-data www-data 12288 Aug 25 00:59 dist
-rw-r–r–+ 1 www-data www-data 156 Aug 25 00:59 index.html
-rw-r–r–+ 1 www-data www-data 3456 Aug 25 00:59 index.php
drwxr-sr-x+ 6 www-data www-data 4096 Aug 25 00:59 lib
-rw-rw-r–+ 1 root root 0 Aug 29 08:22 nextcloud-init-sync.lock
-rwxr-xr-x+ 1 www-data www-data 283 Aug 25 00:59 occ
drwxr-sr-x+ 2 www-data www-data 4096 Aug 25 00:59 ocm-provider
drwxr-sr-x+ 2 www-data www-data 4096 Aug 25 00:59 ocs
drwxr-sr-x+ 2 www-data www-data 4096 Aug 25 00:59 ocs-provider
-rw-r–r–+ 1 www-data www-data 3187 Aug 25 00:59 public.php
-rw-r–r–+ 1 www-data www-data 5597 Aug 25 00:59 remote.php
drwxr-sr-x+ 4 www-data www-data 4096 Aug 25 00:59 resources
-rw-r–r–+ 1 www-data www-data 26 Aug 25 00:59 robots.txt
-rw-r–r–+ 1 www-data www-data 2452 Aug 25 00:59 status.php
drwxr-sr-x+ 3 www-data www-data 4096 Aug 25 00:59 themes
-rw-r–r–+ 1 www-data www-data 383 Aug 25 00:59 version.php

Maybe I should nuke the docker container and rebuild from scratch?

I think you have scanned your nextcloud server root directory instead of YOUR-DATADIRECTORY because this is
/var/www/html/data’

so all in /var/www/html/data’ should be owned by www-data:www.data as well

can you give an example of files you see in terminal in your datadir but not in nextcloud?

and then the folder / file status

ls -la …/folder …/file

sorry for my later reply.

I decided to nuke my next cloud instance and start from scratch. Luckily, docker makes it so easy.

SO, I removed everything and reinstalled next cloud. Set up again and everything works as expected now. It took me less than an hour to do so.

Thank you for your time.

I’m facing this same issue. In my case the fiiles vanished from the web interface after upgrading from NC25 to NC26. Then I upgraded all the way to NC28, but I did not get my files back. The files are in the data directory though, so there was no real data loss, but the web interface does not show them.

I tried all the suggestions here above to no avail, except starting from scratch, because in my case I’m not using docker. In another thread someone suggested occ maintenance:repair, which I did, but even that did not help.

However I’ve now reverted the data directory ownership back to my custom nextcloud user, because my Apache is only proxying requests to PHP-FPM, so in my case there’s no point in making the files readable by www-data.

Here is the output of my ./occ files:scan --all

Starting scan for user 1 out of 5 (admin)
Starting scan for user 2 out of 5 (lucio)
Starting scan for user 3 out of 5 (mamma)
Starting scan for user 4 out of 5 (matteo)
Starting scan for user 5 out of 5 (sara)
+---------+--------+-----+---------+---------+--------+--------------+
| Folders | Files  | New | Updated | Removed | Errors | Elapsed time |
+---------+--------+-----+---------+---------+--------+--------------+
| 7839    | 106293 | 0   | 90      | 0       | 0      | 01:45:32     |
+---------+--------+-----+---------+---------+--------+--------------+

What could I try next?

Hi, I have the same problem with a fresh Nextcloud Hub 7 (28.0.3) on Ubuntu 22.04.4 LTS. My app syncs the files and apparently everithing is ok with that, and also the files are actually on /mnt/ncdata/… . But in browser, lots of folders says “No files in here”. I appreciate any help with this. On my android phone it works very well, so the problem is “only” with browsers.