joplin
joplin copied to clipboard
Joplin folder sync stalls on "Cancelling": EBUSY: resource busy or locked
duplicate of #8146
let me make it known that stale bot is a annoyance and just leads to valid bug reports getting closed down because you miss an email saying "please bump it"
Joplin when running for a long time sometimes gets in a state where the sync is "Cancelling..." and makes no progress
I have a folder sync set up to a one drive folder, as i am not allowed to use API sync to one drive
I set up debug logging in Joplin and let it run for a week, until i got to this error:
2023-05-05 08:06:57: PluginRunner: "Got message (3): joplin.data.get", "[["tags"],{"fields":"title, id, updated_time","order_by":"updated_time","order_dir":"DESC","limit":10,"page":1}]"
2023-05-05 08:06:58: Synchronizer: "BasicDelta: Report: {"timestamp":1683169807038,"older":4266,"newer":0,"equal":1}"
2023-05-05 08:06:58: Synchronizer: "Sync: fetchingTotal: Fetching delta items from sync target"
2023-05-05 08:06:58: FileApi: "delete C:\Users\mgrandi\OneDrive - Microsoft\JoplinSync/locks/1_1_339fa57187c64b44a9fa462e73aca41c.json"
2023-05-05 08:06:58: "Could not run background sync:"
2023-05-05 08:06:58: "Error: Error: EBUSY: resource busy or locked, unlink 'C:\Users\mgrandi\OneDrive - Microsoft\JoplinSync\locks\1_1_339fa57187c64b44a9fa462e73aca41c.json'. Path: C:\Users\mgrandi\OneDrive - Microsoft\JoplinSync/locks/1_1_339fa57187c64b44a9fa462e73aca41c.json
Code: EBUSY
Error: Error: EBUSY: resource busy or locked, unlink 'C:\Users\mgrandi\OneDrive - Microsoft\JoplinSync\locks\1_1_339fa57187c64b44a9fa462e73aca41c.json'. Path: C:\Users\mgrandi\OneDrive - Microsoft\JoplinSync/locks/1_1_339fa57187c64b44a9fa462e73aca41c.json
at FileApiDriverLocal.fsErrorToJsError_ (C:\Users\mgrandi\AppData\Local\Programs\Joplin\resources\app.asar\node_modules\@joplin\lib\file-api-driver-local.js:20:18)
at FileApiDriverLocal.delete (C:\Users\mgrandi\AppData\Local\Programs\Joplin\resources\app.asar\node_modules\@joplin\lib\file-api-driver-local.js:174:15)"
2023-05-05 08:06:58: "Setting up recurrent sync with interval 300"
2023-05-05 08:06:58: models/Setting: "Saving settings..."
2023-05-05 08:06:58: models/Setting: "Settings have been saved."
2023-05-05 08:10:26: RevisionService: "maintenance: Starting..."
2023-05-05 08:10:26: RevisionService: "maintenance: Service is enabled"
2023-05-05 08:10:26: RevisionService: "collectRevisions: Created revisions for 0 notes"
2023-05-05 08:10:26: RevisionService: "maintenance: Done in 111ms"
after that, the log just has this in the log when it tries to sync
2023-05-08 10:12:12: "Running background sync on timer..."
2023-05-08 10:12:12: "Scheduling sync operation...", "0"
2023-05-08 10:12:12: "Preparing scheduled sync"
2023-05-08 10:12:12: "Starting scheduled sync"
2023-05-08 10:12:12: "Synchronisation is already in progress. State: in_progress"
2023-05-08 10:12:12: "Setting up recurrent sync with interval 300"
Environment
Joplin version: 2.9.17 Platform: windows OS specifics: windows 10
Joplin 2.9.17 (prod, win32)
Client ID: 339fa57187c64b44a9fa462e73aca41c
Sync Version: 3
Profile Version: 41
Keychain Supported: Yes
Revision: a84a8e7
Steps to reproduce
- Leave joplin running for a while
- Sync fails and it just shows "Cancelling..."
- have to restart joplin for syncs to resume
Describe what you expected to happen
Syncs to resume normally even after a 1 time error
Logfile
I have a log file however it seems to contain the contents of my notes, let me know if you are looking for something specific and I can attach it
and to be clear this is still happening on
Joplin 2.11.11 (prod, win32)
Client ID: 339fa57187c64b44a9fa462e73aca41c Sync Version: 3 Profile Version: 43 Keychain Supported: Yes
Revision: 6886f6f
Simple Backup: 1.1.1 Templates: 2.3.0
Files in the locks
folder try to prevent multiple clients from doing incompatible sync operations at the same time. For example, when my copy of Joplin starts syncing, it:
- Creates
\Apps\Joplin\locks\1_1_somelongclientidhere.json
. - Syncs
- Removes
\Apps\Joplin\locks\1_1_somelongclientidhere.json
.
If I force-quit Joplin while it's syncing (e.g. with Task Manager), \Apps\Joplin\locks\1_1_somelongclientidhere.json
isn't deleted and other clients aren't able to sync.
On my computer, however, \Apps\Joplin\locks\1_1_somelongclientidhere.json
is deleted automatically after I open Joplin (the Joplin client that I force-quit) again and sync. From the description above, it sounds like Joplin isn't crashing, however. Thus, Joplin may be failing to remove the lock file when it finishes syncing.
From the log you provided, it looks like Joplin tries to do this and fails (unlink
means delete):
2023-05-05 08:06:58: "Error: Error: EBUSY: resource busy or locked, unlink 'C:\Users\mgrandi\OneDrive - Microsoft\JoplinSync\locks\1_1_339fa57187c64b44a9fa462e73aca41c.json'. Path: C:\Users\mgrandi\OneDrive - Microsoft\JoplinSync/locks/1_1_339fa57187c64b44a9fa462e73aca41c.json
Code: EBUSY
Edit: My guess is that OneDrive locks files while they're being uploaded. Thus, if Joplin finishes syncing, while the lock file is being uploaded, the deletion of the lock file may fail.
As such, if you're sure that no client is currently syncing, one temporary solution would be to open OneDrive and manually delete the file from the locks
folder.
restarting Joplin fixes the issue, but I (most of the time) only have one client syncing , it seems that OneDrive is locking the file occasionally for some reason, and joplin is expecting to delete the file (that it created to lock the profile folder for syncing), and when it is unable to do so it just breaks and gets into a bad state where it can't sync and can't cancel either, and syncing stops until you restart the app
still happens in
Joplin 2.12.10 (prod, win32)
Client ID: 339fa57187c64b44a9fa462e73aca41c
Sync Version: 3
Profile Version: 43
Keychain Supported: Yes
Revision: 40b89f6
Simple Backup: 1.1.1
Templates: 2.3.0
i cant find it in the log since log.txt seems to be not being written anymore even with --open-dev-tools --debug --log-level debug
in flags.txt
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? If you require support or are requesting an enhancement or feature then please create a topic on the Joplin forum. This issue may be closed if no further activity occurs. You may comment on the issue and I will leave it open. Thank you for your contributions.
Nope, still happens
On Fri, Sep 1, 2023, 09:02 github-actions[bot] @.***> wrote:
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? If you require support or are requesting an enhancement or feature then please create a topic on the Joplin forum https://discourse.joplinapp.org/. This issue may be closed if no further activity occurs. You may comment on the issue and I will leave it open. Thank you for your contributions.
— Reply to this email directly, view it on GitHub https://github.com/laurent22/joplin/issues/8512#issuecomment-1702977685 or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGD7YRNQYWR2CURONI3VETXYIBKJBFKMF2HI4TJMJ2XIZLTSWBKK5TBNR2WLJDUOJ2WLJDOMFWWLO3UNBZGKYLEL5YGC4TUNFRWS4DBNZ2F6YLDORUXM2LUPGBKK5TBNR2WLJDUOJ2WLJDOMFWWLLTXMF2GG2C7MFRXI2LWNF2HTAVFOZQWY5LFUVUXG43VMWSG4YLNMWVXI2DSMVQWIX3UPFYGLAVFOZQWY5LFVE2TCOJXGAYDONBRURXGC3LFVFUGC427NRQWEZLMQKSXMYLMOVS2UMJUGU4TQMBYGQYDPJDOMFWWLKLIMFZV63DBMJSWZLDTOVRGUZLDORPXI6LQMWWES43TOVSUG33NNVSW45FGORXXA2LDOOKIFJDUPFYGLKTSMVYG643JORXXE6NFOZQWY5LFVA3TSMJWGI3DQMUCUR2HS4DFUVUXG43VMWSXMYLMOVS2UMJYGEZDOOJXGEZTFAVEOR4XAZNFNRQWEZLMUV3GC3DVMWUTKMJZG4YDANZUGGBKI5DZOBS2K3DBMJSWZJLWMFWHKZNKGE2DKOJYGA4DIMBXU52HE2LHM5SXFJTDOJSWC5DF . You are receiving this email because you authored the thread.
Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub .
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? If you require support or are requesting an enhancement or feature then please create a topic on the Joplin forum. This issue may be closed if no further activity occurs. You may comment on the issue and I will leave it open. Thank you for your contributions.
Pretty sure it's not fixed
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? If you require support or are requesting an enhancement or feature then please create a topic on the Joplin forum. This issue may be closed if no further activity occurs. You may comment on the issue and I will leave it open. Thank you for your contributions.
still not fixed.
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? If you require support or are requesting an enhancement or feature then please create a topic on the Joplin forum. This issue may be closed if no further activity occurs. You may comment on the issue and I will leave it open. Thank you for your contributions.
Nope, still here
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? If you require support or are requesting an enhancement or feature then please create a topic on the Joplin forum. This issue may be closed if no further activity occurs. You may comment on the issue and I will leave it open. Thank you for your contributions.
This isn't fixed as far as I'm aware
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? If you require support or are requesting an enhancement or feature then please create a topic on the Joplin forum. This issue may be closed if no further activity occurs. You may comment on the issue and I will leave it open. Thank you for your contributions.
Just happened yesterday as a matter of fact
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? If you require support or are requesting an enhancement or feature then please create a topic on the Joplin forum. This issue may be closed if no further activity occurs. You may comment on the issue and I will leave it open. Thank you for your contributions.
Nope not stale
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? If you require support or are requesting an enhancement or feature then please create a topic on the Joplin forum. This issue may be closed if no further activity occurs. You may comment on the issue and I will leave it open. Thank you for your contributions.
still not fixed
still happening