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

**URL:** <https://discourse.joplinapp.org/t/android-version-2-14-9-row-too-big-to-fit-into-cursorwindow/38865>\
**Category:** Support\
**Created:** [2 July 2024 17:13 UTC](https://discourse.joplinapp.org/t/android-version-2-14-9-row-too-big-to-fit-into-cursorwindow/38865 "2024-07-02T17:13:05Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![JJussi](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@JJussi](https://discourse.joplinapp.org/u/JJussi)\
**Post date:** [2 July 2024 17:13 UTC](https://discourse.joplinapp.org/t/android-version-2-14-9-row-too-big-to-fit-into-cursorwindow/38865/1 "2024-07-02T17:13:05Z")

</div>

### 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](https://discourse.joplinapp.org/uploads/short-url/8kfKddZGm7SLd0v6JzRMhKKziFt.log) (44.3 KB)

 ![Screenshot 2024-07-02 203712](https://canada1.discourse-cdn.com/flex028/uploads/cozic/original/3X/5/6/56c28a04c8a08a02b2dd54dc341df02c196c2034.png)

---

<div class="post-metadata">

**Author:** ![JJussi](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@JJussi](https://discourse.joplinapp.org/u/JJussi)\
**Post date:** [10 July 2024 05:49 UTC](https://discourse.joplinapp.org/t/android-version-2-14-9-row-too-big-to-fit-into-cursorwindow/38865/2 "2024-07-10T05:49:24Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![JJussi](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@JJussi](https://discourse.joplinapp.org/u/JJussi)\
**Post date:** [13 July 2024 11:43 UTC](https://discourse.joplinapp.org/t/android-version-2-14-9-row-too-big-to-fit-into-cursorwindow/38865/3 "2024-07-13T11:43:56Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![JJussi](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@JJussi](https://discourse.joplinapp.org/u/JJussi)\
**Post date:** [13 July 2024 12:03 UTC](https://discourse.joplinapp.org/t/android-version-2-14-9-row-too-big-to-fit-into-cursorwindow/38865/4 "2024-07-13T12:03:00Z")

</div>

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

---

<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:** [13 July 2024 15:30 UTC](https://discourse.joplinapp.org/t/android-version-2-14-9-row-too-big-to-fit-into-cursorwindow/38865/5 "2024-07-13T15:30:52Z")

</div>

Possibly related:

- [Row too big to fit into CursorWindow · Issue #364 · andpor/react-native-sqlite-storage · GitHub](https://github.com/andpor/react-native-sqlite-storage/issues/364)
- **Code that sets the cursor window size** : [joplin/packages/app-mobile/android/app/src/main/java/net/cozic/joplin/MainApplication.kt at 24954bd0f00f310e9ce233912f175017a84f0e21 · laurent22/joplin · GitHub](https://github.com/laurent22/joplin/blob/24954bd0f00f310e9ce233912f175017a84f0e21/packages/app-mobile/android/app/src/main/java/net/cozic/joplin/MainApplication.kt#L44)
- **Possible line causing the issue** : [joplin/packages/lib/Synchronizer.ts at 24954bd0f00f310e9ce233912f175017a84f0e21 · laurent22/joplin · GitHub](https://github.com/laurent22/joplin/blob/24954bd0f00f310e9ce233912f175017a84f0e21/packages/lib/Synchronizer.ts#L864)

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](https://github.com/laurent22/joplin/blob/24954bd0f00f310e9ce233912f175017a84f0e21/packages/app-mobile/android/app/src/main/java/net/cozic/joplin/MainApplication.kt#L50)).

---

<div class="post-metadata">

**Author:** ![JJussi](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@JJussi](https://discourse.joplinapp.org/u/JJussi)\
**Post date:** [14 July 2024 07:45 UTC](https://discourse.joplinapp.org/t/android-version-2-14-9-row-too-big-to-fit-into-cursorwindow/38865/6 "2024-07-14T07:45:48Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![JJussi](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@JJussi](https://discourse.joplinapp.org/u/JJussi)\
**Post date:** [22 July 2024 06:26 UTC](https://discourse.joplinapp.org/t/android-version-2-14-9-row-too-big-to-fit-into-cursorwindow/38865/7 "2024-07-22T06:26:20Z")

</div>

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)

---

<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:** [21 August 2024 06:26 UTC](https://discourse.joplinapp.org/t/android-version-2-14-9-row-too-big-to-fit-into-cursorwindow/38865/8 "2024-08-21T06:26:59Z")

</div>

Closed on 21 August 2024 06:26 UTC

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