# Cannot Aquire Sync Lock

**URL:** <https://discourse.joplinapp.org/t/cannot-aquire-sync-lock/10878>\
**Category:** Support\
**Created:** [6 September 2020 03:03 UTC](https://discourse.joplinapp.org/t/cannot-aquire-sync-lock/10878 "2020-09-06T03:03:04Z")\
**Posts on this page:** 14\
**Page:** 2

<div class="post-metadata">

**Author:** ![xmhk](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/xmhk/32/4944_2.png) [@xmhk](https://discourse.joplinapp.org/u/xmhk)\
**Post date:** [9 September 2020 05:59 UTC](https://discourse.joplinapp.org/t/cannot-aquire-sync-lock/10878/21 "2020-09-09T05:59:29Z")

</div>

Yes, that solved the issue. My clock was a few minutes in the future and I didn’t notice, that it’s not getting the time from the net automatically. Thanks

---

<div class="post-metadata">

**Author:** ![laurent](https://avatars.discourse-cdn.com/v4/letter/l/ce7236/32.png) [@laurent](https://discourse.joplinapp.org/u/laurent)\
**Post date:** [9 September 2020 11:08 UTC](https://discourse.joplinapp.org/t/cannot-aquire-sync-lock/10878/22 "2020-09-09T11:08:51Z")

</div>

Ok good to know it’s working at least. Best is to have the computer clock automatically sync to an ntp server, but I’m also going to make the app get the time from the sync target for more accuracy.

---

<div class="post-metadata">

**Author:** ![laurent](https://avatars.discourse-cdn.com/v4/letter/l/ce7236/32.png) [@laurent](https://discourse.joplinapp.org/u/laurent)\
**Post date:** [9 September 2020 12:56 UTC](https://discourse.joplinapp.org/t/cannot-aquire-sync-lock/10878/23 "2020-09-09T12:56:44Z")

</div>

For those still having this issue, please give a try to the latest release: [https://github.com/laurent22/joplin/releases/tag/v1.0.245](https://github.com/laurent22/joplin/releases/tag/v1.0.245)

---

<div class="post-metadata">

**Author:** ![verypopo](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/verypopo/32/4946_2.png) [@verypopo](https://discourse.joplinapp.org/u/verypopo)\
**Post date:** [10 September 2020 01:15 UTC](https://discourse.joplinapp.org/t/cannot-aquire-sync-lock/10878/24 "2020-09-10T01:15:48Z")

</div>

Worked like magic! Thank you!

---

<div class="post-metadata">

**Author:** ![laurent](https://avatars.discourse-cdn.com/v4/letter/l/ce7236/32.png) [@laurent](https://discourse.joplinapp.org/u/laurent)\
**Post date:** [10 September 2020 07:38 UTC](https://discourse.joplinapp.org/t/cannot-aquire-sync-lock/10878/25 "2020-09-10T07:38:17Z")

</div>

Glad it’s working now, and thanks for your feedback.

---

<div class="post-metadata">

**Author:** ![hondo](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/hondo/32/5333_2.png) [@hondo](https://discourse.joplinapp.org/u/hondo)\
**Post date:** [14 October 2020 22:24 UTC](https://discourse.joplinapp.org/t/cannot-aquire-sync-lock/10878/26 "2020-10-14T22:24:20Z")

</div>

Unfortunately, I still have this issue with Joplin v1.2.6 @laurent

The sync **PC \<-\> WebDAV \<-\> Android** fails since about one week.

Sync on Windows 10 fails with:  
`Completed: 15/10/2020 00:02 Last error: Error: Cannot acquire sync lock: either the lock could be written but not read back. Or it was expired before it was read again.`

Sync on Android fails with:  
`Completed: 15/10/2020 00:03 Last error: Error: GET info.json: Unknown error 2 (412):`

My system clock has the correct time (difference to [time.gov](http://time.gov) is 0.05s).  
On my WebDAV in my joplin directory I have a folder called 'locks' which holds 1198 sync files as of yet:

- sync\_desktop\_\<32-char-string\> (2).json
- ...
- sync\_desktop\_\<32-char-string\> (1199).json
- and with each sync attempt, a new file of the same format is created
- But besides that, there exists no file with another format/naming (exclusive...) in the 'locks' folder

Any ideas? 😕

---

<div class="post-metadata">

**Author:** ![laurent](https://avatars.discourse-cdn.com/v4/letter/l/ce7236/32.png) [@laurent](https://discourse.joplinapp.org/u/laurent)\
**Post date:** [14 October 2020 23:00 UTC](https://discourse.joplinapp.org/t/cannot-aquire-sync-lock/10878/27 "2020-10-14T23:00:55Z")

</div>

I don't understand why it's creating files with (1), (2), etc. Is that the server trying to be smart and creating a new copy instead of overwriting? The filename should be sync\_desktop\_STRING.json The app doesn't know how to generate any other name so it wouldn't append a number like this.

Which server is it? Perhaps there's some way we can force it to overwrite the file, but it seems a bit crazy anyway and I'm surprised sync could ever work with such a system.

---

<div class="post-metadata">

**Author:** ![hondo](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/hondo/32/5333_2.png) [@hondo](https://discourse.joplinapp.org/u/hondo)\
**Post date:** [15 October 2020 06:13 UTC](https://discourse.joplinapp.org/t/cannot-aquire-sync-lock/10878/28 "2020-10-15T06:13:25Z")

</div>

Thanks for your quick reply. I have no idea what is going wrong here and why...

The WebDAV space I use is the 'cloud storage' from [mailbox.org](http://mailbox.org).

What seems a bit strange to me is, that the 'Cannot acquire sync lock' error on my side seemed to start with the new versions which should fix the very same error for others. But maybe this is pure coincidence.

Beforehand it worked like a charm for many months with exactly the same configuration. I haven't changed anything in my setup, besides installing the Joplin updates that popped up.

As a first quick shot: Can I savely delete the 'locks' folder and/or all of its content (all the sync\_desktop\_STRING.json files) on the WebDAV space or could this destroy something?

---

<div class="post-metadata">

**Author:** ![laurent](https://avatars.discourse-cdn.com/v4/letter/l/ce7236/32.png) [@laurent](https://discourse.joplinapp.org/u/laurent)\
**Post date:** [15 October 2020 09:58 UTC](https://discourse.joplinapp.org/t/cannot-aquire-sync-lock/10878/29 "2020-10-15T09:58:56Z")

</div>

> [@hondo](#):
>
> As a first quick shot: Can I savely delete the 'locks' folder and/or all of its content (all the sync\_desktop\_STRING.json files) on the WebDAV space or could this destroy something?

You can delete the content of the locks folder, but not the folder itself as it will be used for syncing.

---

<div class="post-metadata">

**Author:** ![hondo](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/hondo/32/5333_2.png) [@hondo](https://discourse.joplinapp.org/u/hondo)\
**Post date:** [15 October 2020 22:11 UTC](https://discourse.joplinapp.org/t/cannot-aquire-sync-lock/10878/30 "2020-10-15T22:11:50Z")

</div>

Unfortunately, the deleting of the sync\_desktop\_STRING.json files in the 'locks' folder doesn't help.

I deleted all the files (~2000) and started over with an empty 'locks' folder, but as soon as I start Joplin again and try to sync, it's just continuing to write one sync\_desktop\_STRING.json file after another to 'locks' (beginning with sync\_desktop\_STRING (2).json and counting up) while throwing the 'Cannot Aquire Sync Lock' error.

What can I do?

---

<div class="post-metadata">

**Author:** ![hondo](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/hondo/32/5333_2.png) [@hondo](https://discourse.joplinapp.org/u/hondo)\
**Post date:** [31 October 2020 09:37 UTC](https://discourse.joplinapp.org/t/cannot-aquire-sync-lock/10878/31 "2020-10-31T09:37:33Z")

</div>

Short update here:

What seems to have solved the problem:

- Deleting the 'locks' folder on the WebDAV space
- Creating a new 'locks' folder on the WebDAV space
- Clearing the cache of the Joplin Android app

After this procedure, Joplin seems to work on Windows as well as on Android again and sync between the two devices via WebDAV as before.

---

<div class="post-metadata">

**Author:** ![wuschel](https://avatars.discourse-cdn.com/v4/letter/w/e99b99/32.png) [@wuschel](https://discourse.joplinapp.org/u/wuschel)\
**Post date:** [26 September 2021 19:03 UTC](https://discourse.joplinapp.org/t/cannot-aquire-sync-lock/10878/32 "2021-09-26T19:03:18Z")

</div>

Hi,

I had the same problem on a a cell phone (iPhone 11). I was able to solve it by playing with the number of _max concurrent connections_ in the synchronization options:

-- Originally, it was set to 5, which more often than not resulted in cancelling the synchronisation process.  
-- Setting it to 1 made a synchronization process possible, but it would take ages, and possibly abort.  
-- Setting it to 10 sped up the entire process. No cancellation or error observed so far.

Cheers,

---

<div class="post-metadata">

**Author:** ![nicolascuervo](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/nicolascuervo/32/18310_2.png) [@nicolascuervo](https://discourse.joplinapp.org/u/nicolascuervo)\
**Post date:** [19 September 2023 10:23 UTC](https://discourse.joplinapp.org/t/cannot-aquire-sync-lock/10878/33 "2023-09-19T10:23:28Z")

</div>

Hi,

I have been struggling with sync issues in the android application with different devices.  
(Windows and linux apps no problem).

There seems to be two reasons for this problem:

1. Cloud services (in my case onedrive) might have a time restriction on the connection that results in an error that can be seen in the journal as: "could not refresh lock cancelling sync"
2. Sync stops if the screen locks

## Solution:

### 1. Copy the sync folder in the android device and use 'file system' sync in Joplin app

this can be done in different ways:

- download and extract directly from cloud service in the device or in desktop to then copy to device using USB cable
- in desktop app use file system sync to create such folder and then send it to device

> ⚠ be careful during this operation : you should go in advanced sync options and click "Re-upload local data to sync target" ⚠

- use a Peer to Peer solution for syncing like Resilio Sync

Once the sync folder is in the android device you just have to use file system sync to that folder. If you prefer to use a cloud service you can set it up after you have managed to successfully sync all your notes once. Next updates should not be as time consuming and cloud should work.

### 2. Avoid screen from locking

there are different ways to do this, I use Screen Alive app from the app store

### Bonus

if you have heavy attachments in your notes, like videos, you could also try to first sync notes only and then the attachments by changing "Attachment behavior" to "Manual" and the to "always"

---

<div class="post-metadata">

**Author:** ![snelzing](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/snelzing/32/26127_2.png) [@snelzing](https://discourse.joplinapp.org/u/snelzing)\
**Post date:** [13 June 2025 13:54 UTC](https://discourse.joplinapp.org/t/cannot-aquire-sync-lock/10878/34 "2025-06-13T13:54:40Z")

</div>

I actually had this issue too on Windows 11, but I hadn't updated it in awhile. Updating fixed it lol. I have used Joplin a lot of linux though and havent ran into the issue. Maybe a specific flavor is the problem? (eg debian, arch, etc)

[Previous page](https://discourse.joplinapp.org/t/cannot-aquire-sync-lock/10878.md?page=1)
