Nextcloud version (eg, 20.0.5): 27.1.2
Operating system and version (eg, Ubuntu 20.04): Linux
Apache or nginx version (eg, Apache 2.4.25): Apache 2.4.57
PHP version (eg, 7.4): 8.1.18
Reported as a bug on Github:
- [Bug]: NC27 - external storage - subfolder missing characters · Issue #39851 · nextcloud/server · GitHub
- [Bug]: NC 27.1.2.1 - corrupted directory tree · Issue #40828 · nextcloud/server · GitHub
The issue you are facing:
At first I want to mention that I’m using Nextcloud for years now without having major issues with my configuration and installation. It might be worth to know, that I’m using external storage, mounted via WebDAV to store my files.
End of September I decided to upgrade my server from Nextcloud 26.0.7 to 27.1.1. The installation itself worked without any issue and but after a while I noticed that the Notes app caused errors because it couldn’t handle sub folders correctly anymore. Due to the fact that I’m not using this app very often I decided to delete all sub folder below the Notes directory to get rid of the errors and wanted to wait for a new Notes app release.
This week I’ve upgrade the server to Nextcloud 27.1.2 and again everything looked fine and I was able to use all functions as before. Today I wanted to lookup some files and navigated to a sub folder. Surprisingly all files and folders in that subdirectory were shown without the leading two characters of its names. It looks like something has currupted the directory tree somehow, but other directories with sub folders in it, which exist in parallel of this one, are still being displayed correctly.
I tried to rescan the subdirectory b< executing ./occ files:scan <user> -p /<user>/files/folder
but the command shows invalid file names too.
I’ve also tried to access Nextcloud using a different web browser or the Nextcloud app, but all are showing the corrupted files and directory names.
These are the names of the files and directories as they are shown in the web gui:
These are the names of the files and directories as they exist on the hard disk:
eCards → CueCards
gene Musik → Eigene Musik
ergen → Juergen
Is this the first time you’ve seen this error? (Y/N): Yes
Steps to replicate it:
- Open the Files app in a web browser
- Open a sub folder, e.g. Dateien, which points to an external mount
- Check the files which are being displayed.
FYI, the sub folders name below "Dateien"
is "CueCards"
but as it can be seen from the log file, "/Dateien/eCards"
are found and displayed.
The output of your Nextcloud log in Admin > Logging:
... ,"user":"juergen","app":"webdav","method":"PROPFIND","url":"/remote.php/dav/files/juergen/Dateien/eCards","message":"Sabre\\HTTP\\ClientHttpException: Not Found","userAgent":"Mozilla/5.0 (Windows) mirall/3.10.0stable-Win64 (build 20230915) (Nextcloud, windows-10.0.19045 ClientArchitecture: x86_64 OsArchitecture: x86_64)","version":"27.1.2.1","exception":{"Exception":"Sabre\\DAV\\Exception\\ServiceUnavailable","Message":"Sabre\\HTTP\\ClientHttpException: Not Found","Code":0,"Trace":[{"file":"/srv/www/nextcloud/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php","line":78,"function":"getChild","class":"OCA\\DAV\\Connector\\Sabre\\Directory","type":"->","args":["eCards"]},{"file":"/srv/www/nextcloud/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":971,"function":"getNodeForPath","class":"Sabre\\DAV\\Tree","type":"->","args":["files/juergen/Dateien/eCards"]},{"file":"/srv/www/nextcloud/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":1662,"function":"getPropertiesIteratorForPath","class":"Sabre\\DAV\\Server","type":"->","args":["files/juergen/Dateien/eCards",["{DAV:}resourcetype","{DAV:}getlastmodified","{DAV:}getcontentlength","{DAV:}getetag","{http://owncloud.org/ns}size","And 7 more entries, set log level to debug to see all entries"],1]},{"file":"/srv/www/nextcloud/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":1647,"function":"writeMultiStatus","class":"Sabre\\DAV\\Server","type":"->","args":[["Sabre\\Xml\\Writer",[],"/remote.php/dav/",["d","s","oc","nc"],[]],["Generator"],false]},{"file":"/srv/www/nextcloud/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":346,"function":"generateMultiStatus","class":"Sabre\\DAV\\Server","type":"->","args":[["Generator"],false]},{"file":"/srv/www/nextcloud/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpPropFind","class":"Sabre\\DAV\\CorePlugin","type":"->","args":[["Sabre\\HTTP\\Request"],["Sabre\\HTTP\\Response"]]},{"file":"/srv/www/nextcloud/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\\DAV\\Server","type":"->","args":["method:PROPFIND",[["Sabre\\HTTP\\Request"],["Sabre\\HTTP\\Response"]]]},{"file":"/srv/www/nextcloud/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":253,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->","args":[["Sabre\\HTTP\\Request"],["Sabre\\HTTP\\Response"]]},
Related log line in Apache access log
... "PROPFIND /remote.php/dav/files/juergen/Dateien/eCards HTTP/1.1" 404 243 "-" "Mozilla/5.0 (Windows) mirall/3.10.0stable-Win64 (build 20230915) (Nextcloud, windows-10.0.19045 ClientArchitecture: x86_64 OsArchitecture: x86_64)" 1260 1142
Any ideas how this issue can be resolved are hightly appreciated.
I’ve just scanned the directories of an other user using occ files:scan
and have seen the same issue. The first two characters of files in a sub directory are not shown anymore although they exist on the hard disk. It seems as if a general issue with the files scanning exists?!