Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Resource is locked, trying again soon". How to fix this? #1693

Closed
1 task done
andreynering opened this issue Aug 7, 2024 · 7 comments
Closed
1 task done

"Resource is locked, trying again soon". How to fix this? #1693

andreynering opened this issue Aug 7, 2024 · 7 comments
Labels

Comments

@andreynering
Copy link

andreynering commented Aug 7, 2024

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
Copy link

github-actions bot commented 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 💙

@andreynering
Copy link
Author

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?

@marcelklehr
Copy link
Member

Does it "expire" automatically after some time?

Yes it does :)

@andreynering
Copy link
Author

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

@marcelklehr
Copy link
Member

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.

@rhclayto
Copy link

rhclayto commented 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).

@metal450
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants