Android out of sync

Somehow my Andoid phone got out of sync with the cloud (ownCloud, WebDAV).
Every time I press sync, it reports “Updated remote items:1” but nothing gets updated. Updated notes on the server are not downloaded either.
The server log only has messages wrt. .sync and .resource (The resource you tried to create already exists).

Did you recently attached a large resource to a note? Do you have encryption enabled? It might be that you just need to wait several minutes until that item is synced.

No (large resource) and no (encryption).
And I waited several minutes.

For situations like this, I would like to have a ‘force fetch all’ option. The cloud notes are the most actual.

That would be a nice feature, but how would you handle the local data. Shall it be overwritten, deleted, merged?
Everything other than replacing the local data (delete everything and retrieve all data from server) must be a pain in the neck to implement.

Also, such a feature should be properly guarded.

I my particular case I would want to have the equivalent to uninstall (removing all data), re-install and painfully fill in all necessary settings, and then sync everything off the cloud.
Anything else is, as you mentioned, hard to implement, error prone, if not dangerous.

Yep, in this case it would be a nice feature. :+1:

It’s strange the notes are out of sync though. Are you sure all clients are in sync and that the sync target has all the notes?

What if you compare the status screen of the mobile app to the status screen of the desktop app? Is there any discrepancy?

I currently have one desktop that has actual content.
The cloud (ownCloud) also has the correct data.

One one Android device, I uninstalled Joplin and re-installed it. After the initial sync, it has the correct data. However, every time I press sync, without changing anything, it reports “Updated remote items:1”. Nevertheless no activity (but see below) is registered on the cloud server.
When I create a new note, it reports “Creating remote iems: 1” but nothing arrives at the server. Pressing sync (without further changes) keeps reporting “Creating remote items: 1”.

The ownCloud log only shows messages wrt. .sync and .resource, e.g.
“url”:"/owncloud/remote.php/webdav/Notes/Joplin/.sync/",
“message”:"Exception: HTTP/1.1 405 The resource you tried to create already exists: …

The status screen of mobile and desktop match, except for the mobile having one extra note.

Sync report:

Date,Level,Message
09-15T14:17:40,30,"""Reducer action", "NAV_BACK""
09-15T14:17:20,30,"""Reducer action", "NAV_GO, Log""
09-15T14:17:17,30,"""Reducer action", "NAV_BACK""
09-15T14:17:04,30,"""ResourceService::deleteOrphanResources:", "[]""
09-15T14:17:04,30,"""ResourceService::indexNoteResources: Completed""
09-15T14:17:03,30,"""ResourceService::indexNoteResources: Start""
09-15T14:16:51,30,"""Reducer action", "NAV_GO, Status""
09-15T14:16:44,30,"""Reducer action", "SIDE_MENU_CLOSE""
09-15T14:16:40,30,"""Reducer action", "FOLDER_UPDATE_ALL""
09-15T14:16:40,30,"""Reducer action", "SYNC_COMPLETED""
09-15T14:16:40,30,"""Total resources: 0""
09-15T14:16:40,30,"""Total notes: 10""
09-15T14:16:40,30,"""Total folders: 3""
09-15T14:16:40,30,"""createRemote: 1""
09-15T14:16:40,30,"""Operations completed: ""
09-15T14:16:40,30,"""No master key is defined as active. Check this: Either one or more master keys exist but no password was provided for any of them. Or no master key exist. Or master keys and password exist, but none was set as active.""
09-15T14:16:39,30,"""Reducer action", "SYNC_STARTED""
09-15T14:16:39,30,"""Starting scheduled sync""
09-15T14:16:39,30,"""Preparing scheduled sync""
09-15T14:16:39,30,"""Scheduling sync operation...""
09-15T14:16:36,30,"""Reducer action", "SIDE_MENU_OPEN""
09-15T14:16:35,30,"""Reducer action", "DECRYPTION_WORKER_SET""
09-15T14:16:35,30,"""DecryptionWorker: completed decryption.""
09-15T14:16:34,30,"""Reducer action", "DECRYPTION_WORKER_SET""
09-15T14:16:34,30,"""DecryptionWorker: starting decryption...""
09-15T14:16:34,30,"""Reducer action", "NOTE_UPDATE_ALL""
09-15T14:16:33,30,"""Reducer action", "APP_STATE_SET""
09-15T14:16:33,30,"""Application initialized""
09-15T14:16:33,30,"""Scheduling sync operation...""
09-15T14:16:33,30,"""Reducer action", "NAV_GO, Notes""
09-15T14:16:33,30,"""Reducer action", "FOLDER_SET_COLLAPSED_ALL""
09-15T14:16:33,30,"""Reducer action", "MASTERKEY_UPDATE_ALL""
09-15T14:16:33,30,"""Reducer action", "TAG_UPDATE_ALL""
09-15T14:16:33,30,"""Reducer action", "FOLDER_UPDATE_ALL""
09-15T14:16:33,30,"""Loading folders...""
09-15T14:16:33,30,"""Loaded master keys: 0""
09-15T14:16:33,30,"""Trying to load 1 master keys...""
09-15T14:16:33,30,"""Scheduling sync operation...""
09-15T14:16:33,30,"""Reducer action", "MASTERKEY_REMOVE_NOT_LOADED""
09-15T14:16:33,30,"""Loaded master keys: 0""
09-15T14:16:33,30,"""Trying to load 1 master keys...""
09-15T14:16:33,30,"""Sync target: 5""
09-15T14:16:33,30,"""Reducer action", "SETTING_UPDATE_ALL""
09-15T14:16:33,30,"""Loading settings...""
09-15T14:16:33,30,"""Database is ready.""
09-15T14:16:33,30,"""Current database version", "12""
09-15T14:16:33,30,"""Checking for database schema update...""
09-15T14:16:33,30,"""Database was open successfully""
09-15T14:16:33,30,"""Starting application net.cozic.joplin-mobile (prod)""
09-15T14:16:33,30,"""====================================""

================================================================================
type,id,updated_time,sync_time,is_conflict
1,4e57fcea047748db99c324624ee44ca6,1535659859929,1536916084102,
1,8daf671cef5841a180e6ed0139140c1d,1535095840000,1536916084700,
1,b852a393fb064b5d9ed7586f89c194af,1536173958949,1536916085320,
1,695d1d99b6f04dcab71220764017a86d,1536262202364,1536916085927,
1,885e0281ddde45deb31c7d4f1dd9d535,1536262426321,1536916086532,
1,e2f6c4ca66dc44038f41c215242f4764,1536262895970,1536916087149,
1,6938822f228f41c09b21369c6b2537e7,1536746136131,1536916090430,
1,b75f098e40f64a33aa6a12cbea73b2dc,1536917189196,1536916091264,
1,ca3de98e386a4ac38cc492559c1cf9e4,1536827896016,1536916091864,
2,860a0390a7834195ac0c64a49b280dd2,1533472832192,1536916087763,
2,00736f0b51184dd9a79ca6faf5fcd54f,1535545965151,1536916088383,
2,d30060eecc9f486595d31d71b2582fa2,1535659042441,1536916088990,
9,4298bfbe8b754d329d80a323d2cea606,1536572533954,1536916089618,

A played a bit with encryption a while ago. My current setup is encryption disabled. However, there is still a master key (type_: 9) note.

It seems that when this setup is synched to a clean Joplin install on Android, it enables encryption, which confuses Joplin a lot. I manually removed the master key note from the cloud, reinstalled Joplin on Android, sync, and now it seems functional again.

Is there a way to remove such a mster key note?

There’s some info about all this there: https://joplin.cozic.net/e2ee/ If something’s not clear, feel free to post back here and we can clarify.

Well, if you enable encryption according to the docs, you get a master key. When you disable encryption, the master key stays. And, as I wrote, this apparently confuses new (Android) devices with new Joplin installs. There is no documented way to remove the master key even when encryption is no longer enabled.

Ok… So I just noticed my android app is way out of sync, comparing with the desktop app. Encryption enabled and was working fine until few days back (probably last upgrade). I’ll triple check if new notes got synced and what’s in logs.

Edit: ignore it. I can’t spot what went wrong, could be my syncing mechanism. The truth is, the desktop app pushes now notes that never showed up on android before, upon any change. A forced refresh would help here indeed.

I must note that in my particular case this wouldn’t have solved the problem. Even clean reinstalls didn’t.
The real bug is that the Android version of Joplin enables encryption if it encounters a master key, even though encryption is not actually enabled.

@sciurius in this case it looks like a bug and a github issue should be opened. @laurent what do you think?

I have the same problem. How can I remove manually the master key?

Ok, I tried some ways. Used DB Browser Sqlite to delete the master key. It comes back. Thank you for this thread. It is them same issue with me. I used encryption but disabled it and then there was the syncing problem with android. To make a long story short. The only solution to get rid of this encryption mess was

1.) export of all my notes in the desktop app to *.jex.
2.) delete all mobile apps (ios, android in my case)
3.) delete all files of joplin in my nextcloud-folder
4.) Sync of the desktop app with my nextcloud -> deletes all of the notes
5.) restore backup of the jex-Archive in the desktop-app
6.) Let it sync all the notes with nextcloud
7.) Installed the mobile apps back -> and syncing again

This was the only for me to get rid of this strange problem. The export to *.jex removes all the encryption and the master key.

I think there should be a better solution for this issue.

1 Like

It's not a bug but a feature :slight_smile: although perhaps not a good one. My idea was that for example if the user enables E2EE on desktop, then sync with their mobile, they most likely also want E2EE enabled there so that's why it's automatically enabled.

I see here and in other threads that it can cause issues though, so I've been planning to remove the feature. If it's not already on GitHub, feel free to add it there.

I was recently bitten by the same problem. A failed update and re-installing 1.0.225 on android 4.4 did it. Since then … same problem.

Do I really have to export near 700 notes, then to reinstall on all instances (mobile and multiple desktops) by hand?
What happens to the internal links inside Joplin?

Stucki

@notetaker THANKS! I now followed your solution and after a very long time to resync all tree places, the only thing which is lost, is the order of the notebooks.
So I have 'sync' back now, except with my own head :slight_smile:
I permanently search notes …

Stucki

I'm glad it worked for you too. :wink: