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

403 Forbidden on "MOVE" when moving files from a groupfolder to a other #2604

Open
Ozerim opened this issue Oct 30, 2023 · 6 comments
Open
Labels
0. Needs triage Issues that need to be triaged bug needs review Needs confirmation this is still happening or relevant (or possible duplicate TBD)

Comments

@Ozerim
Copy link

Ozerim commented Oct 30, 2023

  • 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 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 cut & paste a file from x folder to y folder

Expected behaviour

The file should be moved to the y folder

Actual behaviour

The file doesn't move from x folder

additional information

The admin can cut & paste without any issue. Seems like it's a permissions issue but the user has the correct permission to do such task.

Server configuration

Operating system:

Debian 12 (Bookworm)

Web server:

nginx 1.22.1

Database:

MariaDB 10.11.4

PHP version:

PHP 8.2.8

Nextcloud version: (see Nextcloud admin page)

27.1.2

Group folders version:

15.3.1

Client configuration

Browser:

Firefox/Chrome

Operating system:

Windows 10/11

Logs

Web server error log

Web server error log
08:31:06||XXXX_XXXX/test.txt -> XXXX_XXXX/test.txt|4|1|1698309029|8a62cf4af9eb252c7f77aa6a70d22186|0|00141238ocvf27t1842r|2|The server replied "403 Forbidden"  on "MOVE"

Nextcloud log (data/nextcloud.log)

Nextcloud log

{"reqId":"CZhPTU5tBbaFTc45x95s","level":3,"time":"2023-10-26T15:44:35+00:00","remoteAddr":"90.93.71.109","user":"user","app":"core","method":"MOVE","url":"/remote.php/dav/files/user/INTER_AGENCE_COMMUN%20(2)/TEST.txt","message":"unable to rename, source directory is not writable : /srv/nextcloud/nextcloud_DATA/INTER_AGENCE_COMMUN","userAgent":"Mozilla/5.0 (Windows) mirall/3.10.0stable-Win64 (build 20230915) (Nextcloud, windows-10.0.22621 ClientArchitecture: x86_64 OsArchitecture: x86_64)","version":"27.1.2.1","data":{"app":"core"}}

@Ozerim Ozerim added 0. Needs triage Issues that need to be triaged bug labels Oct 30, 2023
@Ozerim Ozerim changed the title 403 Forbidden on "MOVE" when moving file from a groupfolder to a other 403 Forbidden on "MOVE" when moving files from a groupfolder to a other Oct 30, 2023
@joshtrichards
Copy link
Member

joshtrichards commented Oct 31, 2023

Hmm. Based on the error I would expect it to complain about
/srv/nextcloud/nextcloud_DATA/INTER_AGENCE_COMMUN%20(2)/ rather than /srv/nextcloud/nextcloud_DATA/INTER_AGENCE_COMMUN (if anything).

I assume /srv/nextcloud/nextcloud_DATA/INTER_AGENCE_COMMUN is bogus (i.e. neither the source nor destination parent folder)?

Does this only happen with folders with spaces enclosed in them by chance?

https://github.com/nextcloud/server/blob/16bfe0cc65c3c4603c24d10c904c1aef39d5a9a2/lib/private/Files/Storage/Local.php#L345-L352

@Ozerim
Copy link
Author

Ozerim commented Oct 31, 2023

@joshtrichards I've tried on a fresh nextcloud install with folder named "Test1" and "Test2" and the same problem happened... So don't think the issue come from the folder especially.

@supr4s
Copy link

supr4s commented Dec 20, 2023

Hi everyone,

Same problem here.

Context :

  • Group Folder A with admin rights only
  • In Group Folder A, create a shared folder DATA_A with permissions given to group G_DATA_A

(we prefer to create a subfolder that we share directly with the user, rather than giving him direct rights to the folder created by Group Folder)

  • Group Folder B with admin rights only

  • In Group Folder B, create a folder DATA_B with permissions given to group G_DATA_B

  • User with rights to folders G_DATA_A and G_DATA_B, if you try to move a file from DATA_A to DATA_B via the web interface : error

{"reqId":"bNBtrCYrGxfKlRilLo84","level":3,"time":"2023-12-20T11:16:53+00:00","remoteAddr":"xxxx","user":"e.barre","app":"no app in context","method":"POST","url":"/ocs/v2.php/apps/files/api/v1/templates/create","message":"Could not create path \"/e.barre/files/00_LOGOS/toto.txt\"","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:120.0) Gecko/20100101 Firefox/120.0","version":"27.1.4.1","exception":{"Exception":"OCP\\Files\\NotPermittedException","Message":"Could not create path \"/e.barre/files/00_LOGOS/toto.txt\"","Code":0,"Trace":[{"file":"/srv/nextcloud/www/lib/private/Files/Template/TemplateManager.php","line":162,"function":"newFile","class":"OC\\Files\\Node\\Folder","type":"->"},{"file":"/srv/nextcloud/www/apps/files/lib/Controller/TemplateController.php","line":57,"function":"createFromTemplate","class":"OC\\Files\\Template\\TemplateManager","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/srv/nextcloud/www/lib/private/AppFramework/Http/Dispatcher.php","line":230,"function":"create","class":"OCA\\Files\\Controller\\TemplateController","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/srv/nextcloud/www/lib/private/AppFramework/Http/Dispatcher.php","line":137,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/srv/nextcloud/www/lib/private/AppFramework/App.php","line":183,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/srv/nextcloud/www/lib/private/Route/Router.php","line":315,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/srv/nextcloud/www/ocs/v1.php","line":64,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/srv/nextcloud/www/ocs/v2.php","line":23,"args":["/srv/nextcloud/www/ocs/v1.php"],"function":"require_once"}],"File":"/srv/nextcloud/www/lib/private/Files/Node/Folder.php","Line":193,"message":"Could not create path \"/e.barre/files/00_LOGOS/toto.txt\"","exception":{},"CustomMessage":"Could not create path \"/e.barre/files/00_LOGOS/toto.txt\""}}

To correct the error, we need to revise our system and not create a subfolder :

  • Creation of a Group Folder A, with admin group rights and also permission for group G_DATA_A

  • Creation of a Group Folder B, with admin group rights and G_DATA_B group permissions.

And now you can move a file between folders!

It's not too serious, but it's a mistake we didn't have before. However, I can't say which version it's been in, as we only noticed it recently, and several version upgrades have been carried out on the Nextcloud server and also on the Group Folders application.

@supr4s
Copy link

supr4s commented Mar 29, 2024

I tried again on the latest LTS (28.0.4). Same thing, but different error message:

unable to rename, source directory is not writable: /srv/nextcloud/nextcloud_DATA/PARTAGE-DEMO01

Still unable to move a file to another Group Folder. No problem to copy/paste a file/folder.

@joshtrichards
Copy link
Member

Related: #1097 & #3086

@supr4s
Copy link

supr4s commented Dec 17, 2024

Hi everyone,

A switch to Nextcloud 30.4.4 and GF 18.0.8 seems to have fixed the problem! Moving folders from one folder to another is no longer a problem.

However, this has led to another problem: problems when deleting a file/folder: #3496

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 needs review Needs confirmation this is still happening or relevant (or possible duplicate TBD)
Projects
None yet
Development

No branches or pull requests

3 participants