joplin
joplin copied to clipboard
Android sync gets permanently stuck whilst seemingly doing nothing
I'm splitting this from #8123 since it is a different issue.
This is a long-term issue going on for years described elsewhere on the internet e.g.
- https://www.reddit.com/r/joplinapp/comments/xvp4rl/android_client_sporadically_hangs_on_sync/
- https://discourse.joplinapp.org/t/never-ending-synchro/27669/19
- https://www.ctrl.blog/entry/joplin-notes-sync.html
Environment
Joplin version: 2.11.31 Platform: Android 13 OS specifics: using Dropbox as sync mechanism, encryption enabled
Steps to reproduce
This happens randomly, so I don't know the exact cause.
- Open Android app.
- Use biometrics (fingerprint) to unlock.
- Joplin immediately begins a sync.
- Joplin stays syncing forever without showing anything other than the spinner animation.
- If you press 'Cancel' then it shows 'Cancelling...' forever.
- Force close the app.
- Open the app again and use fingerprint to unlock.
- Problem repeats from step 3.
It will continue like this forever. The only way to resolve it is to force it to get locked out by repeatedly force closing the app and opening it whilst also syncing on another device. This isn't always easy because if there is nothing to sync on desktop then it's very quick, so you have to get the timing just right to cause it to lock. After being locked out, it will regain the ability to sync.
Describe what you expected to happen
It should always be able to sync. The app is essentially unusable when this happens almost every day. I don't always have the ability to get to a computer to do the fix.
Logfile
Same here, except it never worked.
I am also experiencing this issue for a while now and was looking for solutions. The syncing on the mobile app gets stuck indefinitely up until an error "Cannot acquire exclusive lock because the following clients have a sync lock on the target" appears. Do not know why this happens as no other device is syncing.
My sync target is Dropbox. This only happens on the android app.
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.
Update: the issue is still present, fix seems to be going on desktop app and manually triggering sync, syncing on android app then works.
This is so frustrating. It seems like it's not even syncing, it just gets stuck doing nothing, but saying it's syncing. From checking the log, it doesn't appear to be trying to sync.
The only way to make it realise that it isn't syncing is to force the lock to happen, as described before.
One thing I've noticed is sometimes after a successful sync it will immediately say "Syncing" again, could be related?
Same issue on Android 13 syncing to dropbox...
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 a problem.
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.
No it hasn't magically fixed itself.
Hi, please prioritize this bug. This is happening on my Android device for almost a year. There's no error on the logs. Also, this is happening with no lock (biometrics). The only way was to do the workaround in this comment. But now that workaround does not even work. I do the following:
- Disconnect wifi and mobile data on mobile.
- Start mobile app.
- Sync mobile.
- Wait until it says it has finished.
- Connect wifi or mobile data.
- Open desktop app.
- Now add a change on a note on desktop app.
- Sync desktop and sync mobile at the same time.
- Sync error on mobile is shown.
- Sync again on mobile.
This is very frustrating and it happens every time you try to sync. Before it was once in while.
Mobile:
- OS: Android 13
- App version: 2.12.3
Desktop:
- OS: Ventura 13.1
- Version: Joplin 2.12.18 (prod, darwin)
- Client ID: 51ae27048a4a4062b24b9653a13bc341
- Sync Version: 3
- Profile Version: 43
- Keychain Supported: Yes
- Revision: a0a4a81
Server: dropbox
Don't connect Dropbox directly from Joplin Android. In my experience... Using an app like Dropsync will solve this problem.
https://discourse.joplinapp.org/t/i-solved-android-stopped-syncing/33988?u=ranicloudy
Trying to trace down how to reproduce the behaviour here. I have a suspicion that the behaviour is caused by syncing mobile client with unresolved conflicts. Can anyone confirm or deny?
I think it happens to me regardless of if there are conflicts.
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 is still an issue. I still have to do often the workaround from https://www.reddit.com/r/joplinapp/comments/p9pqsh/comment/j5yqje8/
- Make sure android app is trying to sync.
- On laptop make sure there is something to sync. Then make any change add space etc.
- Start sync on the laptop.
This will result in error on Android something like: 'other device is syncing/cannot get exclusive lock's Now android is in normal non-syncing state. - Start syncing again on Android. Syncing should start working again.
Same situation here sadly.
If the error mentions a sync lock, this is another possible workaround (originally written for OneDrive, but should also apply to Dropbox):
Posted by @personalizedrefrigerator:
This can happen if one Joplin client is still syncing (or was closed during a sync). Re-opening and re-syncing the client that was interrupted may fix the issue.
If this was caused by a Joplin client that no longer exists (e.g. was uninstalled), you can try the following:
- Make a backup
- Delete files from
Apps/Joplin/locks
on OneDrivehttps://discord.com/channels/610762468960239627/610762468960239629/1184518156123906209
Additionally:
Posted by @laurent22:
To add up to this, the locks expire so if you wait a few minutes it should start working again
https://discord.com/channels/610762468960239627/610762468960239629/1184530213045014558
But from the comments above, the issue doesn't seem to resolve after a few minutes... If deleting the lock file helps, there may be a bug in lock file expiration.
@personalizedrefrigerator thank you. This workaround just worked for me.
The issue does seem to have something to do with lock expiration since behaviour persists seemingly indefinitely
Any tip how can one track down the process for lock to fail to expire?
I have a feeling (based on what people stated in the past related to the issue) it happens during the desktop update on new version (from 2.12 to 2.13, from 2.13 to 2.14 etc) but mobile app stays on previous version. I'll try testing this hypothesis with various parameters but at this point I'm as good as blind guessing.
Upd this hypothesis was wrong
I just got in the same situation, phone stopped sync couple of days ago.
There is no error message, just stuck in syncing or cancelling if you try.
Resolved by deleting the files locks directory.
I have now had it happen in the Desktop app (Windows)! It just appeared to be syncing forever, and couldn't be cancelled. Then I remembered this bug, and the same fix worked but in reverse. I opened the Android app and told it to sync, then the desktop app got locked out of sync, and then it was able to sync afterwards.
@laurent22 seems like this could be a candidate for a deeper look? Seems that the lock simply isn't released or that the behavior to nuke the /locks files could be defaulted to? I don't mind taking a look but would need some pointers on where to turn my attention to, to be able to identify the root cause.
I don't mind taking a look but would need some pointers on where to turn my attention to, to be able to identify the root cause.
Perhaps here: https://github.com/laurent22/joplin/blob/dev/packages/lib/services/synchronizer/LockHandler.ts#L136
I feel like this post (that I made) may have some useful info: https://discourse.joplinapp.org/t/i-solved-android-stopped-syncing-dropbox/33988/8?u=giantchain67
In short, there may be stale files in joplin's sync location (in my case dropbox) In this directory: Apps\Joplin\Locks These may need to be cleared out, the android client is not happy with them (perhaps gets in an unhandled loop / error state)
I have now had it happen in the Desktop app (Windows)! It just appeared to be syncing forever, and couldn't be cancelled. Then I remembered this bug, and the same fix worked but in reverse. I opened the Android app and told it to sync, then the desktop app got locked out of sync, and then it was able to sync afterwards.
@robme same issue here. I'm using Windows + Android + Dropbox, and the sync was hanging on Windows. The "reverse" fix did the trick for me--thanks!
I have experienced the problem with Dropbox and Joplin Android encryption.
Out of curiosity, is OneDrive also affected?