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

problems with local external storage? #141

Closed
szaimen opened this issue Sep 11, 2020 · 16 comments · Fixed by #167
Closed

problems with local external storage? #141

szaimen opened this issue Sep 11, 2020 · 16 comments · Fixed by #167

Comments

@szaimen
Copy link

szaimen commented Sep 11, 2020

Hi, I just installed picocms to try it out and got the following error message while trying to create a new test-site with a user.
Which is strange because my user has the permission to create folders in there.
(I am using local external storage with picocms 1.0.9 on NC19.0.2)
Please tell me if you need more infos (and please which ones)

{"reqId":"rDCUL26nlqEJ3R9F69Yl","level":2,"time":"2020-09-11T11:22:34+02:00","remoteAddr":"87.123.152.204","user":"Simon","app":"cms_pico","method":"POST","url":"/apps/cms_pico/personal/websites","message":{"Exception":"OCP\\Files\\NotPermittedException","Message":"No create permission for folder","Code":0,"Trace":[{"file":"/var/www/nextcloud/apps/cms_pico/lib/Files/StorageFolder.php","line":143,"function":"newFolder","class":"OC\\Files\\Node\\Folder","type":"->"},{"file":"/var/www/nextcloud/apps/cms_pico/lib/Service/TemplatesService.php","line":261,"function":"newFolder","class":"OCA\\CMSPico\\Files\\StorageFolder","type":"->"},{"file":"/var/www/nextcloud/apps/cms_pico/lib/Service/WebsitesService.php","line":142,"function":"installTemplate","class":"OCA\\CMSPico\\Service\\TemplatesService","type":"->"},{"file":"/var/www/nextcloud/apps/cms_pico/lib/Controller/WebsitesController.php","line":112,"function":"createWebsite","class":"OCA\\CMSPico\\Service\\WebsitesService","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":170,"function":"createPersonalWebsite","class":"OCA\\CMSPico\\Controller\\WebsitesController","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":100,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":137,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Routing/RouteActionHandler.php","line":47,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"function":"__invoke","class":"OC\\AppFramework\\Routing\\RouteActionHandler","type":"->"},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":297,"function":"call_user_func"},{"file":"/var/www/nextcloud/lib/base.php","line":1012,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud/index.php","line":37,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud/lib/private/Files/Node/Folder.php","Line":171,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.83 Safari/537.36","version":"19.0.2.2","id":"5f5b439e830f1"}

@PhrozenByte
Copy link
Collaborator

OCP\Files\NotPermittedException: No create permission for folder

Make sure that your webserver resp. PHP process actually has permission to read & write on the directory in question.

@szaimen
Copy link
Author

szaimen commented Sep 11, 2020

Hi @PhrozenByte thank your for the answer. Yes, my webserver has access to the location in question since the folder creation and storage access for that user on that local-external-storage works without any problem (in the files app). This is why I assumed an issue with the cms_pico app in the first place...

@stale

This comment has been minimized.

@stale stale bot added the info: Stale label Sep 20, 2020
@szaimen

This comment has been minimized.

@stale stale bot removed the info: Stale label Sep 20, 2020
@szaimen
Copy link
Author

szaimen commented Sep 20, 2020

@PhrozenByte it seems like here are some information missing because I don't consider this a question.
What information can I provide to you to make this issue solvable?

@szaimen
Copy link
Author

szaimen commented Sep 20, 2020

I made a screenrecording:
Screenrecording.zip

@PhrozenByte
Copy link
Collaborator

Unfortunately I'm unable to provide any more help here: Nextcloud (read: the PHP process) is complaining that it doesn't have permission to create a new folder. That's neither an issue with Nextcloud nor the app. Check the permissions again and if it still doesn't work, contact your server admin.

@szaimen
Copy link
Author

szaimen commented Sep 23, 2020

As you could see in my video, Nextcloud (the files app) is actually able to create a folder there. Only the cms_pico app isn't able to do so. So I still think that this is an issue with the cms_pico app.

And btw: the permissions should be correct: www-data:www-data 770 are the permissions for the folder where cms_puco fails to create a new subfolder. So the webserver does have create permissions. Does the PHP process need extra permissions?

@parajbs

This comment has been minimized.

@szaimen
Copy link
Author

szaimen commented Sep 24, 2020

@parajbs this has nothing to do with my issue. Please open a new one. For me the server-side-encryption isn't enabled and cms_pico cannot create new folders although I am using local external storage and the rights are set correctly and the Nextcloud files app is able to create new folders.

@stale
Copy link

stale bot commented Oct 4, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in two days if no further activity occurs. Thank you for your contributions! 👍

@PhrozenByte
Copy link
Collaborator

I still can't reproduce this. Nextcloud is reporting that it has no permission to create new folders, so I can just hint you once again to check all folders in between whether PHP has permission to create folders. This must also include the base path of the external storage.

@stale

This comment has been minimized.

@stale stale bot added the info: Stale label Oct 11, 2020
@szaimen
Copy link
Author

szaimen commented Oct 12, 2020

I still think that this is an issue with your app since creating folder works without any issue with the files app.

But since you are obviously not interested in fixing this bug, I go ahead and close this issue. Fighting against the stale bot is not worth it.

@szaimen szaimen closed this as completed Oct 12, 2020
@szaimen
Copy link
Author

szaimen commented Feb 24, 2021

@PhrozenByte fyi: I've just experienced a comparable bug in NC21 which seems to have the same root cause:
nextcloud/server#25787 (comment)

@szaimen
Copy link
Author

szaimen commented Apr 1, 2021

@PhrozenByte there was a PR in the server repository created that fixes my issues with read only root folder and the following was suggested about this issue here: nextcloud/server#26396 (comment)

Seems to be a similar case where the pico_cms app would need a related fix to get the node of the parent directory first before creating the file, so I'd suggest to open an issue in the apps repo.

PhrozenByte added a commit that referenced this issue Apr 1, 2021
Nextcloud's file operations API apparently is unable to proberly deal with relative paths (even though the docs tell us otherwise). It (a) performs file permission checks on the base directory rather than the respective parent directory (:confused:), and (b) blocks relative paths like '..' (likely as a security measure - by using the most unsophisticated approach :unamused:). Also see nextcloud/server#26396. We better do this on our own...

Fixes #141

Signed-off-by: Daniel Rudolf <github.com@daniel-rudolf.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants