# Joplin keeps showing "Syncing"

**URL:** <https://discourse.joplinapp.org/t/joplin-keeps-showing-syncing/41229>\
**Category:** Support\
**Created:** [6 October 2024 04:49 UTC](https://discourse.joplinapp.org/t/joplin-keeps-showing-syncing/41229 "2024-10-06T04:49:48Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![rxliuli](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/rxliuli/32/4083_2.png) [@rxliuli](https://discourse.joplinapp.org/u/rxliuli)\
**Post date:** [6 October 2024 04:49 UTC](https://discourse.joplinapp.org/t/joplin-keeps-showing-syncing/41229/1 "2024-10-06T04:49:48Z")

</div>

### Operating system

macOS

### Joplin version

3.0.15

### Desktop version info

Joplin 3.0.15 (prod, darwin)

Client ID: 58f713f3db09496389ddc04056cf9930  
Sync Version: 3  
Profile Version: 47  
Keychain Supported: Yes

Revision: 598677b

Backup: 1.4.2  
Joplin Batch: 0.2.2  
Joplin Publisher: 1.1.4

### Sync target

OneDrive

### Editor

Markdown Editor

### What issue do you have?

In the case of a long startup, Joplin gets stuck in a synchronization deadlock. I suspect it's because I'm continuously calling the GET /folders? interface, but I'm not sure why there is a problem with this interface.

### Screenshots

 ![Snipaste_2024-10-06_12-41-28.png](https://canada1.discourse-cdn.com/flex028/uploads/cozic/original/3X/9/d/9dae278cade87a02d083ed8ec2b0ef1752e7d78e.png)  
 ![image](https://canada1.discourse-cdn.com/flex028/uploads/cozic/original/3X/a/f/af4f1758c8640c70c0440d45c124a129cc2d5c4a.jpeg)

### Log file

[last\_1000\_lines.txt](https://discourse.joplinapp.org/uploads/short-url/tIBBSFlo3IzsB8u5mWuEvrOHUEz.txt) (62.6 KB)

---

<div class="post-metadata">

**Author:** ![michal.borek](https://avatars.discourse-cdn.com/v4/letter/m/4da419/32.png) [@michal.borek](https://discourse.joplinapp.org/u/michal.borek)\
**Post date:** [6 October 2024 09:25 UTC](https://discourse.joplinapp.org/t/joplin-keeps-showing-syncing/41229/2 "2024-10-06T09:25:24Z")

</div>

When I have problems like these I just delete the locks from the cloud drive (ensuring nothing is syncing at a time).

---

<div class="post-metadata">

**Author:** ![rxliuli](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/rxliuli/32/4083_2.png) [@rxliuli](https://discourse.joplinapp.org/u/rxliuli)\
**Post date:** [6 October 2024 10:52 UTC](https://discourse.joplinapp.org/t/joplin-keeps-showing-syncing/41229/3 "2024-10-06T10:52:27Z")

</div>

I can quit and reopen Joplin, which can temporarily solve this problem. But it's just annoying.

---

<div class="post-metadata">

**Author:** ![rxliuli](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/rxliuli/32/4083_2.png) [@rxliuli](https://discourse.joplinapp.org/u/rxliuli)\
**Post date:** [6 October 2024 14:07 UTC](https://discourse.joplinapp.org/t/joplin-keeps-showing-syncing/41229/4 "2024-10-06T14:07:24Z")

</div>

This problem has occurred again.

 ![image](https://canada1.discourse-cdn.com/flex028/uploads/cozic/original/3X/2/a/2a39f8ae7a4628df96b3f10b66420424bfb4d7ab.png)

---

<div class="post-metadata">

**Author:** ![personalizedrefriger](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/personalizedrefriger/32/13210_2.png) [@personalizedrefriger](https://discourse.joplinapp.org/u/personalizedrefriger)\
**Post date:** [6 October 2024 19:42 UTC](https://discourse.joplinapp.org/t/joplin-keeps-showing-syncing/41229/5 "2024-10-06T19:42:35Z")

</div>

I compiled instructions for how to get a stack trace for the "Synchronization is already in progress" message. However, I no longer think that a stack trace for this message will be useful — it seems to be coming from the regularly scheduled sync. I'm posting them here anyway because they might still be helpful for related debugging:

> **Debugging: Getting a stack trace**
>
> To get stack trace information for the "Synchronization is already in progress" error:
> 
> 1. Open the "Sources" tab in Joplin's developer tools.
> 2. Press ctrl-p (I think cmd-p on MacOS).
> 3. Type `Synchronizer.js` and press enter.
> 4. Press cmd-f and search for `Synchronisation is already in progress`
> 5. Add a breakpoint to the line by clicking on the line number.
> 6. Wait for the breakpoint to be triggered.
> 7. Scroll to and inspect the "Call stack" section in the right sidebar.
> 8. Check the "Show ignore-listed frames" checkbox.
> 
> > **Screen recording demonstration**
> >
> > Note that it might be necessary to check "Show ignore-listed frames".

More useful might be determining where the synchronizer is getting stuck. Temporarily [enabling debug logging](https://joplinapp.org/help/apps/debugging#desktop-application) might also help with this.

---

<div class="post-metadata">

**Author:** ![rxliuli](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/rxliuli/32/4083_2.png) [@rxliuli](https://discourse.joplinapp.org/u/rxliuli)\
**Post date:** [7 October 2024 02:22 UTC](https://discourse.joplinapp.org/t/joplin-keeps-showing-syncing/41229/6 "2024-10-07T02:22:58Z")

</div>

> [@personalizedrefriger](#):
>
> Synchronisation is already in progress

Thank you, I have recorded the Devtools Debugger video, and the logs have been enabled. If this issue occurs again, I will add it below.

---

<div class="post-metadata">

**Author:** ![personalizedrefriger](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/personalizedrefriger/32/13210_2.png) [@personalizedrefriger](https://discourse.joplinapp.org/u/personalizedrefriger)\
**Post date:** [7 October 2024 04:06 UTC](https://discourse.joplinapp.org/t/joplin-keeps-showing-syncing/41229/7 "2024-10-07T04:06:27Z")

</div>

Thank you for the information! Based on the stack trace, the error message seems to be coming from the regularly scheduled sync:

> <https://github.com/laurent22/joplin/blob/d1ac3d415ea7665271accd581807e1e5ae56feef/packages/lib/registry.ts#L245>

Unfortunately, this doesn't show where the ongoing sync is getting stuck. One possibility is [`fetchWithRetry` in `shim.ts`](https://github.com/laurent22/joplin/blob/d1ac3d415ea7665271accd581807e1e5ae56feef/packages/lib/shim.ts#L247)), which retries a request after an increasing delay. However, for [retryable](https://github.com/laurent22/joplin/blob/d1ac3d415ea7665271accd581807e1e5ae56feef/packages/lib/shim.ts#L182) requests, `fetchWithRetry` should fail after `fetchMaxRetry_` = 5 failed requests (45000 ms + time for `fetch` to complete or fail).

---

<div class="post-metadata">

**Author:** ![rxliuli](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/rxliuli/32/4083_2.png) [@rxliuli](https://discourse.joplinapp.org/u/rxliuli)\
**Post date:** [9 October 2024 03:14 UTC](https://discourse.joplinapp.org/t/joplin-keeps-showing-syncing/41229/8 "2024-10-09T03:14:42Z")

</div>

The problem has occurred again, but I have enabled the debug log according to the instructions above.

 ![image](https://canada1.discourse-cdn.com/flex028/uploads/cozic/original/3X/a/f/af64fb5e37a83053cac6349d076c5d1eac892fdb.png)

[last\_2000\_lines.txt](https://discourse.joplinapp.org/uploads/short-url/5QuFnpQq0hd1Oq5McyRBsZfhBq2.txt) (128.8 KB)

---

<div class="post-metadata">

**Author:** ![personalizedrefriger](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/personalizedrefriger/32/13210_2.png) [@personalizedrefriger](https://discourse.joplinapp.org/u/personalizedrefriger)\
**Post date:** [9 October 2024 03:27 UTC](https://discourse.joplinapp.org/t/joplin-keeps-showing-syncing/41229/9 "2024-10-09T03:27:40Z")

</div>

Thank you! I'm highlighting the last error before the repeated `Synchronisation is already in progress. State: in_progress`s:

```auto
Code: ENOTFOUND
FetchError: request to https://graph.microsoft.com/v1.0/drive/root:/%E5%BA%94%E7%94%A8/Joplin/locks/1_1_58f713f3db09496389ddc04056cf9930.json failed, reason: getaddrinfo ENOTFOUND graph.microsoft.com
    at ClientRequest.<anonymous> (/Applications/Joplin.app/Contents/Resources/app.asar/node_modules/@joplin/lib/node_modules/node-fetch/lib/index.js:1491:11)
    at ClientRequest.emit (node:events:514:28)
    at TLSSocket.socketErrorListener (node:_http_client:495:9)
    at TLSSocket.emit (node:events:514:28)
    at emitErrorNT (node:internal/streams/destroy:151:8)
    at emitErrorCloseNT (node:internal/streams/destroy:116:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

```

One possible explanation: Joplin might not be setting `Synchronizer.state_` back to `idle`. In particular, [the call to `releaseLock` isn't wrapped in one of the `try/catch` blocks in `Synchronizer.start_`](https://github.com/laurent22/joplin/blob/d1ac3d415ea7665271accd581807e1e5ae56feef/packages/lib/Synchronizer.ts#L1143). As such, if an error occurs in `releaseLock`, `Synchronizer.start` might exit before [setting `state_` back to `idle`](https://github.com/laurent22/joplin/blob/d1ac3d415ea7665271accd581807e1e5ae56feef/packages/lib/Synchronizer.ts#L1181).

---

<div class="post-metadata">

**Author:** ![rxliuli](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/rxliuli/32/4083_2.png) [@rxliuli](https://discourse.joplinapp.org/u/rxliuli)\
**Post date:** [9 October 2024 13:24 UTC](https://discourse.joplinapp.org/t/joplin-keeps-showing-syncing/41229/10 "2024-10-09T13:24:26Z")

</div>

Okay, do I need to provide any other information? If necessary, I can also run the Joplin development environment locally, although I am not familiar with the internal code of the Joplin project

---

<div class="post-metadata">

**Author:** ![personalizedrefriger](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/personalizedrefriger/32/13210_2.png) [@personalizedrefriger](https://discourse.joplinapp.org/u/personalizedrefriger)\
**Post date:** [9 October 2024 17:36 UTC](https://discourse.joplinapp.org/t/joplin-keeps-showing-syncing/41229/11 "2024-10-09T17:36:08Z")

</div>

> [@rxliuli](#):
>
> Okay, do I need to provide any other information?

If the issue was caused by the `releaseLock` issue mentioned above, it should be fixed by this [pull request](https://github.com/laurent22/joplin/pull/11188). Until a fix is merged/included in a release, be aware that [disabling sync locks](https://discourse.joplinapp.org/t/sync-doesnt-finish-and-cant-be-canceled-on-linux-desktop/40378/3) (available in the 3.1.x pre-releases) may also resolve the issue.

I don't think any other information is necessary.

---

<div class="post-metadata">

**Author:** ![rxliuli](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/rxliuli/32/4083_2.png) [@rxliuli](https://discourse.joplinapp.org/u/rxliuli)\
**Post date:** [8 November 2024 17:04 UTC](https://discourse.joplinapp.org/t/joplin-keeps-showing-syncing/41229/12 "2024-11-08T17:04:40Z")

</div>

Thank you, the issue has been confirmed to be fixed after updating to the latest version.

---

<div class="post-metadata">

**Author:** ![rxliuli](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/rxliuli/32/4083_2.png) [@rxliuli](https://discourse.joplinapp.org/u/rxliuli)\
**Post date:** [7 December 2024 11:21 UTC](https://discourse.joplinapp.org/t/joplin-keeps-showing-syncing/41229/13 "2024-12-07T11:21:44Z")

</div>

@personalizedrefriger This issue has appeared again in the new version of Joplin

 ![image](https://canada1.discourse-cdn.com/flex028/uploads/cozic/original/3X/2/5/25707e6431a81cbc7cd0ab5e450d6c8eea0e4cd6.jpeg)

```sh
Joplin 3.1.24 (prod, darwin)

Client ID: 58f713f3db09496389ddc04056cf9930
Sync Version: 3
Profile Version: 47
Keychain Supported: Yes

Revision: d581264

Backup: 1.4.2
Joplin Batch: 0.2.2
Joplin Publisher: 1.2.0

```

logfile  
[log-last-2000.txt](https://discourse.joplinapp.org/uploads/short-url/szsiv4GIIrqadQ4HlIf1eJjo9kx.txt) (219.6 KB)

---

<div class="post-metadata">

**Author:** ![personalizedrefriger](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/personalizedrefriger/32/13210_2.png) [@personalizedrefriger](https://discourse.joplinapp.org/u/personalizedrefriger)\
**Post date:** [11 December 2024 07:10 UTC](https://discourse.joplinapp.org/t/joplin-keeps-showing-syncing/41229/14 "2024-12-11T07:10:25Z")

</div>

Here are two possible causes:

- The issue is still related to sync locks.
  - Sync locks were [removed](https://github.com/laurent22/joplin/commit/6c0258e8a66fa3d93267a19ab79950de887d181a), but only in v3.2.x. In v3.1.x, they need to be disabled using a feature flag (settings \> synchronization \> advanced \> "enable sync locks").

- At least 1-2 users have reported that OneDrive sync is creating additional folders in `/Apps` named `Graph` (or `Graph 2` or similar). If the sync folder changes from `/Apps/Joplin` -\> `/Apps/Graph`, this might cause sync issues:
  - [Forum post with a related issue report](https://discourse.joplinapp.org/t/android-sync-to-onedrive-error/41370).
  - Upstream issue: [Appfolder is named Graph · Issue #1866 · OneDrive/onedrive-api-docs · GitHub](https://github.com/OneDrive/onedrive-api-docs/issues/1866)
  - Joplin should sync to `/Apps/Joplin`.

---

<div class="post-metadata">

**Author:** ![rxliuli](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/rxliuli/32/4083_2.png) [@rxliuli](https://discourse.joplinapp.org/u/rxliuli)\
**Post date:** [11 December 2024 11:26 UTC](https://discourse.joplinapp.org/t/joplin-keeps-showing-syncing/41229/15 "2024-12-11T11:26:24Z")

</div>

This disables the synchronization lock, right? I will continue to observe for a while, and if there are any issues, I will continue to report.

 ![image](https://canada1.discourse-cdn.com/flex028/uploads/cozic/original/3X/a/c/ac9d1f3bcb1674cd5c45fac89b634aead86b9f36.png)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex028/uploads/cozic/original/3X/1/c/1c948e33314e232a0927789508474d8624f4270b.png) [@system](https://discourse.joplinapp.org/u/system)\
**Post date:** [10 January 2025 11:26 UTC](https://discourse.joplinapp.org/t/joplin-keeps-showing-syncing/41229/16 "2025-01-10T11:26:31Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
