nextcloud / nextcloud/notes

Notes undeletable due to lock

Open
#1,636 11 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug need to reproduce
Dominant language
JavaScript
Stars
738
Forks
162
Avg merge
6h 2m
Merged PRs (30d)
35

Description

Steps to reproduce

  1. Open Notes on desktop NC using a web browser (or on android Notes)
  2. Select a note and choose delete
  3. See the error message after a few seconds : 'Deleting note id has failed. Note is locked.' and a bit later 'Editing session has expired. Please reload the page.'
Expected behaviour

The note should be deleted.

Actual behaviour

The note remains in the list.

Server

Please complete the following information.

  • Notes app version: 4.12.3 (4.4.2 on android)
  • Nextcloud version: 31.0.8
  • OS: Linux 5.14.0-503.40.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Mon May 5 06:06:04 EDT 2025 x86_64
  • Web server: LiteSpeed
  • PHP version: 8.3.20
  • Database: mysql 10.11.10

Nextcloud configuration:

``` { "system": { "instanceid": "***REMOVED SENSITIVE VALUE***", "passwordsalt": "***REMOVED SENSITIVE VALUE***", "secret": "***REMOVED SENSITIVE VALUE***", "trusted_domains": [ "cloud.idl-mp.com" ], "datadirectory": "***REMOVED SENSITIVE VALUE***", "dbtype": "mysql", "version": "31.0.8.1", "overwrite.cli.url": "https:\/\/cloud.idl-mp.com", "dbname": "***REMOVED SENSITIVE VALUE***", "dbhost": "***REMOVED SENSITIVE VALUE***", "dbport": "", "dbtableprefix": "oc_", "mysql.utf8mb4": true, "dbuser": "***REMOVED SENSITIVE VALUE***", "dbpassword": "***REMOVED SENSITIVE VALUE***", "default_language": "fr", "installed": true, "theme": "", "mail_from_address": "***REMOVED SENSITIVE VALUE***", "mail_smtpmode": "smtp", "mail_domain": "***REMOVED SENSITIVE VALUE***", "trashbin_retention_obligation": "auto, 7", "trashbin_auto_expire": true, "versions_retention_obligation": "auto, 7", "degug": false, "loglevel": 2, "cron_log": true, "log_rotate_size": 209715200, "mail_smtphost": "***REMOVED SENSITIVE VALUE***", "mail_sendmailmode": "smtp", "mail_smtpsecure": "ssl", "mail_smtpauth": 1, "mail_smtpname": "***REMOVED SENSITIVE VALUE***", "mail_smtppassword": "***REMOVED SENSITIVE VALUE***", "mail_smtpauthtype": "LOGIN", "maintenance": false, "default_phone_region": "FR", "app_install_overwrite": [ "occweb", "social", "apporder", "mailnotifier", "unsplash" ], "maintenance_window_start": 1, "updater.release.channel": "stable", "mail_smtpport": "465", "updater.secret": "***REMOVED SENSITIVE VALUE***" } }
</details>


## Client
Please complete the following information.

- Browser (incl. version): Brave  v1.82.161 or Firefox 142.0.1
 - OS: Ubuntu 24.04


## Log files
{"reqId":"dm-4J-ixHQCKq8rreKZbD0Hn","level":3,"time":"2025-09-09T08:53:23+00:00","remoteAddr":"my.ip.address","user":"manu","app":"notes","method":"DELETE","url":"/index.php/apps/notes/notes/267203","message":"Controller failed with OCP\\Lock\\LockedException","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36","version":"31.0.8.1","exception":{"Exception":"OCP\\Lock\\LockedException","Message":"\"/manu/files/Notes/myNote.md\" is locked","Code":0,"Trace":[{"file":"/home/myuser/domains/cloud.idl-mp.com/public_html/lib/private/Files/View.php","line":1200,"function":"changeLock","class":"OC\\Files\\View","type":"->"},{"file":"/home/myuser/domains/cloud.idl-mp.com/public_html/lib/private/Files/View.php","line":676,"function":"basicOperation","class":"OC\\Files\\View","type":"->"},{"file":"/home/myuser/domains/cloud.idl-mp.com/public_html/lib/private/Files/Node/File.php","line":112,"function":"unlink","class":"OC\\Files\\View","type":"->"},{"file":"/home/myuser/domains/cloud.idl-mp.com/public_html/apps/notes/lib/Service/NotesService.php","line":152,"function":"delete","class":"OC\\Files\\Node\\File","type":"->"},{"file":"/home/myuser/domains/cloud.idl-mp.com/public_html/apps/notes/lib/Controller/NotesController.php","line":315,"function":"delete","class":"OCA\\Notes\\Service\\NotesService","type":"->"},{"file":"/home/myuser/domains/cloud.idl-mp.com/public_html/apps/notes/lib/Service/Util.php","line":31,"function":"OCA\\Notes\\Controller\\{closure}","class":"OCA\\Notes\\Controller\\NotesController","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/home/myuser/domains/cloud.idl-mp.com/public_html/apps/notes/lib/Controller/Helper.php","line":146,"function":"retryIfLocked","class":"OCA\\Notes\\Service\\Util","type":"::"},{"file":"/home/myuser/domains/cloud.idl-mp.com/public_html/apps/notes/lib/Controller/NotesController.php","line":314,"function":"handleErrorResponse","class":"OCA\\Notes\\Controller\\Helper","type":"->"},{"file":"/home/myuser/domains/cloud.idl-mp.com/public_html/lib/private/AppFramework/Http/Dispatcher.php","line":200,"function":"destroy","class":"OCA\\Notes\\Controller\\NotesController","type":"->"},{"file":"/home/myuser/domains/cloud.idl-mp.com/public_html/lib/private/AppFramework/Http/Dispatcher.php","line":114,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/home/myuser/domains/cloud.idl-mp.com/public_html/lib/private/AppFramework/App.php","line":161,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/home/myuser/domains/cloud.idl-mp.com/public_html/lib/private/Route/Router.php","line":315,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/home/myuser/domains/cloud.idl-mp.com/public_html/lib/base.php","line":1061,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/home/myuser/domains/cloud.idl-mp.com/public_html/index.php","line":24,"function":"handleRequest","class":"OC","type":"::"}],"File":"/home/myuser/domains/cloud.idl-mp.com/public_html/lib/private/Files/View.php","Line":2115,"Previous":{"Exception":"OCP\\Lock\\LockedException","Message":"\"files/960189f562f4bf135d92cb77818401b6\"(\"files/Notes/myNote.md\") is locked","Code":0,"Trace":[{"file":"/home/myuser/domains/cloud.idl-mp.com/public_html/lib/private/Files/Storage/Wrapper/Wrapper.php","line":310,"function":"changeLock","class":"OC\\Files\\Storage\\Common","type":"->"},{"file":"/home/myuser/domains/cloud.idl-mp.com/public_html/lib/private/Files/Storage/Wrapper/Wrapper.php","line":310,"function":"changeLock","class":"OC\\Files\\Storage\\Wrapper\\Wrapper","type":"->"},{"file":"/home/myuser/domains/cloud.idl-mp.com/public_html/lib/private/Files/View.php","line":2107,"function":"changeLock","class":"OC\\Files\\Storage\\Wrapper\\Wrapper","type":"->"},{"file":"/home/myuser/domains/cloud.idl-mp.com/public_html/lib/private/Files/View.php","line":1200,"function":"changeLock","class":"OC\\Files\\View","type":"->"},{"file":"/home/myuser/domains/cloud.idl-mp.com/public_html/lib/private/Files/View.php","line":676,"function":"basicOperation","class":"OC\\Files\\View","type":"->"},{"file":"/home/myuser/domains/cloud.idl-mp.com/public_html/lib/private/Files/Node/File.php","line":112,"function":"unlink","class":"OC\\Files\\View","type":"->"},{"file":"/home/myuser/domains/cloud.idl-mp.com/public_html/apps/notes/lib/Service/NotesService.php","line":152,"function":"delete","class":"OC\\Files\\Node\\File","type":"->"},{"file":"/home/myuser/domains/cloud.idl-mp.com/public_html/apps/notes/lib/Controller/NotesController.php","line":315,"function":"delete","class":"OCA\\Notes\\Service\\NotesService","type":"->"},{"file":"/home/myuser/domains/cloud.idl-mp.com/public_html/apps/notes/lib/Service/Util.php","line":31,"function":"OCA\\Notes\\Controller\\{closure}","class":"OCA\\Notes\\Controller\\NotesController","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/home/myuser/domains/cloud.idl-mp.com/public_html/apps/notes/lib/Controller/Helper.php","line":146,"function":"retryIfLocked","class":"OCA\\Notes\\Service\\Util","type":"::"},{"file":"/home/myuser/domains/cloud.idl-mp.com/public_html/apps/notes/lib/Controller/NotesController.php","line":314,"function":"handleErrorResponse","class":"OCA\\Notes\\Controller\\Helper","type":"->"},{"file":"/home/myuser/domains/cloud.idl-mp.com/public_html/lib/private/AppFramework/Http/Dispatcher.php","line":200,"function":"destroy","class":"OCA\\Notes\\Controller\\NotesController","type":"->"},{"file":"/home/myuser/domains/cloud.idl-mp.com/public_html/lib/private/AppFramework/Http/Dispatcher.php","line":114,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/home/myuser/domains/cloud.idl-mp.com/public_html/lib/private/AppFramework/App.php","line":161,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/home/myuser/domains/cloud.idl-mp.com/public_html/lib/private/Route/Router.php","line":315,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/home/myuser/domains/cloud.idl-mp.com/public_html/lib/base.php","line":1061,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/home/myuser/domains/cloud.idl-mp.com/public_html/index.php","line":24,"function":"handleRequest","class":"OC","type":"::"}],"File":"/home/myuser/domains/cloud.idl-mp.com/public_html/lib/private/Files/Storage/Common.php","Line":696,"Previous":{"Exception":"OCP\\Lock\\LockedException","Message":"\"files/960189f562f4bf135d92cb77818401b6\" is locked","Code":0,"Trace":[{"file":"/home/myuser/domains/cloud.idl-mp.com/public_html/lib/private/Files/Storage/Common.php","line":694,"function":"changeLock","class":"OC\\Lock\\DBLockingProvider","type":"->"},{"file":"/home/myuser/domains/cloud.idl-mp.com/public_html/lib/private/Files/Storage/Wrapper/Wrapper.php","line":310,"function":"changeLock","class":"OC\\Files\\Storage\\Common","type":"->"},{"file":"/home/myuser/domains/cloud.idl-mp.com/public_html/lib/private/Files/Storage/Wrapper/Wrapper.php","line":310,"function":"changeLock","class":"OC\\Files\\Storage\\Wrapper\\Wrapper","type":"->"},{"file":"/home/myuser/domains/cloud.idl-mp.com/public_html/lib/private/Files/View.php","line":2107,"function":"changeLock","class":"OC\\Files\\Storage\\Wrapper\\Wrapper","type":"->"},{"file":"/home/myuser/domains/cloud.idl-mp.com/public_html/lib/private/Files/View.php","line":1200,"function":"changeLock","class":"OC\\Files\\View","type":"->"},{"file":"/home/myuser/domains/cloud.idl-mp.com/public_html/lib/private/Files/View.php","line":676,"function":"basicOperation","class":"OC\\Files\\View","type":"->"},{"file":"/home/myuser/domains/cloud.idl-mp.com/public_html/lib/private/Files/Node/File.php","line":112,"function":"unlink","class":"OC\\Files\\View","type":"->"},{"file":"/home/myuser/domains/cloud.idl-mp.com/public_html/apps/notes/lib/Service/NotesService.php","line":152,"function":"delete","class":"OC\\Files\\Node\\File","type":"->"},{"file":"/home/myuser/domains/cloud.idl-mp.com/public_html/apps/notes/lib/Controller/NotesController.php","line":315,"function":"delete","class":"OCA\\Notes\\Service\\NotesService","type":"->"},{"file":"/home/myuser/domains/cloud.idl-mp.com/public_html/apps/notes/lib/Service/Util.php","line":31,"function":"OCA\\Notes\\Controller\\{closure}","class":"OCA\\Notes\\Controller\\NotesController","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/home/myuser/domains/cloud.idl-mp.com/public_html/apps/notes/lib/Controller/Helper.php","line":146,"function":"retryIfLocked","class":"OCA\\Notes\\Service\\Util","type":"::"},{"file":"/home/myuser/domains/cloud.idl-mp.com/public_html/apps/notes/lib/Controller/NotesController.php","line":314,"function":"handleErrorResponse","class":"OCA\\Notes\\Controller\\Helper","type":"->"},{"file":"/home/myuser/domains/cloud.idl-mp.com/public_html/lib/private/AppFramework/Http/Dispatcher.php","line":200,"function":"destroy","class":"OCA\\Notes\\Controller\\NotesController","type":"->"},{"file":"/home/myuser/domains/cloud.idl-mp.com/public_html/lib/private/AppFramework/Http/Dispatcher.php","line":114,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/home/myuser/domains/cloud.idl-mp.com/public_html/lib/private/AppFramework/App.php","line":161,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/home/myuser/domains/cloud.idl-mp.com/public_html/lib/private/Route/Router.php","line":315,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/home/myuser/domains/cloud.idl-mp.com/public_html/lib/base.php","line":1061,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/home/myuser/domains/cloud.idl-mp.com/public_html/index.php","line":24,"function":"handleRequest","class":"OC","type":"::"}],"File":"/home/myuser/domains/cloud.idl-mp.com/public_html/lib/private/Lock/DBLockingProvider.php","Line":193}},"message":"Controller failed with OCP\\Lock\\LockedException","exception":{},"CustomMessage":"Controller failed with OCP\\Lock\\LockedException"}}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the delete path in apps/notes/lib/Service/NotesService.php and apps/notes/lib/Controller/NotesController.php, then inspect retryIfLocked in apps/notes/lib/Service/Util.php and apps/notes/lib/Controller/Helper.php. Reproduce the DELETE request with a locked note and trace the reported LockedException. Done means the note is deleted without the lock error or expired editing-session message.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, php
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.