nextcloud / nextcloud/groupfolders

Internal Server Error when deleting a folder inside a group folder: `"Invalid source storage path:`

Open
#3,360 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

0. Needs triage bug feature: trashbin s3
Dominant language
PHP
Stars
343
Forks
106
Avg merge
2d 3h
Merged PRs (30d)
34

Description

How to use GitHub
  • Please use the 👍 reaction to show that you are affected by the same issue.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.
Steps to reproduce
  1. Create un groupfolder
  2. Enable "Advanced permissions" and select a user or a group
  3. Create un folder inside the groupfolder
  4. Delete the folder
Expected behaviour

The folder should be delete without error

Actual behaviour

The folder is actually deleted but there is a message :
"Delete folder" action failed

Server configuration

Operating system:
Debian GNU/Linux 12 (bookworm) via Docker Image

Web server:
Apache

Database:
PostgreSQL 16.4

PHP version:
PHP 8.2.24

Nextcloud version: (see Nextcloud admin page)
Nextcloud Hub 9 (30.0.0)

Group folders version:
18.0.2

Updated from an older Nextcloud/ownCloud or fresh install:
fresh install

Where did you install Nextcloud from:
Helm Chart 6.0.3

Are you using external storage, if yes which one:
Yes S3

Are you using encryption:
No

Are you using an external user-backend, if yes which one:
Keycloak

Client configuration

Browser:
Chrome

Operating system:
Windows 10

Logs
Web server error log
Web server error log
"DELETE /remote.php/dav/files/admin/mygroupfolder/myfolder HTTP/1.1" 500 3481 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36
Nextcloud log (data/nextcloud.log)
Nextcloud log
{"reqId":"XtWoJKHHWO0fJcKSeMq1","level":3,"time":"2024-10-11T15:03:57+00:00","user":"admin","app":"webdav","method":"DELETE","url":"/remote.php/dav/files/admin/mygroupfolder/myfolder","message":"Invalid source storage path: __groupfolders/36/myfolder","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36","version":"30.0.0.14","exception":{"Exception":"Exception","Message":"Invalid source storage path: __groupfolders/36/myfolder","Code":0,"Trace":[{"file":"/var/www/html/custom_apps/groupfolders/lib/Trash/TrashBackend.php","line":215,"function":"moveFromCache","class":"OC\\Files\\Cache\\Cache","type":"->","args":[["OCA\\GroupFolders\\ACL\\ACLCacheWrapper"],"__groupfolders/36/myfolder","__groupfolders/trash/36/myfolder.d1728659037"]},{"file":"/var/www/html/apps/files_trashbin/lib/Trash/TrashManager.php","line":85,"function":"moveToTrash","class":"OCA\\GroupFolders\\Trash\\TrashBackend","type":"->","args":[["OCA\\Files_Trashbin\\Storage",null,null,null,null,null],"myfolder"]},{"file":"/var/www/html/apps/files_trashbin/lib/Storage.php","line":168,"function":"moveToTrash","class":"OCA\\Files_Trashbin\\Trash\\TrashManager","type":"->","args":[["OCA\\Files_Trashbin\\Storage",null,null,null,null,null],"myfolder"]},{"file":"/var/www/html/apps/files_trashbin/lib/Storage.php","line":90,"function":"doDelete","class":"OCA\\Files_Trashbin\\Storage","type":"->","args":["myfolder","rmdir"]},{"file":"/var/www/html/lib/private/Files/View.php","line":1136,"function":"rmdir","class":"OCA\\Files_Trashbin\\Storage","type":"->","args":["myfolder"]},{"file":"/var/www/html/lib/private/Files/View.php","line":286,"function":"basicOperation","class":"OC\\Files\\View","type":"->","args":["rmdir","/mygroupfolder/myfolder",["delete"]]},{"file":"/var/www/html/apps/dav/lib/Connector/Sabre/Directory.php","line":271,"function":"rmdir","class":"OC\\Files\\View","type":"->","args":["/mygroupfolder/myfolder"]},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Tree.php","line":197,"function":"delete","class":"OCA\\DAV\\Connector\\Sabre\\Directory","type":"->","args":[]},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":281,"function":"delete","class":"Sabre\\DAV\\Tree","type":"->","args":["files/admin/mygroupfolder/myfolder"]},{"file":"/var/www/html/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpDelete","class":"Sabre\\DAV\\CorePlugin","type":"->","args":[["Sabre\\HTTP\\Request"],["Sabre\\HTTP\\Response"]]},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\\DAV\\Server","type":"->","args":["method:DELETE",[["Sabre\\HTTP\\Request"],["Sabre\\HTTP\\Response"]]]},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php","line":253,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->","args":[["Sabre\\HTTP\\Request"],["Sabre\\HTTP\\Response"]]},{"file":"/var/www/html/apps/dav/lib/Server.php","line":370,"function":"start","class":"Sabre\\DAV\\Server","type":"->","args":[]},{"file":"/var/www/html/apps/dav/appinfo/v2/remote.php","line":19,"function":"exec","class":"OCA\\DAV\\Server","type":"->","args":[]},{"file":"/var/www/html/remote.php","line":146,"args":["/var/www/html/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/html/lib/private/Files/Cache/Cache.php","Line":658,"message":"Invalid source storage path: __groupfolders/36/myfolder","exception":{},"CustomMessage":"Invalid source storage path: __groupfolders/36/myfolder"}}
Browser log
Browser log
"DELETE /remote.php/dav/files/admin/subfolder/folder HTTP/1.1" 500 3481 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36"

<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
	<s:exception>Internal Server Error</s:exception>
	<s:message>
		The server was unable to complete your request.		If this happens again, please send the technical details below to the server administrator.		More details can be found in the server log.			</s:message>

	<s:technical-details>
		<s:remote-address></s:remote-address>
		<s:request-id>Lgr6VO1XrFck0NHuSzep</s:request-id>

			<s:type>Exception</s:type>
		<s:code>0</s:code>
		<s:message>Invalid source storage path: __groupfolders/59/myfolder</s:message>
		<s:file>/var/www/html/lib/private/Files/Cache/Cache.php</s:file>
		<s:line>658</s:line>

		<s:stacktrace>
			#0 /var/www/html/custom_apps/groupfolders/lib/Trash/TrashBackend.php(215): OC\Files\Cache\Cache-&gt;moveFromCache(Object(OCA\GroupFolders\ACL\ACLCacheWrapper), &#039;__groupfolders/...&#039;, &#039;__groupfolders/...&#039;)
#1 /var/www/html/apps/files_trashbin/lib/Trash/TrashManager.php(85): OCA\GroupFolders\Trash\TrashBackend-&gt;moveToTrash(Object(OCA\Files_Trashbin\Storage), &#039;myfolder&#039;)
#2 /var/www/html/apps/files_trashbin/lib/Storage.php(168): OCA\Files_Trashbin\Trash\TrashManager-&gt;moveToTrash(Object(OCA\Files_Trashbin\Storage), &#039;myfolder&#039;)
#3 /var/www/html/apps/files_trashbin/lib/Storage.php(90): OCA\Files_Trashbin\Storage-&gt;doDelete(&#039;myfolder&#039;, &#039;rmdir&#039;)
#4 /var/www/html/lib/private/Files/View.php(1136): OCA\Files_Trashbin\Storage-&gt;rmdir(&#039;myfolder&#039;)
#5 /var/www/html/lib/private/Files/View.php(286): OC\Files\View-&gt;basicOperation(&#039;rmdir&#039;, &#039;/test/New folde...&#039;, Array)
#6 /var/www/html/apps/dav/lib/Connector/Sabre/Directory.php(271): OC\Files\View-&gt;rmdir(&#039;/test/New folde...&#039;)
#7 /var/www/html/3rdparty/sabre/dav/lib/DAV/Tree.php(197): OCA\DAV\Connector\Sabre\Directory-&gt;delete()
#8 /var/www/html/3rdparty/sabre/dav/lib/DAV/CorePlugin.php(281): Sabre\DAV\Tree-&gt;delete(&#039;files/admin...&#039;)
#9 /var/www/html/3rdparty/sabre/event/lib/WildcardEmitterTrait.php(89): Sabre\DAV\CorePlugin-&gt;httpDelete(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
#10 /var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php(472): Sabre\DAV\Server-&gt;emit(&#039;method:DELETE&#039;, Array)
#11 /var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php(253): Sabre\DAV\Server-&gt;invokeMethod(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
#12 /var/www/html/apps/dav/lib/Server.php(370): Sabre\DAV\Server-&gt;start()
#13 /var/www/html/apps/dav/appinfo/v2/remote.php(19): OCA\DAV\Server-&gt;exec()
#14 /var/www/html/remote.php(146): require_once(&#039;/var/www/html/a...&#039;)
#15 {main}		</s:stacktrace>
		</s:technical-details>
</d:error>

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at custom_apps/groupfolders/lib/Trash/TrashBackend.php line 215 and trace the DELETE flow shown in the stack trace through files_trashbin and the cache move operation. Reproduce the group-folder and nested-folder scenario with advanced permissions enabled, then verify that deleting the nested folder completes without an Internal Server Error or failed-action message.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.