nextcloud / nextcloud/groupfolders
Unable to empty trashbin after deleting a file from a folder with "Deny delete" ACL
Nobody has claimed this yet.
- 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
- Create FolderA within a Team Folder.
- Set an ACL rule for FolderA: user Test -> Deny delete.
- Create a file file.md inside FolderA.
- Set an ACL rule specifically for file.md: User Test -> Allow delete.
- Log in as user Test.
- Delete file.md (it moves to trashbin successfully).
- Attempt to Clear trashbin.
Expected behaviour
The trashbin is emptied successfully, and the file is permanently deleted.
Actual behaviour
An error message appears: "Failed to empty deleted files". The file remains in the trashbin.
Server configuration
Operating system: Debian 13
Web server: nginx 1.26.3
Database: MariaDB 11.8.3
PHP version: 8.4
Nextcloud version: 32.0.6
Team folders version: 20.1.12
Updated from an older Nextcloud/ownCloud or fresh install: updated from 32.0.5
Where did you install Nextcloud from:
Are you using external storage, if yes which one: no
Are you using encryption: no
Are you using an external user-backend, if yes which one: Nextcloud Desktop Client 4.0.6 (Windows)
Client configuration
Browser: Firefox 147.0.2
Operating system: openSUSE Tumbleweed
Logs
Nextcloud log (data/nextcloud.log)
Nextcloud log
{"reqId":"rHadMyIUbLn1Mq8a1mXy","level":3,"time":"2026-02-22T15:06:30+03:00","remoteAddr":"xxx.xxx.xxx.xxx","user":"test","app":"no app in context","method":"DELETE","url":"/remote.php/dav/trashbin/test/trash","scriptName":"/remote.php","message":"Uncaught exception","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:147.0) Gecko/20100101 Firefox/147.0","version":"32.0.6.1","exception":{"Exception":"OCP\\Files\\NotPermittedException","Message":"","Code":0,"Trace":[{"file":"/var/www/nextcloud/apps/files_trashbin/lib/Trash/TrashManager.php","line":52,"function":"removeItem","class":"OCA\\GroupFolders\\Trash\\TrashBackend","type":"->"},{"file":"/var/www/nextcloud/apps/files_trashbin/lib/Sabre/TrashRoot.php","line":36,"function":"removeItem","class":"OCA\\Files_Trashbin\\Trash\\TrashManager","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php","line":197,"function":"delete","class":"OCA\\Files_Trashbin\\Sabre\\TrashRoot","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":281,"function":"delete","class":"Sabre\\DAV\\Tree","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpDelete","class":"Sabre\\DAV\\CorePlugin","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/Server.php","line":212,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Server.php","line":426,"function":"start","class":"OCA\\DAV\\Connector\\Sabre\\Server","type":"->"},{"file":"/var/www/nextcloud/apps/dav/appinfo/v2/remote.php","line":22,"function":"exec","class":"OCA\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/remote.php","line":151,"args":["/var/www/nextcloud/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/nextcloud/apps/groupfolders/lib/Trash/TrashBackend.php","Line":226,"message":"Uncaught exception","exception":[],"CustomMessage":"Uncaught exception"},"id":"699af14957f7a"}
{"reqId":"rHadMyIUbLn1Mq8a1mXy","level":3,"time":"2026-02-22T15:06:30+03:00","remoteAddr":"xxx.xxx.xxx.xxx","user":"test","app":"webdav","method":"DELETE","url":"/remote.php/dav/trashbin/test/trash","scriptName":"/remote.php","message":"Exception thrown: OCP\\Files\\NotPermittedException","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:147.0) Gecko/20100101 Firefox/147.0","version":"32.0.6.1","exception":{"Exception":"OCP\\Files\\NotPermittedException","Message":"","Code":0,"Trace":[{"file":"/var/www/nextcloud/apps/files_trashbin/lib/Trash/TrashManager.php","line":52,"function":"removeItem","class":"OCA\\GroupFolders\\Trash\\TrashBackend","type":"->"},{"file":"/var/www/nextcloud/apps/files_trashbin/lib/Sabre/TrashRoot.php","line":36,"function":"removeItem","class":"OCA\\Files_Trashbin\\Trash\\TrashManager","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php","line":197,"function":"delete","class":"OCA\\Files_Trashbin\\Sabre\\TrashRoot","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":281,"function":"delete","class":"Sabre\\DAV\\Tree","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpDelete","class":"Sabre\\DAV\\CorePlugin","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/Server.php","line":212,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Server.php","line":426,"function":"start","class":"OCA\\DAV\\Connector\\Sabre\\Server","type":"->"},{"file":"/var/www/nextcloud/apps/dav/appinfo/v2/remote.php","line":22,"function":"exec","class":"OCA\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/remote.php","line":151,"args":["/var/www/nextcloud/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/nextcloud/apps/groupfolders/lib/Trash/TrashBackend.php","Line":226,"message":"","exception":[],"CustomMessage":"Exception thrown: OCP\\Files\\NotPermittedException"},"id":"699af14957fa0"}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at apps/groupfolders/lib/Trash/TrashBackend.php:226 and follow the DELETE /remote.php/dav/trashbin/test/trash path through files_trashbin/lib/Trash/TrashManager.php:52. Reproduce the FolderA/file.md ACL scenario and use the logged NotPermittedException as the failure signal. Done means clearing the trashbin succeeds and file.md is permanently removed in this case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- authorization
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100