Automattic / pocket-casts-android

Pocket Casts Android 🎧
https://forums.pocketcasts.com
Mozilla Public License 2.0
2.56k stars 212 forks source link

IllegalStateException: Couldn't read row 545, col 4 from CursorWindow. Make sure the Cursor is initialized correctly be... #1091

Open ashiagr opened 1 year ago

ashiagr commented 1 year ago

Description

Sentry Issue: POCKET-CASTS-ANDROID-2PN

IllegalStateException: Couldn't read row 545, col 4 from CursorWindow.  Make sure the Cursor is initialized correctly before accessing data from it.
    at android.database.CursorWindow.nativeGetLong(CursorWindow.java)
    at android.database.CursorWindow.getLong(CursorWindow.java:539)
    at android.database.AbstractWindowedCursor.getLong(AbstractWindowedCursor.java:78)
    at au.com.shiftyjelly.pocketcasts.models.db.dao.EpisodeDao_Impl$43.call(EpisodeDao_Impl.java:7086)
    at au.com.shiftyjelly.pocketcasts.models.db.dao.EpisodeDao_Impl$43.call(EpisodeDao_Impl.java:0)
...
(10 additional frame(s) were not displayed)

Zendesk: 6388780-zd-woothemes

Step-by-step reproduction instructions

Unable to reproduce so far, seems like it happens occasionally when there are new episodes in a podcast and the podcast is updated.

Screenshots or screen recording

No response

Did you search for existing bug reports?

Device, Operating system, and Pocket Casts app version

No response

ashiagr commented 1 year ago

This exception occurs while trying to fetch a primitive (long) value from the Cursor for the field size_in_bytes:

Screenshot 2023-06-16 at 12 08 53 PM

Android Cursor documentation for getLong method:

    /**
     * Returns the value of the requested column as a long.
     *
     * <p>The result and whether this method throws an exception when the
     * column value is null, the column type is not an integral type, or the
     * integer value is outside the range [<code>Long.MIN_VALUE</code>,
     * <code>Long.MAX_VALUE</code>] is implementation-defined.
     *
     * @param columnIndex the zero-based index of the target column.
     * @return the value of that column as a long.
     */
    long getLong(@IntRange(from = 0) int columnIndex);

Checked that the field is declared NOT NULL here.

rezzap commented 1 year ago

New report from the user in 6416917-zd-woothemes

Podcast it happened on: https://pca.st/podcast/3189e570-25ad-012e-057a-00163e1b201c

They mentioned it happening just before sending the new tickets to us with the logs.

I just switched to the podcast. I didn't even listen to it.

I 16/6 13:01:38 Observing podcast 3189e570-25ad-012e-057a-00163e1b201c episode changes
E 16/6 13:01:39 Fatal crash.
java.lang.IllegalStateException: Couldn't read row 661, col 4 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:539)
    at android.database.AbstractWindowedCursor.getLong(AbstractWindowedCursor.java:78)
    at da.g$i0.a(EpisodeDao_Impl.java:382)
    at da.g$i0.call(EpisodeDao_Impl.java:1)
    at go.i.u(MaybeFromCallable.java:16)
    at un.l.a(Maybe.java:15)
    at fo.n$a.onNext(FlowableFlatMapMaybe.java:37)
    at fo.y$c.c(FlowableObserveOn.java:40)
    at fo.y$a.run(FlowableObserveOn.java:18)
    at lo.d$c$a.run(ExecutorScheduler.java:11)
    at lo.d$c.run(ExecutorScheduler.java:38)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
    at java.lang.Thread.run(Thread.java:1012)

I 16/6 13:03:36 App started. 7.39.1 (9102)
I 16/6 13:03:37 Set up periodic refresh
I 16/6 13:03:37 Playback service created
I 16/6 13:04:00 Set up periodic refresh
mchowning commented 9 months ago

There are very few of these events in Sentry over the past few months, but I did see one in a recent release (7.53-rc-2), so although I think we might be able to close this, I'll leave it open to give some more time to assess how often this is happening.