Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to delete a file/folder after switching to NC 30.0.4 and Group Folder 18.0.8 ("Delete file" action failed) #3496

Open
supr4s opened this issue Dec 17, 2024 · 19 comments · May be fixed by #3543
Labels
0. Needs triage Issues that need to be triaged bug

Comments

@supr4s
Copy link

supr4s commented Dec 17, 2024

Hi everyone,

Since upgrading to Nextcloud 30.0.4 and switching to Group Folder 18.0.8, it is no longer possible to delete a folder/file.

This issue will be linked to this one: #2604 => having had no feedback, I tested by updating everything and the initial problem disappeared, but now you can't no longer delete a folder/file.

Steps to reproduce

  1. Create group folders A & B
  2. Both group folders are only set has admin group and no advanced permissions
  3. Inside of each folders create a folder ( x inside of A and y inside of B )
  4. Share folder x to group G_x and share folder y to group G_y
  5. Now set group G_x and G_y to a user
  6. Connect to the user and try to delete a file/folder: permission denied. Create, edit, move => OK but not delete

Expected behaviour

A user with editing rights must be able to make the deletion.

Actual behaviour

From GUI :

"Delete file" action failed

From Nextcloud logs :

{"reqId":"NdoWtV8IPFSTLmSbtFle","level":3,"time":"2024-12-17T13:28:21+00:00","remoteAddr":"x.x.x.x","user":"demo02","app":"webdav","method":"DELETE","url":"/remote.php/dav/files/demo02/PARTAGE-EXAMPLE-COMMUN/hello.txt","message":"/demo02/files_trashbin/groupfolders/5","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:133.0) Gecko/20100101 Firefox/133.0","version":"30.0.4.1","exception":{"Exception":"OCP\\Files\\NotFoundException","Message":"/demo02/files_trashbin/groupfolders/5","Code":0,"Trace":[{"file":"/srv/nextcloud/www/lib/private/Files/Node/LazyFolder.php","line":141,"function":"get","class":"OC\\Files\\Node\\Root","type":"->"},{"file":"/srv/nextcloud/www/apps/groupfolders/lib/Trash/TrashBackend.php","line":245,"function":"get","class":"OC\\Files\\Node\\LazyFolder","type":"->"},{"file":"/srv/nextcloud/www/apps/files_trashbin/lib/Trash/TrashManager.php","line":85,"function":"moveToTrash","class":"OCA\\GroupFolders\\Trash\\TrashBackend","type":"->"},{"file":"/srv/nextcloud/www/apps/files_trashbin/lib/Storage.php","line":168,"function":"moveToTrash","class":"OCA\\Files_Trashbin\\Trash\\TrashManager","type":"->"},{"file":"/srv/nextcloud/www/apps/files_trashbin/lib/Storage.php","line":67,"function":"doDelete","class":"OCA\\Files_Trashbin\\Storage","type":"->"},{"file":"/srv/nextcloud/www/lib/private/Files/View.php","line":1136,"function":"unlink","class":"OCA\\Files_Trashbin\\Storage","type":"->"},{"file":"/srv/nextcloud/www/lib/private/Files/View.php","line":666,"function":"basicOperation","class":"OC\\Files\\View","type":"->"},{"file":"/srv/nextcloud/www/apps/dav/lib/Connector/Sabre/File.php","line":501,"function":"unlink","class":"OC\\Files\\View","type":"->"},{"file":"/srv/nextcloud/www/3rdparty/sabre/dav/lib/DAV/Tree.php","line":197,"function":"delete","class":"OCA\\DAV\\Connector\\Sabre\\File","type":"->"},{"file":"/srv/nextcloud/www/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":281,"function":"delete","class":"Sabre\\DAV\\Tree","type":"->"},{"file":"/srv/nextcloud/www/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpDelete","class":"Sabre\\DAV\\CorePlugin","type":"->"},{"file":"/srv/nextcloud/www/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/srv/nextcloud/www/apps/dav/lib/Connector/Sabre/Server.php","line":43,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/srv/nextcloud/www/apps/dav/lib/Server.php","line":371,"function":"start","class":"OCA\\DAV\\Connector\\Sabre\\Server","type":"->"},{"file":"/srv/nextcloud/www/apps/dav/appinfo/v2/remote.php","line":19,"function":"exec","class":"OCA\\DAV\\Server","type":"->"},{"file":"/srv/nextcloud/www/remote.php","line":146,"args":["/srv/nextcloud/www/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/srv/nextcloud/www/lib/private/Files/Node/Root.php","Line":187,"message":"/demo02/files_trashbin/groupfolders/5","exception":{},"CustomMessage":"/demo02/files_trashbin/groupfolders/5"}}

Not an isolated case, I have the same thing on a second server (same configuration).

Server configuration

  • Debian 12
  • PHP-FPM 8.2
  • MariaDB 10.11
  • Nextcloud 30.0.4
  • GF 18.0.8

Nextcloud log (data/nextcloud.log)

Nextcloud log
{"reqId":"NdoWtV8IPFSTLmSbtFle","level":3,"time":"2024-12-17T13:28:21+00:00","remoteAddr":"x.x.x.x","user":"demo02","app":"webdav","method":"DELETE","url":"/remote.php/dav/files/demo02/PARTAGE-EXAMPLE-COMMUN/hello.txt","message":"/demo02/files_trashbin/groupfolders/5","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:133.0) Gecko/20100101 Firefox/133.0","version":"30.0.4.1","exception":{"Exception":"OCP\\Files\\NotFoundException","Message":"/demo02/files_trashbin/groupfolders/5","Code":0,"Trace":[{"file":"/srv/nextcloud/www/lib/private/Files/Node/LazyFolder.php","line":141,"function":"get","class":"OC\\Files\\Node\\Root","type":"->"},{"file":"/srv/nextcloud/www/apps/groupfolders/lib/Trash/TrashBackend.php","line":245,"function":"get","class":"OC\\Files\\Node\\LazyFolder","type":"->"},{"file":"/srv/nextcloud/www/apps/files_trashbin/lib/Trash/TrashManager.php","line":85,"function":"moveToTrash","class":"OCA\\GroupFolders\\Trash\\TrashBackend","type":"->"},{"file":"/srv/nextcloud/www/apps/files_trashbin/lib/Storage.php","line":168,"function":"moveToTrash","class":"OCA\\Files_Trashbin\\Trash\\TrashManager","type":"->"},{"file":"/srv/nextcloud/www/apps/files_trashbin/lib/Storage.php","line":67,"function":"doDelete","class":"OCA\\Files_Trashbin\\Storage","type":"->"},{"file":"/srv/nextcloud/www/lib/private/Files/View.php","line":1136,"function":"unlink","class":"OCA\\Files_Trashbin\\Storage","type":"->"},{"file":"/srv/nextcloud/www/lib/private/Files/View.php","line":666,"function":"basicOperation","class":"OC\\Files\\View","type":"->"},{"file":"/srv/nextcloud/www/apps/dav/lib/Connector/Sabre/File.php","line":501,"function":"unlink","class":"OC\\Files\\View","type":"->"},{"file":"/srv/nextcloud/www/3rdparty/sabre/dav/lib/DAV/Tree.php","line":197,"function":"delete","class":"OCA\\DAV\\Connector\\Sabre\\File","type":"->"},{"file":"/srv/nextcloud/www/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":281,"function":"delete","class":"Sabre\\DAV\\Tree","type":"->"},{"file":"/srv/nextcloud/www/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpDelete","class":"Sabre\\DAV\\CorePlugin","type":"->"},{"file":"/srv/nextcloud/www/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/srv/nextcloud/www/apps/dav/lib/Connector/Sabre/Server.php","line":43,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/srv/nextcloud/www/apps/dav/lib/Server.php","line":371,"function":"start","class":"OCA\\DAV\\Connector\\Sabre\\Server","type":"->"},{"file":"/srv/nextcloud/www/apps/dav/appinfo/v2/remote.php","line":19,"function":"exec","class":"OCA\\DAV\\Server","type":"->"},{"file":"/srv/nextcloud/www/remote.php","line":146,"args":["/srv/nextcloud/www/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/srv/nextcloud/www/lib/private/Files/Node/Root.php","Line":187,"message":"/demo02/files_trashbin/groupfolders/5","exception":{},"CustomMessage":"/demo02/files_trashbin/groupfolders/5"}}
@supr4s
Copy link
Author

supr4s commented Dec 17, 2024

Temporary fix: delete/disable the trash app (Deleted files). Now I don't have any problems!

@Jormodn
Copy link

Jormodn commented Dec 19, 2024

I can confirm the bug and the Workaround

@schengawegga
Copy link

I have the same problem.
Disabling the "Deleted files" app will fix this error temporarily, but it is not a good option for my business.
After creating the folder "/demo02/files_trashbin/groupfolders/5" on the filesystem manually, the file can be deleted now, but it will NOT be shown in the users or in the groupfolders trash bin at all.
The file was moved correctly in that filesystem folder, but a recovery of that file will be impossible.

Also the deletion will not be shown in the users activities, but in the groupadmins activities without the filename and a file not found icon.

@supr4s
Copy link
Author

supr4s commented Jan 8, 2025

Yes indeed, it's only a temporary fix, I also need the trashbin but there's no alternative for the moment ..
@joshtrichards perhaps you could pass this to the development teams ?

@Kryptopirat
Copy link

I can also confirm the error and the workaround.

@Nordlead75
Copy link

i have the same error

@Longjogger
Copy link

This error is very annoying and the workaround is in most settings no option. When is the fix expected?

@EGVuser
Copy link

EGVuser commented Jan 17, 2025

i have the same error

@DocSnyderLiMA
Copy link

Same Problem here...

@InformaticaICFE
Copy link

InformaticaICFE commented Jan 17, 2025

Same Problem, But Found a Solution That Worked for Me

I also had the same issue. I found a solution that worked in my case since I share subfolders, not the root group folder.

  1. I created account groups and added users to each group.
  2. Then, in the group folder settings, I added the group on both sides (group or team, advanced permissions) without granting any permissions.
  3. Next, I went to the files section, found the root folder, and in the sharing options, I selected the group that should have access to it and only granted write permissions. (bottom section)
  4. For the subfolders that the group needed access to, I granted the respective permissions (at the top).
  5. If there was an additional subfolder under the root that the group wasn’t authorized to access, I went to that folder, selected "share," and in the bottom section, I denied permissions for that group.

That’s it!

What I’ve noticed is that the trash bin is tied to the root group folder. Since users only have write permissions for the subfolders, this causes an error when deleting files. My suggestion to the development team would be:

  • Create trash bins for the subfolders themselves.

  • Alternatively, if keeping the current approach, ensure that when write permissions are granted to a subfolder, users are also granted write access to the root trash bin where deleted items are stored.

I hope this helps others. So far, it’s working for me.

Best regards!

@icewind1991
Copy link
Member

Please verify if #3543 fixes the issue for you

@dirkpape
Copy link

Please verify if #3543 fixes the issue for you

I can confirm, that the fix works. Thank you!

@DocSnyderLiMA
Copy link

DocSnyderLiMA commented Jan 17, 2025

Please verify if #3543 fixes the issue for you

For me the error persists:

"unable to rename, destination directory is not writable : __groupfolders/trash/2"

@DocSnyderLiMA
Copy link

DocSnyderLiMA commented Jan 20, 2025

Please verify if #3543 fixes the issue for you

For me the error persists:

"unable to rename, destination directory is not writable : __groupfolders/trash/2"

The problem was something else: the folder did not exist - by manually creating __groupfolders/trash/2 the folder, I can delete the subfolder now.

So the fix work!

@schengawegga
Copy link

Please verify if #3543 fixes the issue for you

This fix works for me, too. Thank you.

@Longjogger
Copy link

Unfortunately, this fix is not working.
When I share a Groupfolders resource with another account, I need to manually create a Groupfolders trash folder in the data directory of that account (e.g., /data/[account]/files_trashbin/groupfolders/[groupfolderid]):
Error in log:

[webdav] Fehler: /[account]/files_trashbin/groupfolders/[groupfolderid]
	DELETE /remote.php/dav/files/[account]/test/[file]
	von [IP] von [account] um 21.01.2025, 13:46:59

Additionally, deleting does not work when sharing via link.
Error in log:

[webdav] Fehler: file moved to trash with no user in context
	DELETE /public.php/dav/files/oD2D4H2cQ6ewXB7/[file]
	von [IP] von -- um 21.01.2025, 13:43:26

I believe the current trashbin architecture is flawed. If a Groupfolders resource is deleted—whether by the original user, a shared user, or via a shared link—the corresponding trashbin folder should be located at /data/__groupfolders/[groupfolderid]/trash/.

@pabzm
Copy link

pabzm commented Jan 21, 2025

Please verify if #3543 fixes the issue for you

I can confirm that it fixes the issue with v29.0.11, too.

@markus-rothkoetter
Copy link

#3543 works as a workaround on 30.0.5, too.

We are running a large-scale cloud instance with many users and experienced the same issue:
If a group folder is shared directly only and not via a user-group based-sharing, deletion fails due to a non-existing path.

Due to the data and user-scale, manually creating folders or taking no immediate action is no option.

We applied #3543 manually, which allows deletions again.
Restoring can be done by the original sharing party from the personal trashbin.

Since this bug will immediately and severely limit existing cloud shares, we'd strongly encourage including this workaround or some kind of fix as part of the next patch level update.

@supr4s
Copy link
Author

supr4s commented Jan 27, 2025

EDIT : Unfortunately the fix didn't work, I still have the case on most of my servers. I haven't investigated yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Issues that need to be triaged bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.