nextcloud / notes

✎ Distraction-free notes and writing
https://apps.nextcloud.com/apps/notes
GNU Affero General Public License v3.0
614 stars 134 forks source link

Frequent occurences of: Saving note xxxx has failed. Note is locked. #981

Open davidsowerby opened 1 year ago

davidsowerby commented 1 year ago

With apparently increasing frequency I get instances of "Saving note xxxx has failed. Note is locked."

Steps to reproduce

  1. Create a note and keep editing and saving on a single device.
  2. It should not take long for this error to occur
  3. Deleting the note will also fail
  4. I can usually clear it eventually by copying and pasting to a new note and deleting the old one, although that usually takes multiple attempts to delete

Expected behaviour

The note saves, and editor switches to view mode

Actual behaviour

Save fails with error "Saving note xxxx has failed. Note is locked."

Screenshots

n/a

Server

IONOS Hosted

Client

Log files

n/a

theatischbein commented 1 year ago

Which Nextcloud version and app version are you using ? I can't reproduce it

davidsowerby commented 1 year ago

Edit: I previously said "Neither can I now! This seemed to last for around 72 hours, and has not been a problem for the last 24 hours."

But I have just had this happen again, specifically at approx 11:10 UTC.

The versions are selected by IONOS, but:

FWIW, I can only think that NextCloud or Notes does not cope very well with some sort of connectivity issue.

I will copy the content of the note and keep trying to re-save and update this issue. As of 11:22 UTC, I am still unable to save the note.

This could be pretty hard to diagnose - is there anything I can capture to assist?

davidsowerby commented 1 year ago

So yesterday I was unable to edit, delete or rename this note - I tried probably 12 or so times spread throughout the day.

Today, I just reopened a suspended session on my workstation, and found that the note was no longer locked - I guess the lock file had been cleaned up overnight .. perhaps!

modernNeo commented 1 year ago

I just had this happen to me as well.

I am using the dockerized netcloud version 27.0.1 with Notes version 4.8.1

pebkacs commented 11 months ago

Same issue here.

[notes] Error: OCP\Lock\LockedException: "user/Notes/Weekly Media Prep.md" is locked at <<closure>>

 0. /var/www/nextcloud/lib/private/Files/View.php line 1150
    OC\Files\View->changeLock()
 1. /var/www/nextcloud/lib/private/Files/View.php line 680
    OC\Files\View->basicOperation()
 2. /var/www/nextcloud/lib/private/Files/Node/File.php line 73
    OC\Files\View->file_put_contents()
 3. /var/www/nextcloud/apps/notes/lib/Service/Note.php line 169
    OC\Files\Node\File->putContent()
 4. /var/www/nextcloud/apps/notes/lib/Controller/NotesController.php line 236
    OCA\Notes\Service\Note->setContent()
 5. /var/www/nextcloud/apps/notes/lib/Service/Util.php line 26
    OCA\Notes\Controller\NotesController->OCA\Notes\Controller\{closure}("*** sensitive parameters replaced ***")
 6. /var/www/nextcloud/apps/notes/lib/Controller/Helper.php line 140
    OCA\Notes\Service\Util::retryIfLocked()
 7. /var/www/nextcloud/apps/notes/lib/Controller/NotesController.php line 238
    OCA\Notes\Controller\Helper->handleErrorResponse()
 8. /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 230
    OCA\Notes\Controller\NotesController->update("*** sensitive parameters replaced ***")
 9. /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 137
    OC\AppFramework\Http\Dispatcher->executeController()
10. /var/www/nextcloud/lib/private/AppFramework/App.php line 183
    OC\AppFramework\Http\Dispatcher->dispatch()
11. /var/www/nextcloud/lib/private/Route/Router.php line 315
    OC\AppFramework\App::main()
12. /var/www/nextcloud/lib/base.php line 1068
    OC\Route\Router->match()
13. /var/www/nextcloud/index.php line 36
    OC::handleRequest()

Caused by:

OCP\Lock\LockedException: "files/7c70cfad5a328f71dd0c0cd26c90f5f4"("user/Notes/Weekly Media Prep.md") is locked at <<closure>>

 0. /var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php line 629
    OC\Files\Storage\Common->changeLock()
 1. /var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php line 629
    OC\Files\Storage\Wrapper\Wrapper->changeLock()
 2. /var/www/nextcloud/lib/private/Files/View.php line 1978
    OC\Files\Storage\Wrapper\Wrapper->changeLock()
 3. /var/www/nextcloud/lib/private/Files/View.php line 1150
    OC\Files\View->changeLock()
 4. /var/www/nextcloud/lib/private/Files/View.php line 680
    OC\Files\View->basicOperation()
 5. /var/www/nextcloud/lib/private/Files/Node/File.php line 73
    OC\Files\View->file_put_contents()
 6. /var/www/nextcloud/apps/notes/lib/Service/Note.php line 169
    OC\Files\Node\File->putContent()
 7. /var/www/nextcloud/apps/notes/lib/Controller/NotesController.php line 236
    OCA\Notes\Service\Note->setContent()
 8. /var/www/nextcloud/apps/notes/lib/Service/Util.php line 26
    OCA\Notes\Controller\NotesController->OCA\Notes\Controller\{closure}("*** sensitive parameters replaced ***")
 9. /var/www/nextcloud/apps/notes/lib/Controller/Helper.php line 140
    OCA\Notes\Service\Util::retryIfLocked()
10. /var/www/nextcloud/apps/notes/lib/Controller/NotesController.php line 238
    OCA\Notes\Controller\Helper->handleErrorResponse()
11. /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 230
    OCA\Notes\Controller\NotesController->update("*** sensitive parameters replaced ***")
12. /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 137
    OC\AppFramework\Http\Dispatcher->executeController()
13. /var/www/nextcloud/lib/private/AppFramework/App.php line 183
    OC\AppFramework\Http\Dispatcher->dispatch()
14. /var/www/nextcloud/lib/private/Route/Router.php line 315
    OC\AppFramework\App::main()
15. /var/www/nextcloud/lib/base.php line 1068
    OC\Route\Router->match()
16. /var/www/nextcloud/index.php line 36
    OC::handleRequest()

Caused by:

OCP\Lock\LockedException: "files/7c70cfad5a328f71dd0c0cd26c90f5f4" is locked at <<closure>>

 0. /var/www/nextcloud/lib/private/Files/Storage/Common.php line 831
    OC\Lock\DBLockingProvider->changeLock()
 1. /var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php line 629
    OC\Files\Storage\Common->changeLock()
 2. /var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php line 629
    OC\Files\Storage\Wrapper\Wrapper->changeLock()
 3. /var/www/nextcloud/lib/private/Files/View.php line 1978
    OC\Files\Storage\Wrapper\Wrapper->changeLock()
 4. /var/www/nextcloud/lib/private/Files/View.php line 1150
    OC\Files\View->changeLock()
 5. /var/www/nextcloud/lib/private/Files/View.php line 680
    OC\Files\View->basicOperation()
 6. /var/www/nextcloud/lib/private/Files/Node/File.php line 73
    OC\Files\View->file_put_contents()
 7. /var/www/nextcloud/apps/notes/lib/Service/Note.php line 169
    OC\Files\Node\File->putContent()
 8. /var/www/nextcloud/apps/notes/lib/Controller/NotesController.php line 236
    OCA\Notes\Service\Note->setContent()
 9. /var/www/nextcloud/apps/notes/lib/Service/Util.php line 26
    OCA\Notes\Controller\NotesController->OCA\Notes\Controller\{closure}("*** sensitive parameters replaced ***")
10. /var/www/nextcloud/apps/notes/lib/Controller/Helper.php line 140
    OCA\Notes\Service\Util::retryIfLocked()
11. /var/www/nextcloud/apps/notes/lib/Controller/NotesController.php line 238
    OCA\Notes\Controller\Helper->handleErrorResponse()
12. /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 230
    OCA\Notes\Controller\NotesController->update("*** sensitive parameters replaced ***")
13. /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 137
    OC\AppFramework\Http\Dispatcher->executeController()
14. /var/www/nextcloud/lib/private/AppFramework/App.php line 183
    OC\AppFramework\Http\Dispatcher->dispatch()
15. /var/www/nextcloud/lib/private/Route/Router.php line 315
    OC\AppFramework\App::main()
16. /var/www/nextcloud/lib/base.php line 1068
    OC\Route\Router->match()
17. /var/www/nextcloud/index.php line 36
    OC::handleRequest()

PUT /nextcloud/index.php/apps/notes/notes/3944021
from 10.0.3.1 by 26739B44-B12B-49CB-9F9A-82C5FFBD8FC4 at 2023-11-15T22:59:21+00:00