Error on creating database

I notice that sometime when I try to call SQLiteOpenHelper.getWriteableDatabase() I got an error but sometime I don’t. Does it have anything to do a with a password length or password format I put in getWriteableDatabase() method since the password is auto generate with special character.By the way here is the log of the error.


11-23 05:42:11.160: E/AndroidRuntime(12467): net.sqlcipher.database.SQLiteException: not an error
11-23 05:42:11.160: E/AndroidRuntime(12467):     at net.sqlcipher.database.SQLiteDatabase.dbopen(Native Method)
11-23 05:42:11.160: E/AndroidRuntime(12467):     at net.sqlcipher.database.SQLiteDatabase.(SQLiteDatabase.java:1948)
11-23 05:42:11.160: E/AndroidRuntime(12467):     at net.sqlcipher.database.SQLiteDatabase.openDatabase(SQLiteDatabase.java:881)
11-23 05:42:11.160: E/AndroidRuntime(12467):     at net.sqlcipher.database.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:913)
11-23 05:42:11.160: E/AndroidRuntime(12467):     at net.sqlcipher.database.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:132)
11-23 05:42:11.160: E/AndroidRuntime(12467):     at net.sqlcipher.database.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:99)

Hi @DarkSeeker

Is this something that you can reproduce consistently? Are you able to identify what password you are using which is causing the issue?

I don’t know if you can call it consistently but on average it happen out of every 20 time.Password which is used is “z~?Z}|Vy&Ljce8.wW}Q~@?0-B-;7X%sNZZC)P)={dy)N_SSNUEJH”. I need some kind of solution for it. The actual code which error happen on is sometime like this. I am also interested in why “net.sqlcipher.database.SQLiteException: not an error” is shown.


public void foo(String password){
net.sqlcipher.database.SQLiteDatabase encryptedDatabase=new SQLCiperDatabaseCreator(context, databaseName, null, 1, SQL)
                .getWritableDatabase(password)
}
public class SQLCiperDatabaseCreator extends
        net.sqlcipher.database.SQLiteOpenHelper {

    private String SQL;

    public SQLCiperDatabaseCreator(Context context, String name,
            net.sqlcipher.database.SQLiteDatabase.CursorFactory factory,
            int version, String SQL) {
        super(context, name, factory, version);
        // TODO Auto-generated constructor stub

        this.SQL = SQL;

    }

    @Override
    public void onCreate(net.sqlcipher.database.SQLiteDatabase encryptedDatabase) {
        // TODO Auto-generated method stub
        if (null != SQL && SQL.trim().length() > 0) {
            encryptedDatabase.execSQL(SQL);
        }
    }

    @Override
    public void onUpgrade(
            net.sqlcipher.database.SQLiteDatabase encryptedDatabase, int arg1,
            int arg2) {
        // TODO Auto-generated method stub

    }
}

Hi @DarkSeeker,

Does it occur on a specific device/emulator? It may be helpful to try
creating a single test case within the SQLCipher for Android test suite
[1] to see if you can assembly the scenario that is the cause.

[1] https://github.com/sqlcipher/sqlcipher-android-tests

Hello @developernotes,

When I remove special character in the password (change password generator code) and limit the maximum password size to “50”. Everything work fine.But I will post again if the error occur again , thanks.