android icon indicating copy to clipboard operation
android copied to clipboard

Couldn't read row ... Make sure the Cursor is initialized at `deleteDirectory`

Open thomedes opened this issue 5 years ago • 2 comments

Steps to reproduce

  1. Open app
  2. Enter specific folder
  3. Wait

Expected behaviour

  • Tell us what should happen Folder content should be shown OCFileListAdapter

Actual behaviour

  • Tell us what happens App stops and Android complains

Can you reproduce this problem on https://try.nextcloud.com?

  • Please create a test demo account and see if this still happens there.
  • If yes, please open up a bug report
  • If not, please verify server setup and ask for help on forum Only happens on one folder. I know it's probably something wrong on the server, but the app should not die. Desktop app has no problem syncing that folder.

Environment data

Android version:

Device model:

Stock or customized system:

Nextcloud app version:

Nextcloud server version:

Reverse proxy:

Logs

Web server error log

Insert your webserver log here

Nextcloud log (data/nextcloud.log)

Insert your Nextcloud log here

NOTE: Be super sure to remove sensitive data like passwords, note that everybody can look here! You can use the Issue Template application to prefill some of the required information: https://apps.nextcloud.com/apps/issuetemplate

************ CAUSE OF ERROR ************

java.lang.IllegalStateException: Couldn't read row 1156, col 0 from CursorWindow.  Make sure the Cursor is initialized correctly before accessing data from it.
	at android.database.CursorWindow.nativeGetLong(Native Method)
	at android.database.CursorWindow.getLong(CursorWindow.java:511)
	at android.database.AbstractWindowedCursor.getLong(AbstractWindowedCursor.java:75)
	at com.owncloud.android.providers.FileContentProvider.deleteDirectory(FileContentProvider.java:180)
	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.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.apply(ContentProviderOperation.java:299)
	at com.owncloud.android.providers.FileContentProvider.applyBatch(FileContentProvider.java:671)
	at android.content.ContentProvider$Transport.applyBatch(ContentProvider.java:319)
	at android.content.ContentProviderClient.applyBatch(ContentProviderClient.java:465)
	at android.content.ContentResolver.applyBatch(ContentResolver.java:1578)
	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:764)

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

************ DEVICE INFORMATION ************
Brand: motorola
Device: potter_n
Model: Moto G (5) Plus
Id: OPS28.85-17-6-2
Product: potter_n

************ FIRMWARE ************
SDK: 27
Release: 8.1.0
Incremental: 77e7

thomedes avatar May 18 '20 14:05 thomedes

A bit background: We currently try to delete (from database) a folder with all it subfolder and all its content via one big bulk operation. And with very large folder/many files this just crash.

E.g. moving one very very big folder from /A to /test/A is first inserting and then removing it and thus it crashes.

tobiasKaminsky avatar May 22 '20 06:05 tobiasKaminsky

That's about it. I tried to upload the whole WhatsApp folder from smartphone, 26 GiB of photos, videos and memes. Haven't count the files but many thousands. After many errors while uploading it started to crash when entering the uploads folder from the Android app. Tried erasing both cache and data. Uninstalling and installing again, etc. Every time it would consistently die. Erased that folder from the web interface and problems went away. Now the app is stable.

thomedes avatar Jun 02 '20 19:06 thomedes

Fixed in #9694

joshtrichards avatar Jan 27 '25 22:01 joshtrichards