I decided to put it here as I understood it might be helpful even though I could not fix the OneDrive synchronization. I think it is impossible to use Joplin with OneDrive in some cases.
So if you are experiencing:
The maximum request length supported is 4MB or
FetchError you have two possibilities to fix it:
- Short and reliable. Switch to Dropbox.
- Long and unpredictable. Try to find and delete problematic notes.
Switch to Dropbox
I believe that it is impossible to "repair" synchronization with OneDrive since it is not a problem with your local provider, your notes or OneDrive itself, but a problem with the Joplin connector.
Therefore the best solution would be to switch to Dropbox right now and not spend your time on useless attempts to fix OneDrive synchronization.
Try to restore OneDrive sync
In case you want to fix OneDrive synchronization, I want to warn you, nothing helped me, and I doubt it can help anyone, especially in a long-term period.
So the solution for fixing OneDrive is to find a "problematic" entity (e.g. note, tag, notebook), delete it, restore sync, copy the "problematic" entity back with simplification.
First of all, backup your database before you do any actions with it. The best solution is RAW export because it can be useful in other steps.
After creating RAW backup, you should repeat this cycle until you fix synchronization:
Export database . Use JEX export. Close Joplin.
Find errors. Find the error log in
c:\Users\username\.config\joplin-desktop\log.txt file. Locate the "id" of conflicting item in it. It would be something like
e5bf60ca91354366a540f9147d466e89.md . It might be several errors. Save all conflicting "id" without
.md part somewhere.
Find notes' names . Use DB Browser for SQLite to open
c:\Users\username\.config\joplin-desktop\database.sqlite . Go to the Browse Data tab. Use "id" you found from step 2 to filtering conflicting items in notes, tags, resources, folders, revisions, etc. You need to find the item's type (e.g. note, tag, revision, etc.) and their actual names/titles. Find all connections with notes, save notes' "id" somewhere.
Delete problematic items . Go to the Execute SQL tab. Use
delete from SOURCE where id = "ITEM" command where SOURCE = Table where you found your problematic item and ITEM = problematic item id. Repeat this operation to delete not only all conflicting items but notes related to them. Close DB Browser for SQLite with saving database.
Try to sync without deleting joplin-desktop . Open Joplin and try to sync it with OneDrive now. If everything is fine, you can stop the cycle. If you find another
4MB error, go to step 1. If you find a
Fetch error, go to step 6.
Try to sync with deleting joplin-desktop . Usually, after doing something with your
database.sqlite in DB Browser for SQLite, you receive many
FetchError. To fix it, you should recreate all your folders. Export database as JEX format. Close Joplin and delete
c:\Users\username\.config\joplin-desktop\ folder. Go to OneDrive and delete the
\Apps\Joplin folder. Open Joplin, do not set up synchronization, import JEX. Set up synchronization, try to sync. If you find any errors, go to step 1. If sync is finished successfully, stop the cycle.
When you fixed your synchronization, use the RAW folder from the beginning to open notes with names from step 3 in some Markdown editor. Create new notes in Joplin and copy the text there in a simplified format.
Warning! All exporting/importing steps can take a lot of time if you have many notes. Do not believe Joplin's "Sync complete" message, press "Syncing" again. And again, and again
That's all. I think that the Joplin OneDrive connector is completely broken, and even if you are not experiencing problems now, you will find it in the future. But it is my IMHO.
I hope I will never repeat these steps, especially considering that the probability of fixing OneDrive synchronization is close to zero.