Migrate to 4.0.1. Same Password. File is not a Database for some users

Please refer to the posts in the github thread file is not a database from JobService · Issue #429 · sqlcipher/android-database-sqlcipher · GitHub

Want to bring the conversation in here, as i can direct message in case i need to share the db file.

We have been seeing similar issues that occurs to less than 1% of our users that got migrated to 4.0.1. This is the work-flow -

  1. App upgrades to the version with sqlcipher 4.0.1
  2. Sqlcipher cipher_migrate goes through fine, DB is open & queries work.
  3. App gets killed, launched after sometime. The DB open fails with “file is not a database”
  4. Crashlytics logs confirm that the DB Password has not changed.

What could be the reasons for corruption during an upgrade ? We were thinking of a another db instance open & writing to database while the upgrade is happening - but we have enough synchronizations in place to prevent that. Any insights from you would be helpful. Thanks.

We were able to reproduce, the db password is the same as it was before migration. We tried opening in compatibility mode - that failed. Anything else you recommend to try with that database file ?

Resolved. Thanks @sjlombardo
Our DB Passwords were random, then converted to utf-8 which sometimes can contain null chars. This used to work with 3.x Sqlcipher, but 4.0.1 cipher_migrate did not like this & ended up truncating characters upto the one which was invalid. We are able to recover the migrated db by using the truncated password.