Android version 2.14.9 "Row too big to fit into CursorWindow"

Operating system

Android

Joplin version

2.14.9

Sync target

Joplin Server

What issue do you have?

Android version cannot sync all my notes. The log file shows that "Synchronizer" tried to make a huge "SELECT * FROM resources WHERE id IN (...)" query and there were too many IDs listed.
Could you limit the single query size to something that Postgres could handle?
I have removed all data and started sync multiple times, but it has never managed to sync all notes.

There is also some "Synchronizer: "Could not refresh lock - cancelling sync. Error was:", "Error: Lock has expired" -errors that are not fatal.

mobile-log.log (44.3 KB)
Screenshot 2024-07-02 203712

1 Like

Strange that nobody hasn't commented anything?
As far as I can see:

  • I'm not onlyone who have this problem
  • This problem has been there quite long time
  • Fixing this problem should not be hard, because limiting the amount of IDs in the SELECT would fix this.

I guess that I have too many documents, but that should not be a limiting factor!

I tested WebDav too!
First I pushed all my notes to WebDav with my linux Joplin, and then tried to sync them to my Android device.
Same error, "SELECT * FROM resources WHERE id IN (...)".

So, it's not (actually) server end Postgre problem, it's local "Android" database problem.

Could somebody atleast point me to the right GitHub code and directory, so I can "try" to solve this problem, if nobody else have time to fix it.

Thank you!

This problem is with version 3.0.8 (prod, android) too.
Sync Version: 3
Profile Version: 47
Android API leve: 34

Possibly related:

One possibility is that this could be related to large OCR text for one or more of the resources (cumulatively larger than 50 MiB, which seems to be the maximum row size on most platforms).

If I check from that WebDav "storage" what I now have, the biggest single document is:

  • 12 MB
  • Includes OCR of 34 MB PDF document

Both are under 50 MB, so it should not effected.

Removing that document from all devices didn't change anything.

I managed to "solve" this problem!

What I did:

  1. Export everything in Linux to JEX-file
  2. Open that archive and list all *.MDs and resource -files what are bigger then 50MiB
  3. Remove those notes at Joplin-desktop
  4. Export (again) everything in Linux to JEX-file
  5. Delete local (.config/joplin*) storage
  6. Delete server (Joplin server) storage
  7. Delete Android Joplin data from phone
  8. Import that exported JEX back to Joplin-destop application
  9. Start to sync all documents to Joplin server
  10. Start Android synchronization and let it run multiple sync rounds

The main problem is of course "revisions". If you add a document, that "breaks" Android sync (like file size >50 MiB), and even if you remove it a few seconds later, the system tries to "replicate" it indefinitely.
The only way to solve the problem is to reset to whole revision history after you have managed to remove the breaking document.

Would it be "possible" to change that max resource size from 50 MiB to something (much) bigger?
OR change the code that way that if the replication system "sees" revision (add/modify) which resource size is bigger than it can handle, it would skip it or handle the situation some other way. (And alerting user that there is such problem --> user could try to fix it, or at least person knows that such document is missing in the Android phone)

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