-
Notifications
You must be signed in to change notification settings - Fork 565
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
Database gets corrupted if the database is open while the application is updated #629
Comments
This report is a bit light on details, for example the exact exception being reported, whether you have been able to inspect a database that is supposedly in a corrupted state, what operations are running at the time the application updates, etc. In terms of initial suggestions, we would recommend updating to 4.5.4. There was a change in that version that fixed an issue where the use of an incorrect encryption key could be mistakenly reported as database corruption. If something is happening during or immediately after the update that affects the key, it is possible that a corruption exception was being thrown incorrectly. I would update to that version, and then see if the incidents of corruption reports changes (i.e. they switch to a different error). |
Hello @manabreak - disregard the note about the issue I mentioned. That was with the separate sqlcipher-android project that is now replacing android-database-sqlcipher. Can you provide the details above, te exact exception being reported, whether you have been able to inspect a database that is supposedly in a corrupted state, what operations are running at the time the application updates? |
Sorry for the lack of details, was in a hurry on Friday. That said, there's not much to work with here. The exception in Crashlytics looks like this:
Which is followed by the caused-by stack trace:
This exception is thrown when we are trying to open the database. This only happens in production, and we haven't had anyone reaching to us regarding this issue, so we haven't been able to inspect the databases. There might be any number of operations going on when the apps update since we don't have access to the production cases. The app synchronizes data to the local database quite often, and with a large-ish user base, it spikes quite heavily after each app update. |
This can happen if you are using the wrong/a different passphrase when re-opening the db. |
Good morning, I also have the same problem, @manabreak maybe it's solved? Thank you |
Expected Behavior
The database should work normally after the application is updated.
Actual Behavior
Database gets corrupted.
Steps to Reproduce
While performing database operations, update the application (e.g. automatic update via Google Play) and restart the application.
SQLCipher for Android version: 4.5.3 (with Jetpack Room 2.4.3)
Additional info
This is visible as a SQLiteException in Crashlytics, spiking every time we update our application. We perform database operations in the background once per hour, and with a large userbase, it seems that a lot of users have the background DB operations running when the app starts updating itself.
The text was updated successfully, but these errors were encountered: