Repository navigation
[Bug]: NotPermittedException errors in fresh nc installation #33066
Description
⚠️ This issue respects the following points: ⚠️
- This is a bug, not a question or a configuration/webserver/proxy issue.
- This issue is not already reported on Github (I've searched it).
- Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
- I agree to follow Nextcloud's Code of Conduct.
Bug description
When clicking in fresh nc installation (v24.0.2 but was seen in earlier versions also) sometimes NotPermittedException occurs in error log; with #33061 applied one can see, that nc probably tries to create dir in / not in datadirectory (which is set not to / but to /some/subdir and permissions are ok there).
Examples:
(1) /appdata_oc034hqmkiqu/js/files
2022-06-29 11:43:56 [...] {"reqId":"mHgE762aPEcPc8eNUepJ","level":3,"time":"2022-06-29T09:43:56+00:00","remoteAddr":"[...]","user":"[...]","app":"index","method":"GET","url":"/apps/files/","message":"{\"Exception\":\"OCP\\\\Files\\\\NotPermittedException\",\"Message\":\"Could not create folder \\\"/appdata_oc034hqmkiqu/js/files\\\"\",\"Code\":0,\"Trace\":[{\"file\":\"/var/www/nextcloud/lib/private/Files/AppData/AppData.php\",\"line\":156,\"function\":\"newFolder\",\"class\":\"OC\\\\Files\\\\Node\\\\Folder\",\"type\":\"->\"},{\"file\":\"/var/www/nextcloud/lib/private/Template/JSCombiner.php\",\"line\":91,\"function\":\"newFolder\",\"class\":\"OC\\\\Files\\\\AppData\\\\AppData\",\"type\":\"->\"},{\"file\":\"/var/www/nextcloud/lib/private/Template/JSResourceLocator.php\",\"line\":123,\"function\":\"process\",\"class\":\"OC\\\\Template\\\\JSCombiner\",\"type\":\"->\"},{\"file\":\"/var/www/nextcloud/lib/private/Template/JSResourceLocator.php\",\"line\":110,\"function\":\"cacheAndAppendCombineJsonIfExist\",\"class\":\"OC\\\\Template\\\\JSResourceLocator\",\"type\":\"->\"},{\"file\":\"/var/www/nextcloud/lib/private/Template/ResourceLocator.php\",\"line\":78,\"function\":\"doFind\",\"class\":\"OC\\\\Template\\\\JSResourceLocator\",\"type\":\"->\"},{\"file\":\"/var/www/nextcloud/lib/private/TemplateLayout.php\",\"line\":377,\"function\":\"find\",\"class\":\"OC\\\\Template\\\\ResourceLocator\",\"type\":\"->\"},{\"file\":\"/var/www/nextcloud/lib/private/TemplateLayout.php\",\"line\":205,\"function\":\"findJavascriptFiles\",\"class\":\"OC\\\\TemplateLayout\",\"type\":\"::\"},{\"file\":\"/var/www/nextcloud/lib/private/legacy/OC_Template.php\",\"line\":185,\"function\":\"__construct\",\"class\":\"OC\\\\TemplateLayout\",\"type\":\"->\"},{\"file\":\"/var/www/nextcloud/lib/public/AppFramework/Http/TemplateResponse.php\",\"line\":204,\"function\":\"fetchPage\",\"class\":\"OC_Template\",\"type\":\"->\"},{\"file\":\"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php\",\"line\":178,\"function\":\"render\",\"class\":\"OCP\\\\AppFramework\\\\Http\\\\TemplateResponse\",\"type\":\"->\"},{\"file\":\"/var/www/nextcloud/lib/private/AppFramework/App.php\",\"line\":172,\"function\":\"dispatch\",\"class\":\"OC\\\\AppFramework\\\\Http\\\\Dispatcher\",\"type\":\"->\"},{\"file\":\"/var/www/nextcloud/lib/private/Route/Router.php\",\"line\":298,\"function\":\"main\",\"class\":\"OC\\\\AppFramework\\\\App\",\"type\":\"::\"},{\"file\":\"/var/www/nextcloud/lib/base.php\",\"line\":1023,\"function\":\"match\",\"class\":\"OC\\\\Route\\\\Router\",\"type\":\"->\"},{\"file\":\"/var/www/nextcloud/index.php\",\"line\":36,\"function\":\"handleRequest\",\"class\":\"OC\",\"type\":\"::\"}],\"File\":\"/var/www/nextcloud/lib/private/Files/Node/Folder.php\",\"Line\":164,\"CustomMessage\":\"--\"}","[...]","version":"24.0.2.1"}
(2) /appdata_oc1uj5kj618l/css/dashboard
2022-06-29 16:47:22 [...] {"reqId":"faFapQIgCcxdIgKnVLaR","level":3,"time":"2022-06-29T14:47:22+00:00","remoteAddr":"[...]","user":"[...]","app":"index","method":"GET","url":"/apps/dashboard/","message":"{\"Exception\":\"OCP\\\\Files\\\\NotPermittedException\",\"Message\":\"Could not create folder \\\"/appdata_oc1uj5kj618l/css/dashboard\\\"\",\"Code\":0,\"Trace\":[{\"file\":\"/var/www/nextcloud/lib/private/Files/AppData/AppData.php\",\"line\":156,\"function\":\"newFolder\",\"class\":\"OC\\\\Files\\\\Node\\\\Folder\",\"type\":\"->\"},{\"file\":\"/var/www/nextcloud/lib/private/Template/SCSSCacher.php\",\"line\":151,\"function\":\"newFolder\",\"class\":\"OC\\\\Files\\\\AppData\\\\AppData\",\"type\":\"->\"},{\"file\":\"/var/www/nextcloud/lib/private/Template/CSSResourceLocator.php\",\"line\":109,\"function\":\"process\",\"class\":\"OC\\\\Template\\\\SCSSCacher\",\"type\":\"->\"},{\"file\":\"/var/www/nextcloud/lib/private/Template/CSSResourceLocator.php\",\"line\":84,\"function\":\"cacheAndAppendScssIfExist\",\"class\":\"OC\\\\Template\\\\CSSResourceLocator\",\"type\":\"->\"},{\"file\":\"/var/www/nextcloud/lib/private/Template/ResourceLocator.php\",\"line\":78,\"function\":\"doFind\",\"class\":\"OC\\\\Template\\\\CSSResourceLocator\",\"type\":\"->\"},{\"file\":\"/var/www/nextcloud/lib/private/TemplateLayout.php\",\"line\":342,\"function\":\"find\",\"class\":\"OC\\\\Template\\\\ResourceLocator\",\"type\":\"->\"},{\"file\":\"/var/www/nextcloud/lib/private/TemplateLayout.php\",\"line\":250,\"function\":\"findStylesheetFiles\",\"class\":\"OC\\\\TemplateLayout\",\"type\":\"::\"},{\"file\":\"/var/www/nextcloud/lib/private/legacy/OC_Template.php\",\"line\":185,\"function\":\"__construct\",\"class\":\"OC\\\\TemplateLayout\",\"type\":\"->\"},{\"file\":\"/var/www/nextcloud/lib/public/AppFramework/Http/TemplateResponse.php\",\"line\":204,\"function\":\"fetchPage\",\"class\":\"OC_Template\",\"type\":\"->\"},{\"file\":\"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php\",\"line\":178,\"function\":\"render\",\"class\":\"OCP\\\\AppFramework\\\\Http\\\\TemplateResponse\",\"type\":\"->\"},{\"file\":\"/var/www/nextcloud/lib/private/AppFramework/App.php\",\"line\":172,\"function\":\"dispatch\",\"class\":\"OC\\\\AppFramework\\\\Http\\\\Dispatcher\",\"type\":\"->\"},{\"file\":\"/var/www/nextcloud/lib/private/Route/Router.php\",\"line\":298,\"function\":\"main\",\"class\":\"OC\\\\AppFramework\\\\App\",\"type\":\"::\"},{\"file\":\"/var/www/nextcloud/lib/base.php\",\"line\":1023,\"function\":\"match\",\"class\":\"OC\\\\Route\\\\Router\",\"type\":\"->\"},{\"file\":\"/var/www/nextcloud/index.php\",\"line\":36,\"function\":\"handleRequest\",\"class\":\"OC\",\"type\":\"::\"}],\"File\":\"/var/www/nextcloud/lib/private/Files/Node/Folder.php\",\"Line\":165,\"CustomMessage\":\"--\"}","userAgent":"[...]","version":"24.0.2.1"}
After errors, directory appdata_[...] specified in messages exists in datadirectory and nc is working fine, no other errors occur.
Sounds like some kind of race in fresh installation, before appdata_* subdir is created in datadirectory.
Similar reports (probably same cause):
#29980
https://help.nextcloud.com/t/ocp-files-notpermittedexception-could-not-create-folder/133818
https://help.nextcloud.com/t/could-not-create-folder-false-error/65962
Steps to reproduce
Initialize fresh nc installation and do some clicking (files, dashboard) and check error log. If no such message - try again after initialization (problem does not occur on every install).
Expected behavior
No NotPermittedException errors in log when datadirectory points to path with correct permissions.
Installation method
Manual installation
Operating system
Debian/Ubuntu
PHP engine version
PHP 7.4
Web server
Apache (supported)
Database engine version
MariaDB
Is this bug present after an update or on a fresh install?
Fresh Nextcloud Server install
Are you using the Nextcloud Server Encryption module?
Encryption is Disabled
What user-backends are you using?
- Default user-backend (database)
- LDAP/ Active Directory
- SSO - SAML
- Other
Configuration report
No response
List of activated Apps
Enabled:
- accessibility: 1.10.0
- admin_audit: 1.14.0
- calendar: 3.4.0
- cloud_federation_api: 1.7.0
- comments: 1.14.0
- contacts: 4.1.1
- dashboard: 7.4.0
- dav: 1.22.0
- federatedfilesharing: 1.14.0
- files: 1.19.0
- files_sharing: 1.16.2
- files_trashbin: 1.14.0
- files_versions: 1.17.0
- lookup_server_connector: 1.12.0
- oauth2: 1.12.0
- previewgenerator: 5.0.0
- provisioning_api: 1.14.0
- settings: 1.6.0
- spreed: 14.0.2
- systemtags: 1.14.0
- theming: 1.15.0
- twofactor_backupcodes: 1.13.0
- user_ldap: 1.14.1
- user_saml: 5.0.2
- user_status: 1.4.0
- viewer: 1.8.0
- workflowengine: 2.6.0
Disabled:
- contactsinteraction: 1.5.0
- encryption
- federation: 1.14.0
- files_external
- sharebymail: 1.14.0
- testing
- updatenotification: 1.14.0
- weather_status: 1.4.0Nextcloud Signing status
No response
Nextcloud Logs
No response
Additional info
No response
Activity
szaimen commentedon Jan 23, 2023
Hi, please update to 24.0.9 or better 25.0.3 and report back if it fixes the issue. Thank you!
My goal is to add a label like e.g. 25-feedback to this ticket of an up-to-date major Nextcloud version where the bug could be reproduced. However this is not going to work without your help. So thanks for all your effort!
If you don't manage to reproduce the issue in time and the issue gets closed but you can reproduce the issue afterwards, feel free to create a new bug report with up-to-date information by following this link: https://github.com/nextcloud/server/issues/new?assignees=&labels=bug%2C0.+Needs+triage&template=BUG_REPORT.yml&title=%5BBug%5D%3A+
pboguslawski commentedon Jan 24, 2023
Didn't manage go reproduce this error in v25.0.3.
szaimen commentedon Jan 24, 2023
Okay, so can we close this then?
pboguslawski commentedon Jan 24, 2023
Closing. Will reopen if see again in 25+.