Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQLiteException in firebase-crashlytics #1531

Closed
b99202021 opened this issue May 6, 2020 · 6 comments · Fixed by #1552
Closed

SQLiteException in firebase-crashlytics #1531

b99202021 opened this issue May 6, 2020 · 6 comments · Fixed by #1552
Assignees
Labels
api: core type: bug Something isn't working

Comments

@b99202021
Copy link

[REQUIRED] Step 2: Describe your environment

  • Android Studio version: 3.4.2
  • Firebase Component: firebase-crashlytics
  • Component version:
    FIREBASE_ANALYTICS = "17.4.0"
    FIREBASE_MESSAGING = "20.1.6"
    FIREBASE_CRASHLYTICS = "17.0.0"

[REQUIRED] Step 3: Describe the problem

We have a significant number of crash reports in crashlytics with SQLiteException

duplicate column name: extras (code 1 SQLITE_ERROR): , while compiling: ALTER TABLE transport_contexts ADD COLUMN extras BLOB android.database.sqlite.SQLiteConnection.nativePrepareStatement

We upgraded from Fabric Crashlytics SDK to Firebase Crashlytics SDK in March and downgrade to Fabric Crashlytics SDK. When we upgrade from Fabric Crashlytics SDK to Firebase Crashlytics SDK this week, the crash happened.

Log
Fatal Exception: android.database.sqlite.SQLiteException: duplicate column name: extras (code 1 SQLITE_ERROR): , while compiling: ALTER TABLE transport_contexts ADD COLUMN extras BLOB at android.database.sqlite.SQLiteConnection.nativePrepareStatement(SQLiteConnection.java) at android.database.sqlite.SQLiteConnection.acquirePreparedStatement(SQLiteConnection.java:903) at android.database.sqlite.SQLiteConnection.prepare(SQLiteConnection.java:514) at android.database.sqlite.SQLiteSession.prepare(SQLiteSession.java:588) at android.database.sqlite.SQLiteProgram.<init>(SQLiteProgram.java:58) at android.database.sqlite.SQLiteStatement.<init>(SQLiteStatement.java:31) at android.database.sqlite.SQLiteDatabase.executeSql(SQLiteDatabase.java:1770) at android.database.sqlite.SQLiteDatabase.execSQL(SQLiteDatabase.java:1698) at com.google.android.datatransport.runtime.scheduling.persistence.SchemaManager.lambda$static$1(SchemaManager.java:97) at com.google.android.datatransport.runtime.scheduling.persistence.SchemaManager$$Lambda$2.upgrade(SchemaManager.java) at com.google.android.datatransport.runtime.scheduling.persistence.SchemaManager.upgrade(SchemaManager.java:182) at com.google.android.datatransport.runtime.scheduling.persistence.SchemaManager.onUpgrade(SchemaManager.java:152) at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:398) at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:298) at com.google.android.datatransport.runtime.scheduling.persistence.SQLiteEventStore$$Lambda$1.produce(SQLiteEventStore.java:2) at com.google.android.datatransport.runtime.scheduling.persistence.SQLiteEventStore.retryIfDbLocked(SQLiteEventStore.java:517) at com.google.android.datatransport.runtime.scheduling.persistence.SQLiteEventStore.getDb(SQLiteEventStore.java:82) at com.google.android.datatransport.runtime.scheduling.persistence.SQLiteEventStore.runCriticalSection(SQLiteEventStore.java:549) at com.google.android.datatransport.runtime.scheduling.jobscheduling.WorkInitializer.lambda$ensureContextsScheduled$1(WorkInitializer.java:54) at com.google.android.datatransport.runtime.scheduling.jobscheduling.WorkInitializer$$Lambda$1.run(WorkInitializer.java:1054) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at java.lang.Thread.run(Thread.java:764)

Steps to reproduce:

install version with firebase crashlytics SDK-> upgrade version to one without firebase crashlytics SDK-> upgrade version to one with firebase crashlytics SDK

@google-oss-bot
Copy link
Contributor

I found a few problems with this issue:

  • I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
  • This issue does not seem to follow the issue template. Make sure you provide all the required information.

@ashwinraghav
Copy link
Contributor

@b95505017 I've not been able to repro the issue unfortunately. Just so I understand, your repro steps are

  1. Install version of test app with implementation 'com.google.firebase:firebase-crashlytics:17.0.0'.
  2. Remove implementation 'com.google.firebase:firebase-crashlytics:17.0.0' from the test app.
  3. Install test app
  4. Re introduce implementation 'com.google.firebase:firebase-crashlytics:17.0.0'
  5. Install
  6. Expect crash ?

Also, our migrations are scoped into this class. Please let us know if you see something that stands out.

@b95505017
Copy link
Contributor

@ashwinraghav Sorry you tag the wrong person 😂

@ashwinraghav
Copy link
Contributor

@ashwinraghav Sorry you tag the wrong person 😂

Sry bout that
cc @b99202021

@ashwinraghav
Copy link
Contributor

cc @b99202021 I've tried to simulate some of the failures you describe in PR #1548. While it did reveal some other backward incompatibilities, I'm yet to put a finger on what could cause this. Can you share the exact versions of firebase crash you were using before the downgrade, and after the upgrade?

@b99202021
Copy link
Author

@ashwinraghav I was using (1) firebase:firebase-crashlytics-gradle:2.0.0-beta02 (2) .firebase:firebase-analytics:17.2.3 (3) firebase-crashlytics:17.0.0-beta0 before downgrade But only some of my user are facing the crash. And I cannot reproduce the crash everytime.

@ashwinraghav ashwinraghav self-assigned this May 14, 2020
@ashwinraghav ashwinraghav linked a pull request May 18, 2020 that will close this issue
@vkryachko vkryachko removed their assignment May 19, 2020
@firebase firebase locked and limited conversation to collaborators Jun 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api: core type: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants