Android: App crashes when opening folder that contains subfolder with many files

Created on 23 Apr 2020  路  4Comments  路  Source: nextcloud/android

Steps to reproduce

This is what I think happened. I haven't had the chance to try to reliably reproduce yet, but if someone wants me to, I could give it a try. Anyway, here goes:

  1. Create a folder foo and a subfolder bar inside it
  2. Create a huge number of files (4700+ in my case, doesn't have to be done on Android) in bar
  3. Open foo and bar in the Android app so it's cached.
  4. On another device (or in the web GUI), create a new subfolder in foo called baz and move bar into baz.
  5. Open foo in the Android app again, and it crashes.

*** CAUSE OF ERROR ***

android.database.sqlite.SQLiteBlobTooBigException: Row too big to fit into CursorWindow requiredPos=3157, totalRows=1560
    at android.database.sqlite.SQLiteConnection.nativeExecuteForCursorWindow(Native Method)
    at android.database.sqlite.SQLiteConnection.executeForCursorWindow(SQLiteConnection.java:942)
    at android.database.sqlite.SQLiteSession.executeForCursorWindow(SQLiteSession.java:838)
    at android.database.sqlite.SQLiteQuery.fillWindow(SQLiteQuery.java:62)
    at android.database.sqlite.SQLiteCursor.fillWindow(SQLiteCursor.java:161)
    at android.database.sqlite.SQLiteCursor.onMove(SQLiteCursor.java:131)
    at android.database.AbstractCursor.moveToPosition(AbstractCursor.java:249)
    at android.database.AbstractCursor.moveToNext(AbstractCursor.java:281)
    at com.owncloud.android.providers.FileContentProvider.deleteDirectory(FileContentProvider.java:191)
    at com.owncloud.android.providers.FileContentProvider.delete(FileContentProvider.java:135)
    at com.owncloud.android.providers.FileContentProvider.deleteDirectory(FileContentProvider.java:185)
    at com.owncloud.android.providers.FileContentProvider.delete(FileContentProvider.java:135)
    at com.owncloud.android.providers.FileContentProvider.delete(FileContentProvider.java:115)
    at android.content.ContentProviderOperation.applyInternal(ContentProviderOperation.java:342)
    at android.content.ContentProviderOperation.apply(ContentProviderOperation.java:314)
    at com.owncloud.android.providers.FileContentProvider.applyBatch(FileContentProvider.java:671)
    at android.content.ContentProvider.applyBatch(ContentProvider.java:2179)
    at android.content.ContentProvider$Transport.applyBatch(ContentProvider.java:398)
    at android.content.ContentProviderClient.applyBatch(ContentProviderClient.java:532)
    at android.content.ContentProviderClient.applyBatch(ContentProviderClient.java:520)
    at android.content.ContentResolver.applyBatch(ContentResolver.java:1915)
    at com.owncloud.android.datamodel.FileDataStorageManager.saveFolder(FileDataStorageManager.java:407)
    at com.owncloud.android.operations.RefreshFolderOperation.synchronizeData(RefreshFolderOperation.java:478)
    at com.owncloud.android.operations.RefreshFolderOperation.fetchAndSyncRemoteFolder(RefreshFolderOperation.java:369)
    at com.owncloud.android.operations.RefreshFolderOperation.run(RefreshFolderOperation.java:228)
    at com.owncloud.android.lib.common.operations.RemoteOperation.run(RemoteOperation.java:357)
    at java.lang.Thread.run(Thread.java:919)

************ APP INFORMATION ************
ID: com.nextcloud.client
Version: 30110190
Build flavor: gplay

************ DEVICE INFORMATION ************
Brand: OnePlus
Device: OnePlus8Pro
Model: IN2023
Id: QKQ1.191222.002
Product: OnePlus8Pro_EEA

************ FIRMWARE ************
SDK: 29
Release: 10
Incremental: 2004111413

Expected behaviour

The app shouldn't crash.

Actual behaviour

The app crashes over and over again when opening the foo folder.

Environment data

Android version: 10

Device model: OnePlus 8 Pro

Stock or customized system: stock

Nextcloud app version: 3.11.1

Nextcloud server version: 18.0.3

Reverse proxy: nginx

approved bug

Most helpful comment

I created now a test which fails with same error message like you have.

This fails reliable if count is >= 5000;
https://github.com/nextcloud/android/pull/5918/files#diff-7146121379c37c7fda4c6542bdd37597R63

All 4 comments

  • Clearing the cached data of the Android app didn't help.
  • After moving the files back to the original location the Android app doesn't crash any more.

Sounds like this could be similar to #5900, #5759, #5481 and possibly others. Sorry for that, I just used the link that the app gave me along with the stack trace. Feel free to close this one if you feel it's redundant.

Thanks for the clear way on how to reproduce the issue.
I will try it soon.

Thank you! Bear in mind that this happened in a real scenario and is what I think happened. If you aren't able to reproduce it yourself, I could try to artificially reproduce it myself as well.

I created now a test which fails with same error message like you have.

This fails reliable if count is >= 5000;
https://github.com/nextcloud/android/pull/5918/files#diff-7146121379c37c7fda4c6542bdd37597R63

Was this page helpful?
0 / 5 - 0 ratings

Related issues

JSoko picture JSoko  路  3Comments

JSoko picture JSoko  路  3Comments

AndyScherzinger picture AndyScherzinger  路  3Comments

daywalk3r666 picture daywalk3r666  路  3Comments

JSoko picture JSoko  路  3Comments