# File is encrypted or is not a database: , while compiling: select count(\*) from sqlite\_master;

**URL:** <https://discuss.zetetic.net/t/file-is-encrypted-or-is-not-a-database-while-compiling-select-count-from-sqlite-master/2893>\
**Category:** SQLCipher\
**Created:** [June 7, 2018, 7:34am UTC](https://discuss.zetetic.net/t/file-is-encrypted-or-is-not-a-database-while-compiling-select-count-from-sqlite-master/2893 "2018-06-07T07:34:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![chethan\_HB](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.zetetic.net/chethan_hb/32/1089_2.png) [@chethan\_HB](https://discuss.zetetic.net/u/chethan_HB)\
**Post date:** [June 7, 2018, 7:34am UTC](https://discuss.zetetic.net/t/file-is-encrypted-or-is-not-a-database-while-compiling-select-count-from-sqlite-master/2893/1 "2018-06-07T07:34:29Z")

</div>

Dear Team,

Issue is reopened again from the filed, there are many fatal error logged from the field user device, we are not able reproduce this issue internally. it is happening for field users. added crash logs for your review. for the same crash, last time you said it is due to incorrect passphrase value. we have saved passphrase value in persistence storage in the app, there is no way that it goes with incorrect passphrase value. SQL cipher version used in the app is 3.5.4. what might have caused this issue ?

Exception java.lang.RuntimeException: Unable to create application  
net.sqlcipher.database.SQLiteException: file is encrypted or is not a database: , while compiling: select count(_) from sqlite\_master;  
android.app.ActivityThread.handleBindApplication (ActivityThread.java:5888)  
android.app.ActivityThread.-wrap3 (ActivityThread.java)  
android.app.ActivityThread$H.handleMessage (ActivityThread.java:1703)  
android.os.Handler.dispatchMessage (Handler.java:102)  
android.os.Looper.loop (Looper.java:154)  
android.app.ActivityThread.mapin (ActivityThread.java:6692)  
java.lang.reflect.Method.invoke (Method.java)  
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:1468)  
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1358)  
arrow\_drop\_down  
Caused by net.sqlcipher.database.SQLiteException: file is encrypted or is not a database: , while compiling: select count(_) from sqlite\_master;  
net.sqlcipher.database.SQLiteCompiledSql.native\_compile (SQLiteCompiledSql.java)  
net.sqlcipher.database.SQLiteCompiledSql.compile (SQLiteCompiledSql.java:91)  
net.sqlcipher.database.SQLiteCompiledSql. (SQLiteCompiledSql.java:64)  
net.sqlcipher.database.SQLiteProgram. (SQLiteProgram.java:83)  
net.sqlcipher.database.SQLiteQuery. (SQLiteQuery.java:49)  
net.sqlcipher.database.SQLiteDirectCursorDriver.query (SQLiteDirectCursorDriver.java:42)  
net.sqlcipher.database.SQLiteDatabase.rawQueryWithFactory (SQLiteDatabase.java:1787)  
net.sqlcipher.database.SQLiteDatabase.rawQuery (SQLiteDatabase.java:1752)  
net.sqlcipher.database.SQLiteDatabase.keyDatabase (SQLiteDatabase.java:2427)  
net.sqlcipher.database.SQLiteDatabase.openDatabaseInternal (SQLiteDatabase.java:2356)  
net.sqlcipher.database.SQLiteDatabase.openDatabase (SQLiteDatabase.java:1116)  
net.sqlcipher.database.SQLiteDatabase.openOrCreateDatabase (SQLiteDatabase.java:1179)  
net.sqlcipher.database.SQLiteOpenHelper.getWritableDatabase (SQLiteOpenHelper.java:162)  
net.sqlcipher.database.SQLiteOpenHelper.getWritableDatabase (SQLiteOpenHelper.java:129)

---

<div class="post-metadata">

**Author:** ![sjlombardo](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.zetetic.net/sjlombardo/32/3_2.png) [@sjlombardo](https://discuss.zetetic.net/u/sjlombardo)\
**Post date:** [June 7, 2018, 12:30pm UTC](https://discuss.zetetic.net/t/file-is-encrypted-or-is-not-a-database-while-compiling-select-count-from-sqlite-master/2893/2 "2018-06-07T12:30:34Z")

</div>

A post was merged into an existing topic: [net.sqlcipher.database.SQLiteException: file is encrypted or is not a database: , while compiling: select count(\*) from sqlite\_master;](https://discuss.zetetic.net/t/net-sqlcipher-database-sqliteexception-file-is-encrypted-or-is-not-a-database-while-compiling-select-count-from-sqlite-master/2157)

---

<div class="post-metadata">

**Author:** ![sjlombardo](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.zetetic.net/sjlombardo/32/3_2.png) [@sjlombardo](https://discuss.zetetic.net/u/sjlombardo)\
**Post date:** [June 7, 2018, 12:30pm UTC](https://discuss.zetetic.net/t/file-is-encrypted-or-is-not-a-database-while-compiling-select-count-from-sqlite-master/2893/3 "2018-06-07T12:30:34Z")

</div>


