[GH-ISSUE #1693] "Resource is locked, trying again soon". How to fix this? #1125

Closed
opened 2026-02-25 22:39:04 +03:00 by kerem · 12 comments
Owner

Originally created by @andreynering on GitHub (Aug 7, 2024).
Original GitHub issue: https://github.com/floccusaddon/floccus/issues/1693

Which version of floccus are you using?

5.2.5

How many bookmarks do you have, roughly?

274

Are you using other means to sync bookmarks in parallel to floccus?

Yes, Chrome sync

Sync method

Git

Which browser are you using? In case you are using the phone App, specify the Android or iOS version and device please.

Chrome 127.0.6533.99

Which version of Nextcloud Bookmarks are you using? (if relevant)

No response

Which version of Nextcloud? (if relevant)

No response

What kind of WebDAV server are you using? (if relevant)

No response

Describe the Bug

I noticed today that the sync is locked. It seems to be in this state for a few days. The button to manually sync is in a read-only state, so I can't force it to sync. I don't know what to do to fix the problem.

Logs:

2024-08-07T20:33:46.510Z Starting sync process for account JobScore
2024-08-07T20:33:46.514Z onSyncStart: begin
2024-08-07T20:33:46.514Z (git) init
2024-08-07T20:33:46.538Z (git) fetch from remote
2024-08-07T20:33:47.438Z (git) checkout branch main
2024-08-07T20:33:47.445Z onSyncFail
2024-08-07T20:33:47.445Z Resource is locked, trying again soon

Screenshot 2024-08-07 at 17 33 41

Expected Behavior

Sync should happen.

To Reproduce

Sorry, I don't know how to reproduce it.

Debug log provided

  • I have provided a debug log file
Originally created by @andreynering on GitHub (Aug 7, 2024). Original GitHub issue: https://github.com/floccusaddon/floccus/issues/1693 ### Which version of floccus are you using? 5.2.5 ### How many bookmarks do you have, roughly? 274 ### Are you using other means to sync bookmarks in parallel to floccus? Yes, Chrome sync ### Sync method Git ### Which browser are you using? In case you are using the phone App, specify the Android or iOS version and device please. Chrome 127.0.6533.99 ### Which version of Nextcloud Bookmarks are you using? (if relevant) _No response_ ### Which version of Nextcloud? (if relevant) _No response_ ### What kind of WebDAV server are you using? (if relevant) _No response_ ### Describe the Bug I noticed today that the sync is locked. It seems to be in this state for a few days. The button to manually sync is in a read-only state, so I can't force it to sync. I don't know what to do to fix the problem. Logs: ```log 2024-08-07T20:33:46.510Z Starting sync process for account JobScore 2024-08-07T20:33:46.514Z onSyncStart: begin 2024-08-07T20:33:46.514Z (git) init 2024-08-07T20:33:46.538Z (git) fetch from remote 2024-08-07T20:33:47.438Z (git) checkout branch main 2024-08-07T20:33:47.445Z onSyncFail 2024-08-07T20:33:47.445Z Resource is locked, trying again soon ``` ![Screenshot 2024-08-07 at 17 33 41](https://github.com/user-attachments/assets/764e29e2-88df-4dde-93f3-b39369499bfc) ### Expected Behavior Sync should happen. ### To Reproduce Sorry, I don't know how to reproduce it. ### Debug log provided - [X] I have provided a debug log file
kerem 2026-02-25 22:39:04 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@github-actions[bot] commented on GitHub (Aug 7, 2024):

Hello 👋

Thank you for taking the time to open this issue with floccus. I know it's frustrating when software
causes problems. You have made the right choice to come here and open an issue to make sure your problem gets looked at
and if possible solved.
I'm Marcel and I created floccus and have been maintaining it ever since.
I currently work for Nextcloud which leaves me with less time for side projects like this one
than I used to have.
I still try to answer all issues and if possible fix all bugs here, but it sometimes takes a while until I get to it.
Until then, please be patient.
Note also that GitHub is a place where people meet to make software better together. Nobody here is under any obligation
to help you, solve your problems or deliver on any expectations or demands you may have, but if enough people come together we can
collaborate to make this software better. For everyone.
Thus, if you can, you could also have a look at other issues to see whether you can help other people with your knowledge
and experience. If you have coding experience it would also be awesome if you could step up to dive into the code and
try to fix the odd bug yourself. Everyone will be thankful for extra helping hands!
One last word: If you feel, at any point, like you need to vent, this is not the place for it; you can go to the forum,
to twitter or somewhere else. But this is a technical issue tracker, so please make sure to
focus on the tech and keep your opinions to yourself.

I look forward to working with you on this issue
Cheers 💙

<!-- gh-comment-id:2274307557 --> @github-actions[bot] commented on GitHub (Aug 7, 2024): Hello :wave: Thank you for taking the time to open this issue with floccus. I know it's frustrating when software causes problems. You have made the right choice to come here and open an issue to make sure your problem gets looked at and if possible solved. I'm Marcel and I created floccus and have been maintaining it ever since. I currently work for Nextcloud which leaves me with less time for side projects like this one than I used to have. I still try to answer all issues and if possible fix all bugs here, but it sometimes takes a while until I get to it. Until then, please be patient. Note also that GitHub is a place where people meet to make software better *together*. Nobody here is under any obligation to help you, solve your problems or deliver on any expectations or demands you may have, but if enough people come together we can collaborate to make this software better. For everyone. Thus, if you can, you could also have a look at other issues to see whether you can help other people with your knowledge and experience. If you have coding experience it would also be awesome if you could step up to dive into the code and try to fix the odd bug yourself. Everyone will be thankful for extra helping hands! One last word: If you feel, at any point, like you need to vent, this is not the place for it; you can go to the forum, to twitter or somewhere else. But this is a technical issue tracker, so please make sure to focus on the tech and keep your opinions to yourself. I look forward to working with you on this issue Cheers :blue_heart:
Author
Owner

@andreynering commented on GitHub (Aug 7, 2024):

Oh, rubber duck 🦆 🤦‍♂️

I just opened the issue and noticed the sync happened as expected.

Screenshot 2024-08-07 at 17 40 01

Maybe still worth keeping open, though? I don't know why such lock would happen. Does it "expire" automatically after some time?

<!-- gh-comment-id:2274313353 --> @andreynering commented on GitHub (Aug 7, 2024): Oh, rubber duck 🦆 🤦‍♂️ I just opened the issue and noticed the sync happened as expected. ![Screenshot 2024-08-07 at 17 40 01](https://github.com/user-attachments/assets/6152cfb4-ea7c-4f30-9165-945464dfcb3f) Maybe still worth keeping open, though? I don't know why such lock would happen. Does it "expire" automatically after some time?
Author
Owner

@marcelklehr commented on GitHub (Aug 8, 2024):

Does it "expire" automatically after some time?

Yes it does :)

<!-- gh-comment-id:2274842910 --> @marcelklehr commented on GitHub (Aug 8, 2024): > Does it "expire" automatically after some time? Yes it does :)
Author
Owner

@andreynering commented on GitHub (Aug 8, 2024):

@marcelklehr What explains the lock, though? Just curious to understand what happened.

<!-- gh-comment-id:2275960487 --> @andreynering commented on GitHub (Aug 8, 2024): @marcelklehr What explains the lock, though? Just curious to understand what happened.
Author
Owner

@marcelklehr commented on GitHub (Aug 9, 2024):

The reason for the lock is that we can't have multiple clients sync at the same time without getting into trouble. So, in order to only ever have one client sync bookmarks, the client that came first sets a lock. All other clients then see the lock and wait until it's gone again and it's their turn. Sometimes, it can happen that while a client is syncing, the computer is put to sleep or the browser is closed or some other event interrupts the sync run without the client being able to release the lock, this then causes the other clients to wait indefinitely, in theory. However, I've built in a timeout after which they assume something is wrong, give up waiting and just sync anyway.

<!-- gh-comment-id:2278223309 --> @marcelklehr commented on GitHub (Aug 9, 2024): The reason for the lock is that we can't have multiple clients sync at the same time without getting into trouble. So, in order to only ever have one client sync bookmarks, the client that came first sets a lock. All other clients then see the lock and wait until it's gone again and it's their turn. Sometimes, it can happen that while a client is syncing, the computer is put to sleep or the browser is closed or some other event interrupts the sync run without the client being able to release the lock, this then causes the other clients to wait indefinitely, in theory. However, I've built in a timeout after which they assume something is wrong, give up waiting and just sync anyway.
Author
Owner

@rhclayto commented on GitHub (Nov 28, 2024):

How long is the timeout? Can we force the lock to expire? I'm trying to debug some problems when Floccus is syncing with Nextcloud Bookmarks, & I keep having to wait for the lock to expire to continue debugging.

Edit: It's 30 minutes (in the Nextcloud Bookmarks code), & I figured out how to delete the lock through an API call (DELETE /apps/bookmarks/public/rest/v2/lock).

<!-- gh-comment-id:2505261917 --> @rhclayto commented on GitHub (Nov 28, 2024): How long is the timeout? Can we force the lock to expire? I'm trying to debug some problems when Floccus is syncing with Nextcloud Bookmarks, & I keep having to wait for the lock to expire to continue debugging. Edit: It's 30 minutes (in the Nextcloud Bookmarks code), & I figured out how to delete the lock through an API call (`DELETE /apps/bookmarks/public/rest/v2/lock`).
Author
Owner

@JGKle commented on GitHub (Nov 28, 2024):

For the git sync method, the way to release the lock is to manually delete the floccus-lock-xxx tag in the git repo

<!-- gh-comment-id:2506760689 --> @JGKle commented on GitHub (Nov 28, 2024): For the git sync method, the way to release the lock is to manually delete the `floccus-lock-xxx` tag in the git repo
Author
Owner

@patienttruth commented on GitHub (Apr 23, 2025):

@rhclayto

Edit: It's 30 minutes (in the Nextcloud Bookmarks code), & I figured out how to delete the lock through an API call (DELETE /apps/bookmarks/public/rest/v2/lock).

Would you mind sharing how you used the API call? Thanks.

@marcelklehr do you know if the lock applies across profiles, or per profile?

With gratitude,

<!-- gh-comment-id:2824874230 --> @patienttruth commented on GitHub (Apr 23, 2025): @rhclayto > Edit: It's 30 minutes (in the Nextcloud Bookmarks code), & I figured out how to delete the lock through an API call (`DELETE /apps/bookmarks/public/rest/v2/lock`). Would you mind sharing how you used the API call? Thanks. @marcelklehr do you know if the lock applies across profiles, or per profile? With gratitude,
Author
Owner

@marcelklehr commented on GitHub (Apr 23, 2025):

@patienttruth In all likelyhood, you do not need to do anything for the lock to be freed, nowadays. It will be released automatically after a certain time, but in recent versions of floccus you can even force a sync in this situation.

<!-- gh-comment-id:2824901540 --> @marcelklehr commented on GitHub (Apr 23, 2025): @patienttruth In all likelyhood, you do not need to do anything for the lock to be freed, nowadays. It will be released automatically after a certain time, but in recent versions of floccus you can even force a sync in this situation.
Author
Owner

@patienttruth commented on GitHub (Apr 23, 2025):

I appreciate the response @marcelklehr. Currently I have a tabs profile for my laptop and my PC (2 different profiles) and a book marks profile that they both sync to. The laptop hasn't been on in a day or two, so I don't think it should be locking anything.

My PC has both its tab profile and the bookmarks profile saying "Synchronization in progress.", however when I check a log all I see appears to be outdated by a couple days. This is just after disabling, enabling and requesting a sync. I believe the PC was left on overnight so I'd think it could sort everything out if it weren't stuck on something.

Any other ideas?

2025-04-21T23:37:47.306Z Receiving response for GET https://lab.URL.com/index.php/apps/bookmarks/public/rest/v2/bookmark?page=1&limit=1
2025-04-21T23:37:47.307Z QUEUING POST https://lab.URL.com/index.php/apps/bookmarks/public/rest/v2/lock
2025-04-21T23:37:47.308Z FETCHING POST https://lab.URL.com/index.php/apps/bookmarks/public/rest/v2/lock
2025-04-21T23:37:47.480Z Receiving response for POST https://lab.URL.com/index.php/apps/bookmarks/public/rest/v2/lock
2025-04-21T23:37:47.483Z Resource is locked, trying again soon
<!-- gh-comment-id:2824938883 --> @patienttruth commented on GitHub (Apr 23, 2025): I appreciate the response @marcelklehr. Currently I have a tabs profile for my laptop and my PC (2 different profiles) and a book marks profile that they both sync to. The laptop hasn't been on in a day or two, so I don't think it should be locking anything. My PC has both its tab profile and the bookmarks profile saying "Synchronization in progress.", however when I check a log all I see appears to be outdated by a couple days. This is just after disabling, enabling and requesting a sync. I believe the PC was left on overnight so I'd think it could sort everything out if it weren't stuck on something. Any other ideas? ``` 2025-04-21T23:37:47.306Z Receiving response for GET https://lab.URL.com/index.php/apps/bookmarks/public/rest/v2/bookmark?page=1&limit=1 2025-04-21T23:37:47.307Z QUEUING POST https://lab.URL.com/index.php/apps/bookmarks/public/rest/v2/lock 2025-04-21T23:37:47.308Z FETCHING POST https://lab.URL.com/index.php/apps/bookmarks/public/rest/v2/lock 2025-04-21T23:37:47.480Z Receiving response for POST https://lab.URL.com/index.php/apps/bookmarks/public/rest/v2/lock 2025-04-21T23:37:47.483Z Resource is locked, trying again soon ```
Author
Owner

@patienttruth commented on GitHub (Apr 23, 2025):

P.S. nothing happens when I click cancel sync either. Is that normal?

<!-- gh-comment-id:2824948641 --> @patienttruth commented on GitHub (Apr 23, 2025): P.S. nothing happens when I click cancel sync either. Is that normal?
Author
Owner

@rhclayto commented on GitHub (Apr 23, 2025):

@rhclayto

Edit: It's 30 minutes (in the Nextcloud Bookmarks code), & I figured out how to delete the lock through an API call (DELETE /apps/bookmarks/public/rest/v2/lock).

Would you mind sharing how you used the API call? Thanks.

I believe I used Yaak (a REST client you can download), & manually pasted the session cookie from my browser (lifted from the Network tab of the Firefox Web Developer Tools) into the header section of Yaak to authenticate.

<!-- gh-comment-id:2825279781 --> @rhclayto commented on GitHub (Apr 23, 2025): > [@rhclayto](https://github.com/rhclayto) > > > Edit: It's 30 minutes (in the Nextcloud Bookmarks code), & I figured out how to delete the lock through an API call (`DELETE /apps/bookmarks/public/rest/v2/lock`). > > Would you mind sharing how you used the API call? Thanks. I believe I used Yaak (a REST client you can download), & manually pasted the session cookie from my browser (lifted from the Network tab of the Firefox Web Developer Tools) into the header section of Yaak to authenticate.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/floccus#1125
No description provided.