Files and directories not displaying [SOLVED]

Hi,

I have recently installed Nextcloud and moved files from an old owncloud installation into Nextclould. My problem is that the directory does not show up in the Nextclould installation.

I copied the directory and file permissions (755 and 644 respectively) and set the owner and group to the webserver (www-data, it’s a debian server). However, the directory is still not showing.

Is there anything else I need to do such as force a re-index of the files? I can’t find this option in any of the settings.

Any help would be apprecitated.

Thanks

I found the solution to this. Nextcloud provides a command line tool (occ) that can be used to re-index user files. Any new files and directories added under a users account and not done so by the nextclould web interface e.g. from the command line, will be displayed in that users account.

The command to do this is:

sudo -u www-data php /var/www/nextcloud/occ files:scan --all

You may need to change the user (www-data above) and the path to your nextcloud installation.

5 Likes

Could you please guide me in more detail. THANKs

As mentioned above after changing files/folder directly on disk run:
sudo -u www-data php /var/www/nextcloud/occ files:scan --all
to make NC rescan all files and folders (will take time if you have a lot of them). Does it help?

More information you can find under official documentation: https://docs.nextcloud.com/server/15/admin_manual/configuration_server/occ_command.html?highlight=occ#scan

I am having a similar issue. I have just built a second webserver and copied my nextcloud folder over from the first server. It can access all of the files from the OS, but from the website, the second server just wont see any files. Not even the skeleton files.

I’ve run this command and received the following output, but I still cannot see the files.

Starting scan for user 1 out of 27 (1EA4F62A-F7BF-4FFF-910A-86A91F3124E9)
Starting scan for user 2 out of 27 (1FB8888E-1D16-4391-9F98-BDC5BA57B09B)
Starting scan for user 3 out of 27 (28F1F663-B852-41CD-BA8D-E0C2B6D706EF)
Starting scan for user 4 out of 27 (3689F012-5D5C-4E89-BEDB-20A37E6CF6DA)
Starting scan for user 5 out of 27 (47FF4F7F-4C5D-46F3-920F-3A9D765A1DCE)
Starting scan for user 6 out of 27 (48D9438A-6C98-4313-9F74-C6241393181B)
Starting scan for user 7 out of 27 (51F2C5FF-CB2F-416D-9355-6B914DF3129E)
Starting scan for user 8 out of 27 (550E3E27-CCCE-43AE-8D6C-D4427EC507B7)
Starting scan for user 9 out of 27 (5665FD24-2239-45DF-A769-B1F8453E99E7)
Starting scan for user 10 out of 27 (6BE691AD-1E70-420F-93A3-004C5B21CC5E)
Starting scan for user 11 out of 27 (6DA40FD6-6F63-453B-8F2B-76A1046DF2AE)
Starting scan for user 12 out of 27 (77443B77-66C0-4AA5-9CFB-BBE582C8438A)
Starting scan for user 13 out of 27 (81AEF8DB-444C-4059-A41D-4AF532713D86)
Starting scan for user 14 out of 27 (9B7EB1BC-C3F8-4521-AF00-AF4DFF8C6ADC)
Starting scan for user 15 out of 27 (A50D7F48-AD1A-4C7C-8372-0F0C8FB62129)
Starting scan for user 16 out of 27 (A8C29F77-FD88-4331-9C35-072F8FFE044D)
Starting scan for user 17 out of 27 (A90A2173-6246-4C80-B4C9-00370BAA6CE0)
Starting scan for user 18 out of 27 (AEF27CA5-C635-4DDD-A174-4DECE658F4C0)
Starting scan for user 19 out of 27 (B4B2D119-AC1A-411F-BA9D-D08C1CFBCFC0)
Starting scan for user 20 out of 27 (C4626B44-F0BA-454F-97EC-25315F69975F)
Starting scan for user 21 out of 27 (CDDCEC18-AA5B-4D90-B089-81136E9C17EC)
Starting scan for user 22 out of 27 (D03D4A3C-088E-4FFB-8D3C-D4494FDF4D4F)
Starting scan for user 23 out of 27 (D30CDB08-24B1-4892-AB98-11ECE348ED25)
Starting scan for user 24 out of 27 (E810B011-1F67-42BE-B8E4-1F52B9A73F1F)
Starting scan for user 25 out of 27 (EC04826A-4849-4917-B634-4713931E6593)
Starting scan for user 26 out of 27 (F1EFBD22-2E58-4FB9-9CD3-459143C7C586)
Starting scan for user 27 out of 27 (itadmin)
±--------±------±-------------+
| Folders | Files | Elapsed time |
±--------±------±-------------+
| 345 | 1626 | 00:00:18 |
±--------±------±-------------+

Check your access rights on OS level.
Check if user set to your NC web user, e.g. www-data.

ls -la /var/www/nextcloud/

drwxr-xr-x 15 www-data www-data  4096 Feb  8 11:49 .
drwxr-xr-x  6 root     root      4096 Nov  6 14:57 ..
-rw-r--r--  1 www-data www-data  2946 Feb  8 11:49 .htaccess
-rw-r--r--  1 www-data www-data   163 Feb  8 11:49 .user.ini
drwxr-xr-x 32 www-data www-data  4096 Feb  8 11:49 3rdparty
-rw-r--r--  1 www-data www-data 12063 Feb  8 11:49 AUTHORS
-rw-r--r--  1 www-data www-data 34520 Feb  8 11:49 COPYING
drwxr-x--- 54 www-data www-data  4096 Feb 12 11:29 apps
drwxr-x---  2 www-data www-data  4096 Feb 14 11:35 config
-rw-r--r--  1 www-data www-data  3650 Feb  8 11:49 console.php
drwxr-xr-x 18 www-data www-data  4096 Feb  8 11:49 core
-rw-r--r--  1 www-data www-data  4979 Feb  8 11:49 cron.php
drwxr-x--- 13 www-data www-data  4096 Feb 23 06:25 data
...

Check if data folder under your NC folder e.g. under /var/www/nextcloud/data, and if it is correctly configured in the ../config/config.php

grep datadirectory /var/www/nextcloud/config/config.php
'datadirectory' => '/var/www/nextcloud/data',

Take this path (/var/www/nextcloud/data) and check if all folder and files under your DATA FOLDER are reachable for your NC web user, e.g. for www-data:

sudo -u www-data ls -l /var/www/nextcloud/data

drwxr-x---  5 www-data www-data    4096 Apr 14  2018 user1
drwxr-x---  8 www-data www-data    4096 Feb 27  2018 user2
drwxr-x---  8 www-data www-data    4096 Dec 18 12:32 user3
drwxr-x---  5 www-data www-data    4096 Jan 23  2018 user4
drwxr-x---  8 www-data www-data    4096 Feb 27  2018 user5
drwxr-x---  8 www-data www-data    4096 Oct  9 08:58 user6
drwxr-x---  8 www-data www-data    4096 Feb 27  2018 user7
....
1 Like

data director is:
‘datadirectory’ => ‘/mnt/data/data’

sudo ls -l /mnt/data/data
total 2756
drwxr-xr-x 5 www-data www-data 4096 Feb 21 14:00 1EA4F62A-F7BF-4FFF-910A-86A91F3124E9
drwxr-xr-x 4 www-data www-data 4096 Feb 21 15:39 3689F012-5D5C-4E89-BEDB-20A37E6CF6DA
drwxr-xr-x 4 www-data www-data 4096 Feb 21 12:43 48D9438A-6C98-4313-9F74-C6241393181B
drwxr-xr-x 5 www-data www-data 4096 Feb 25 08:22 550E3E27-CCCE-43AE-8D6C-D4427EC507B7
drwxr-xr-x 4 www-data www-data 4096 Feb 21 15:40 6DA40FD6-6F63-453B-8F2B-76A1046DF2AE
drwxr-xr-x 4 www-data www-data 4096 Feb 21 15:20 A8C29F77-FD88-4331-9C35-072F8FFE044D
drwxr-xr-x 5 www-data www-data 4096 Feb 21 15:54 A90A2173-6246-4C80-B4C9-00370BAA6CE0
drwxr-xr-x 10 www-data www-data 4096 Feb 20 20:31 appdata_oc0ldjh7mv9h
-rw-r–r-- 1 www-data www-data 0 Feb 21 09:55 audit.log
drwxr-xr-x 7 www-data www-data 4096 Feb 21 20:02 D30CDB08-24B1-4892-AB98-11ECE348ED25
drwxr-xr-x 4 www-data www-data 4096 Feb 21 11:15 E810B011-1F67-42BE-B8E4-1F52B9A73F1F
drwxr-xr-x 6 www-data www-data 4096 Feb 21 16:19 EC04826A-4849-4917-B634-4713931E6593
drwxr-xr-x 2 www-data www-data 4096 Feb 20 14:53 files_external
drwxr-xr-x 4 www-data www-data 4096 Feb 21 17:00 __groupfolders
-rw-r–r-- 1 www-data www-data 0 Feb 20 14:51 index.html
drwxr-xr-x 5 www-data www-data 4096 Feb 21 15:32 itadmin
-rw-r----- 1 www-data www-data 2757432 Feb 26 2019 nextcloud.log
-rw-r–r-- 1 www-data www-data 2744 Feb 20 20:32 updater.log

/var/www/html/nextcloud
total 168
drwxr-xr-x 15 www-data www-data 4096 Feb 20 16:14 .
drwxr-xr-x 4 root root 4096 Feb 25 19:41 …
drwxr-xr-x 32 www-data www-data 4096 Jan 11 15:29 3rdparty
drwxr-xr-x 48 www-data www-data 4096 Feb 21 20:02 apps
-rwxr-xr-x 1 www-data www-data 12063 Jan 11 15:25 AUTHORS
drwxr-xr-x 2 www-data www-data 4096 Feb 22 08:50 config
-rwxr-xr-x 1 www-data www-data 3650 Jan 11 15:25 console.php
-rwxr-xr-x 1 www-data www-data 34520 Jan 11 15:25 COPYING
drwxr-xr-x 18 www-data www-data 4096 Jan 11 15:29 core
-rwxr-xr-x 1 www-data www-data 4979 Jan 11 15:25 cron.php
drwxr-xr-x 2 www-data www-data 4096 Feb 20 14:51 data
-rwxr-xr-x 1 www-data www-data 2943 Feb 21 08:48 .htaccess
-rwxr-xr-x 1 www-data www-data 156 Jan 11 15:25 index.html
-rwxr-xr-x 1 www-data www-data 3172 Jan 11 15:25 index.php
drwxr-xr-x 6 www-data www-data 4096 Jan 11 15:25 lib
-rwxr-xr-x 1 www-data www-data 283 Jan 11 15:25 occ
drwxr-xr-x 2 www-data www-data 4096 Jan 11 15:25 ocm-provider
drwxr-xr-x 2 www-data www-data 4096 Feb 21 10:17 ocs
drwxr-xr-x 2 www-data www-data 4096 Jan 11 15:25 ocs-provider
-rwxr-xr-x 1 www-data www-data 2951 Jan 11 15:25 public.php
-rwxr-xr-x 1 www-data www-data 5139 Jan 11 15:25 remote.php
drwxr-xr-x 4 www-data www-data 4096 Jan 11 15:25 resources
-rw------- 1 www-data www-data 1024 Feb 25 20:00 .rnd
-rwxr-xr-x 1 www-data www-data 26 Jan 11 15:25 robots.txt
drwxr-xr-x 12 www-data www-data 4096 Jan 11 15:26 settings
-rwxr-xr-x 1 www-data www-data 2232 Jan 11 15:25 status.php
drwxr-xr-x 3 www-data www-data 4096 Jan 11 15:25 themes
drwxr-xr-x 2 www-data www-data 4096 Jan 11 15:25 updater
-rwxr-xr-x 1 www-data www-data 161 Feb 21 08:48 .user.ini
-rwxr-xr-x 1 www-data www-data 362 Jan 11 15:28 version.php

We are getting this error message in the browser diag window.

Content Security Policy: Directive ‘child-src’ has been deprecated. Please use directive ‘worker-src’ to control workers, or directive ‘frame-src’ to control frames respectively.
Loading failed for the with source “https://sbmhqncws-2/index.php/js/files/merged-index.js?v=0db267dc-7”. files:63:1
JQMIGRATE: Migrate is installed, version 1.4.0 core.js:7:542
TypeError: OCA.Files is undefined[Learn More] sharedfilelist.js:30:2

<anonymous> https://sbmhqncws-2/apps/files_sharing/js/sharedfilelist.js?v=0db267dc-7:30 <anonymous> https://sbmhqncws-2/apps/files_sharing/js/sharedfilelist.js?v=0db267dc-7:10 

TypeError: OCA.Files is undefined[Learn More] mountsfilelist.js:29:2

<anonymous> https://sbmhqncws-2/apps/files_external/js/mountsfilelist.js?v=0db267dc-7:29 <anonymous> https://sbmhqncws-2/apps/files_external/js/mountsfilelist.js?v=0db267dc-7:10 

TypeError: OCA.Files is undefined[Learn More] filelist.js:44:2
TypeError: OCA.Files is undefined[Learn More] activity-sidebar.js:473:6

<anonymous> https://sbmhqncws-2/index.php/js/activity/activity-sidebar.js?v=0db267dc-7:473 <anonymous> https://sbmhqncws-2/index.php/js/activity/activity-sidebar.js?v=0db267dc-7:464 

TypeError: OCA.Files is undefined[Learn More] merged.js:498:6
TypeError: OCA.Files is undefined[Learn More] merged.js:232:6

<anonymous> https://sbmhqncws-2/index.php/js/files_versions/merged.js?v=0db267dc-7:232 <anonymous> https://sbmhqncws-2/index.php/js/files_versions/merged.js?v=0db267dc-7:228 

TypeError: OCA.Files is undefined[Learn More] additionalScripts.js:300:6

<anonymous> https://sbmhqncws-2/index.php/js/files_sharing/additionalScripts.js?v=0db267dc-7:300 <anonymous> https://sbmhqncws-2/index.php/js/files_sharing/additionalScripts.js?v=0db267dc-7:291 

Loading failed for the with source “https://sbmhqncws-2/index.php/js/files_texteditor/merged.js?v=0db267dc-7”. files:80:1
TypeError: OCA.Files is undefined[Learn More] merged.js:141:2

<anonymous> https://sbmhqncws-2/index.php/js/systemtags/merged.js?v=0db267dc-7:141 <anonymous> https://sbmhqncws-2/index.php/js/systemtags/merged.js?v=0db267dc-7:124 

New search handler registered search.js:67:4
TypeError: OCA.Files is undefined[Learn More] scripts-for-file-app.js:1308:5

register https://sbmhqncws-2/index.php/js/gallery/scripts-for-file-app.js?v=0db267dc-7:1308 <anonymous> https://sbmhqncws-2/index.php/js/gallery/scripts-for-file-app.js?v=0db267dc-7:1474 then https://sbmhqncws-2/core/vendor/core.js?v=0db267dc-7:2 j https://sbmhqncws-2/core/vendor/core.js?v=0db267dc-7:2 fireWith https://sbmhqncws-2/core/vendor/core.js?v=0db267dc-7:2 x https://sbmhqncws-2/core/vendor/core.js?v=0db267dc-7:4 b https://sbmhqncws-2/core/vendor/core.js?v=0db267dc-7:4

Did you backup you DB on old Server and restore it on a new server? Otherwise NC will not know to whom belongs your folders.

Also when you run rescan command you have 27 Users

but in directory it is less users listed (or you just cut output):

Could it be that data of those users was not copied?

Is there any error in Log /mnt/data/data/nextcloud.log when you accessing folders?

We upgraded from 15.02 to 15.04 and the problem went away. Perhaps something mangled in one of the app files or something.

  • Chris
1 Like

Hola,
tengo un caso similar, desde la web cargué una carpeta comprimida.
Posteriormente me conecté al server mediante ssh. Lo que hice fue entrar al directorio del usuario /var/www/nextcloud/data/usuario y descomprimí la carpeta y eliminé la carpeta original para ahorrar espacio en el disco. Luego de hacer eso me conecté por web y no llego a visualizar ningun archivo, solo se ve el archivo original por más que está eliminado.

Probé con los comandos mencionados en este post pero me sale error al ejecutar.

Estoy usando Centos 7, php 7.2, Mariadb, apache y nextcloud 16.0.

Espero me hayan entendido.

Saludos,

I had exactly the same problem (files and directory not displaying) after upgrading to nc 20.0.7 (from 20.0.6). Browser diag claims as first error problem with file merged-index.js?v… and analog sounding errors as the ones you described, chris. Perhaps the solution is helpful for others…

I detected surprisingly, that the merged-index.js was cut off (inside a block of comments, see pic), so that the sources were not complete.

I manually changed then one of the sources (files-upload.js), which are joined in the merged-index.js. That seems to force a new joining of the files into a fresh merged-join.js. After drop browser caches and reload, the files an directories are now correctly displaying.

So the error cause maybe a corrupt joined merged-index.js, forcing a new join is probably a solution.

1 Like

Got the same problem. But solved with:

occ maintenance:mimetype:update-js

4 Likes

Thank you very much, it helped with this solution!

1 Like

Thank you for this. It was exactly what I needed to fix the same problem.

1 Like

For anyone using nixos: Connect to your server an run nextcloud-occ files:scan --all

P.S: nextcloud-occ command gives you access to all other OCC commands too.

Yeah, thanks a lot.
I have installed OCC Web and after connecting through the terminal to my nextcloud space and heading to occ folder i run commnad:

php occ files:scan --all

And now every file is shown in my nexcloud webpage.