Cannot create new notes with a new user
A newly created user on NC cannot create new notes.
Steps to reproduce
- On web-UI try to create a new note and get an error: NotPermittedException
Expected behaviour
New note created.
Actual behaviour
NotPermittedException
Server
- Notes app version: 4.11.0
- Nextcloud version: Nextcloud Hub 9 (30.0.4)
- OS: Debian 12
- Web server: Apache
- PHP version: 8.2
- Database: MariaDB
Log files
Logs:
NotPermittedException Could not create path "/<username>/files/Notes/New note.md"
Controller failed with OCP\Files\NotPermittedException
Full stacktrace:
[notes] Error: Controller failed with OCP\Files\NotPermittedException
POST /index.php/apps/notes/notes
from 192.168.0.33 by newuser at Jan 14, 2025, 9:26:09 AM
1. /var/www/nextcloud/apps/notes/lib/Service/NotesService.php - Line 128
OC\Files\Node\Folder->newFile()
2. /var/www/nextcloud/apps/notes/lib/Controller/NotesController.php - Line 161
OCA\Notes\Service\NotesService->create(
"*** sensitive parameters replaced ***"
)
3. /var/www/nextcloud/apps/notes/lib/Service/Util.php - Line 26
OCA\Notes\Controller\NotesController->OCA\Notes\Controller\{closure}(
"*** sensitive parameters replaced ***"
)
4. /var/www/nextcloud/apps/notes/lib/Controller/Helper.php - Line 140
OCA\Notes\Service\Util::retryIfLocked()
5. /var/www/nextcloud/apps/notes/lib/Controller/NotesController.php - Line 160
OCA\Notes\Controller\Helper->handleErrorResponse()
6. /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - Line 208
OCA\Notes\Controller\NotesController->create(
"*** sensitive parameters replaced ***"
)
7. /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - Line 114
OC\AppFramework\Http\Dispatcher->executeController()
8. /var/www/nextcloud/lib/private/AppFramework/App.php - Line 161
OC\AppFramework\Http\Dispatcher->dispatch()
9. /var/www/nextcloud/lib/private/Route/Router.php - Line 302
OC\AppFramework\App::main()
10. /var/www/nextcloud/lib/base.php - Line 1003
OC\Route\Router->match()
11. /var/www/nextcloud/index.php - Line 24
OC::handleRequest()
Forum thread: https://help.nextcloud.com/t/nc-30-cannot-create-notes-on-notes-app-with-new-user/214968
Currently unable to reproduce myself.
Looks like this happen if the user never uploaded a file and tried to create a note. When I created by hand both folders files and files/Notes it worked.
A user's home directory gets created upon first login. It sounds like that's not happening in your environment. Are you using an alternative authentication backend?
@joshtrichards I am using standard authentication of web-UI. I added manually the files/Notes folder. The user was able to create notes and also the folders (files_encryption, files_trashbin and files_versions) were created when user did a first upload on the web-UI. I believe this is an edge case of notes.. if you create the user only to use notes for example, it will fail.
I believe this is an edge case of notes.. if you create the user only to use notes for example, it will fail.
Nextcloud doesn't know (or care) the user is only going to use the Notes app (unless you're using something like the guests app which you stated you're not).
It does sound like you're using Server-Side Encryption, however. That's a possible difference. What mode are you running it in? (i.e. master or per-user keys)?
Can you provide the output of occ config:list system for completeness?
The key part that needs to be isolated is this:
When I created by hand both folders
files
Home directory is set up for all users upon their first login with Nextcloud itself. Notes doesn't handle that.
Notes does, however, expect the home directory to exist and then creates the Notes/ folder.
So something is not working as expected in your environment.
Can you also provide the output of occ app:list?
@joshtrichards things are working quite ok in general in my environment for some years.
Here are the configs you asked:
# config:list system
{
"system": {
"passwordsalt": "***REMOVED SENSITIVE VALUE***",
"secret": "***REMOVED SENSITIVE VALUE***",
"trusted_domains": [
"***REMOVED SENSITIVE VALUE***",
"localhost"
],
"datadirectory": "***REMOVED SENSITIVE VALUE***",
"dbtype": "mysql",
"version": "30.0.5.1",
"overwrite.cli.url": "http:\/\/localhost",
"dbname": "***REMOVED SENSITIVE VALUE***",
"dbhost": "***REMOVED SENSITIVE VALUE***",
"dbport": "",
"dbtableprefix": "oc_",
"mysql.utf8mb4": true,
"dbuser": "***REMOVED SENSITIVE VALUE***",
"dbpassword": "***REMOVED SENSITIVE VALUE***",
"installed": true,
"instanceid": "***REMOVED SENSITIVE VALUE***",
"default_phone_region": "***REMOVED SENSITIVE VALUE***",
"memcache.local": "\\OC\\Memcache\\APCu",
"redis": {
"host": "***REMOVED SENSITIVE VALUE***",
"port": "0"
},
"memcache.locking": "\\OC\\Memcache\\Redis",
"maintenance": false,
"theme": "",
"loglevel": 2,
"maintenance_window_start": 2,
"updater.release.channel": "stable"
}
}
# app:list
Enabled:
- activity: 3.0.0
- admin_audit: 1.20.0
- app_api: 4.0.5
- bruteforcesettings: 3.0.0
- calendar: 5.0.9
- circles: 30.0.0
- cloud_federation_api: 1.13.0
- comments: 1.20.1
- contacts: 6.1.3
- contactsinteraction: 1.11.0
- cospend: 3.0.8
- dashboard: 7.10.0
- dav: 1.31.1
- deck: 1.14.3
- drawio: 3.0.3
- encryption: 2.18.0
- federatedfilesharing: 1.20.0
- federation: 1.20.0
- files: 2.2.0
- files_downloadlimit: 3.0.0
- files_pdfviewer: 3.0.0
- files_reminders: 1.3.0
- files_sharing: 1.22.0
- files_trashbin: 1.20.1
- files_versions: 1.23.0
- firstrunwizard: 3.0.0
- logreader: 3.0.0
- lookup_server_connector: 1.18.0
- mail: 4.1.2
- maps: 1.5.0
- news: 25.2.0
- nextcloud_announcements: 2.0.0
- notes: 4.11.0
- notifications: 3.0.0
- oauth2: 1.18.1
- password_policy: 2.0.0
- photos: 3.0.2
- privacy: 2.0.0
- provisioning_api: 1.20.0
- recommendations: 3.0.0
- related_resources: 1.5.0
- serverinfo: 2.0.0
- settings: 1.13.0
- sharebymail: 1.20.0
- support: 2.0.0
- survey_client: 2.0.0
- systemtags: 1.20.0
- tasks: 0.16.1
- text: 4.1.0
- theming: 2.5.0
- twofactor_backupcodes: 1.19.0
- twofactor_totp: 12.0.0-dev
- updatenotification: 1.20.0
- user_status: 1.10.0
- viewer: 3.0.0
- weather_status: 1.10.0
- webhook_listeners: 1.1.0-dev
- workflowengine: 2.12.0
Disabled:
- files_external: 1.22.0
- files_rightclick: 0.15.1 (installed 1.6.0)
- onlyoffice: 9.5.0 (installed 9.5.0)
- suspicious_login: 8.0.0
- twofactor_nextcloud_notification: 4.0.0
- user_ldap: 1.21.0
Dear @barrelful,
Thank you for reaching out to us!
I'm currently not able to reproduce a problem ;( Could you please update your instance and notes app and try out again? Thank you!