android.database.sqlite.SQLiteCantOpenDatabaseException: unable to open database file (code 14): , while compiling: PRAGMA journal_mode

Appcelerator JIRA | Rudolf Cardinal | 2 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    h4. Summary Views that load images into buttons crash unpredictably in this environment, with the following error: {noformat} E/BufferQueue( 292): [org.camcops.camcops/org.appcelerator.titanium.TiActivity] dequeueBuffer: can't dequeue multiple buffers without setting the buffer count {noformat} Subsequent attempts to open a database then crash with an exception (giving the impression of a database error): {noformat} E/SQLiteDatabase(25764): at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:347) W/System.err(25764): at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:347) E/TiExceptionHandler(25764): (main) [170,48824] ----- Titanium Javascript Runtime Error ----- E/TiExceptionHandler(25764): (main) [1,48825] - In undefined:32,32 E/TiExceptionHandler(25764): (main) [0,48825] - Message: Uncaught Error: Java Exception occurred E/TiExceptionHandler(25764): (main) [0,48825] - Source: var db = Titanium.Database.open(DBNAME), {noformat} h4. Effect App becomes useless because it appears to hang unpredictably. h4. Test code to reproduce {code:title=android_dequeuebuffer_crash.js} /*jslint node: true, plusplus: true */ "use strict"; /*global Titanium */ var DBNAME = "junk.db", PKVAL = 1, ICONSIZE = 48, IM_PR = "/images/camcops/", // image filename prefix ICON_RADIO_UNSELECTED = IM_PR + 'radio_unselected.png', ICON_RADIO_UNSELECTED_T = IM_PR + 'radio_unselected_T.png', ICON_RADIO_SELECTED = IM_PR + 'radio_selected.png', ICON_RADIO_SELECTED_T = IM_PR + 'radio_selected_T.png', view = Titanium.UI.createView({ layout: 'vertical', backgroundColor: '#FFFFFF' }), button = Titanium.UI.createButton({ width: ICONSIZE, height: ICONSIZE, touchEnabled: true, backgroundImage: ICON_RADIO_UNSELECTED, backgroundSelectedImage: ICON_RADIO_UNSELECTED_T, }), state = false, win = Titanium.UI.createWindow(); function rnd(min, max) { return Math.random() * (max - min) + min; } function standalone_execute_noreturn(query, args) { var db = Titanium.Database.open(DBNAME), cursor; if (args === undefined) { cursor = db.execute(query); } else { cursor = db.execute(query, args); } if (cursor !== null) { cursor.close(); } db.close(); } function access_db() { Titanium.API.info("access_db: start"); standalone_execute_noreturn( "UPDATE t SET value = ? WHERE pk = ?", [rnd(0, 1000), PKVAL] ); Titanium.API.info("access_db: end"); } function makedb() { standalone_execute_noreturn( "CREATE TABLE IF NOT EXISTS t (pk INTEGER, value INTEGER)" ); } function toggle_appearance() { Titanium.API.info("toggle_appearance: start"); state = !state; if (state) { button.setBackgroundImage(ICON_RADIO_SELECTED); button.setBackgroundSelectedImage(ICON_RADIO_SELECTED_T); } else { button.setBackgroundImage(ICON_RADIO_UNSELECTED); button.setBackgroundSelectedImage(ICON_RADIO_UNSELECTED_T); } Titanium.API.info("toggle_appearance: end"); } function click() { access_db(); toggle_appearance(); } makedb(); button.addEventListener("click", click); view.add(button); win.add(view); win.open(); {code} h4. Procedure to generate crash Tap the button frequently (usually crashes within first 100-200 taps or so). h4. Result if access_db() and toggle_appearance() are both called from click() Crash (screen goes blank, though remains invisibly responsive) and exception from database access: Output from {{adb logcat | grep Ti}}: {noformat} ... I/TiAPI (25764): access_db: start I/TiAPI (25764): access_db: end I/TiAPI (25764): toggle_appearance: start I/TiAPI (25764): toggle_appearance: end I/TiAPI (25764): access_db: start I/TiAPI (25764): access_db: end I/TiAPI (25764): toggle_appearance: start I/TiAPI (25764): toggle_appearance: end I/TiAPI (25764): access_db: start I/TiAPI (25764): access_db: end I/TiAPI (25764): toggle_appearance: start I/TiAPI (25764): toggle_appearance: end I/TiAPI (25764): access_db: start I/TiAPI (25764): access_db: end I/TiAPI (25764): toggle_appearance: start I/TiAPI (25764): toggle_appearance: end I/TiAPI (25764): access_db: start I/TiAPI (25764): access_db: end I/TiAPI (25764): toggle_appearance: start I/TiAPI (25764): toggle_appearance: end I/TiAPI (25764): access_db: start I/TiAPI (25764): access_db: end I/TiAPI (25764): toggle_appearance: start I/TiAPI (25764): toggle_appearance: end I/TiAPI (25764): access_db: start I/TiAPI (25764): access_db: end I/TiAPI (25764): toggle_appearance: start I/TiAPI (25764): toggle_appearance: end E/BufferQueue( 292): [org.camcops.camcops/org.appcelerator.titanium.TiActivity] dequeueBuffer: can't dequeue multiple buffers without setting the buffer count I/TiAPI (25764): access_db: start I/TiAPI (25764): access_db: end I/TiAPI (25764): toggle_appearance: start I/TiAPI (25764): toggle_appearance: end E/BufferQueue( 292): [org.camcops.camcops/org.appcelerator.titanium.TiActivity] dequeueBuffer: can't dequeue multiple buffers without setting the buffer count E/BufferQueue( 292): [org.camcops.camcops/org.appcelerator.titanium.TiActivity] dequeueBuffer: can't dequeue multiple buffers without setting the buffer count I/TiAPI (25764): access_db: start E/SQLiteDatabase(25764): at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:347) W/System.err(25764): at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:347) E/TiExceptionHandler(25764): (main) [48442,48442] ----- Titanium Javascript Runtime Error ----- E/TiExceptionHandler(25764): (main) [0,48442] - In undefined:32,32 E/TiExceptionHandler(25764): (main) [1,48443] - Message: Uncaught Error: Java Exception occurred E/TiExceptionHandler(25764): (main) [0,48443] - Source: var db = Titanium.Database.open(DBNAME), I/TiAPI (25764): access_db: start E/SQLiteDatabase(25764): at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:347) W/System.err(25764): at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:347) E/TiExceptionHandler(25764): (main) [210,48653] ----- Titanium Javascript Runtime Error ----- E/TiExceptionHandler(25764): (main) [0,48653] - In undefined:32,32 E/TiExceptionHandler(25764): (main) [0,48653] - Message: Uncaught Error: Java Exception occurred E/TiExceptionHandler(25764): (main) [1,48654] - Source: var db = Titanium.Database.open(DBNAME), I/TiAPI (25764): access_db: start E/SQLiteDatabase(25764): at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:347) W/System.err(25764): at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:347) E/TiExceptionHandler(25764): (main) [170,48824] ----- Titanium Javascript Runtime Error ----- E/TiExceptionHandler(25764): (main) [1,48825] - In undefined:32,32 E/TiExceptionHandler(25764): (main) [0,48825] - Message: Uncaught Error: Java Exception occurred E/TiExceptionHandler(25764): (main) [0,48825] - Source: var db = Titanium.Database.open(DBNAME), I/TiAPI (25764): access_db: start E/SQLiteDatabase(25764): at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:347) W/System.err(25764): at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:347) E/TiExceptionHandler(25764): (main) [3777,52602] ----- Titanium Javascript Runtime Error ----- E/TiExceptionHandler(25764): (main) [0,52602] - In undefined:32,32 E/TiExceptionHandler(25764): (main) [1,52603] - Message: Uncaught Error: Java Exception occurred E/TiExceptionHandler(25764): (main) [0,52603] - Source: var db = Titanium.Database.open(DBNAME), {noformat} Full output from {{adb logcat}}: {noformat} ... I/TiAPI (27596): access_db: start I/TiAPI (27596): access_db: end I/TiAPI (27596): toggle_appearance: start I/TiAPI (27596): toggle_appearance: end I/TiAPI (27596): access_db: start I/TiAPI (27596): access_db: end I/TiAPI (27596): toggle_appearance: start I/TiAPI (27596): toggle_appearance: end I/TiAPI (27596): access_db: start I/TiAPI (27596): access_db: end I/TiAPI (27596): toggle_appearance: start I/TiAPI (27596): toggle_appearance: end I/TiAPI (27596): access_db: start I/TiAPI (27596): access_db: end I/TiAPI (27596): toggle_appearance: start I/TiAPI (27596): toggle_appearance: end I/TiAPI (27596): access_db: start I/TiAPI (27596): access_db: end I/TiAPI (27596): toggle_appearance: start I/TiAPI (27596): toggle_appearance: end E/QcrilMsgTunnelSocket( 2769): IOException - java.io.IOException: No such file or directory Reason: No such file or directory I/TiAPI (27596): access_db: start I/TiAPI (27596): access_db: end I/TiAPI (27596): toggle_appearance: start I/TiAPI (27596): toggle_appearance: end I/TiAPI (27596): access_db: start E/SQLiteLog(27596): (14) cannot open file at line 30185 of [00bb9c9ce4] E/SQLiteLog(27596): (14) os_unix.c:30185: (24) open(/data/data/org.camcops.camcops/databases/junk.db-journal) - E/SQLiteLog(27596): (14) cannot open file at line 30185 of [00bb9c9ce4] E/SQLiteLog(27596): (14) os_unix.c:30185: (24) open(/data/data/org.camcops.camcops/databases/junk.db-journal) - E/SQLiteLog(27596): (14) unable to open database file E/SQLiteDatabase(27596): Failed to open database '/data/data/org.camcops.camcops/databases/junk.db'. E/SQLiteDatabase(27596): android.database.sqlite.SQLiteCantOpenDatabaseException: unable to open database file (code 14): , while compiling: PRAGMA journal_mode E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnection.nativePrepareStatement(Native Method) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnection.acquirePreparedStatement(SQLiteConnection.java:889) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnection.executeForString(SQLiteConnection.java:634) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnection.setJournalMode(SQLiteConnection.java:320) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnection.setWalModeFromConfiguration(SQLiteConnection.java:294) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:215) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:193) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnectionPool.openConnectionLocked(SQLiteConnectionPool.java:463) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:185) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:177) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteDatabase.openInner(SQLiteDatabase.java:804) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteDatabase.open(SQLiteDatabase.java:789) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:694) E/SQLiteDatabase(27596): at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:977) E/SQLiteDatabase(27596): at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:966) E/SQLiteDatabase(27596): at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:250) E/SQLiteDatabase(27596): at ti.modules.titanium.database.DatabaseModule.open(DatabaseModule.java:71) E/SQLiteDatabase(27596): at org.appcelerator.kroll.runtime.v8.V8Object.nativeFireEvent(Native Method) E/SQLiteDatabase(27596): at org.appcelerator.kroll.runtime.v8.V8Object.fireEvent(V8Object.java:62) E/SQLiteDatabase(27596): at org.appcelerator.kroll.KrollProxy.doFireEvent(KrollProxy.java:884) E/SQLiteDatabase(27596): at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1107) E/SQLiteDatabase(27596): at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:347) E/SQLiteDatabase(27596): at android.os.Handler.dispatchMessage(Handler.java:98) E/SQLiteDatabase(27596): at android.os.Looper.loop(Looper.java:212) E/SQLiteDatabase(27596): at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:112) W/System.err(27596): java.lang.NullPointerException W/System.err(27596): at ti.modules.titanium.database.DatabaseModule.open(DatabaseModule.java:78) W/System.err(27596): at org.appcelerator.kroll.runtime.v8.V8Object.nativeFireEvent(Native Method) W/System.err(27596): at org.appcelerator.kroll.runtime.v8.V8Object.fireEvent(V8Object.java:62) W/System.err(27596): at org.appcelerator.kroll.KrollProxy.doFireEvent(KrollProxy.java:884) W/System.err(27596): at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1107) W/System.err(27596): at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:347) W/System.err(27596): at android.os.Handler.dispatchMessage(Handler.java:98) W/System.err(27596): at android.os.Looper.loop(Looper.java:212) W/System.err(27596): at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:112) E/TiExceptionHandler(27596): (main) [36494,36494] ----- Titanium Javascript Runtime Error ----- E/TiExceptionHandler(27596): (main) [0,36494] - In undefined:32,32 E/TiExceptionHandler(27596): (main) [0,36494] - Message: Uncaught Error: Java Exception occurred E/TiExceptionHandler(27596): (main) [0,36494] - Source: var db = Titanium.Database.open(DBNAME), E/V8Exception(27596): Exception occurred at undefined:32: Uncaught Error: Java Exception occurred I/TiAPI (27596): access_db: start E/SQLiteLog(27596): (14) cannot open file at line 30185 of [00bb9c9ce4] E/SQLiteLog(27596): (14) os_unix.c:30185: (24) open(/data/data/org.camcops.camcops/databases/junk.db-journal) - E/SQLiteLog(27596): (14) cannot open file at line 30185 of [00bb9c9ce4] E/SQLiteLog(27596): (14) os_unix.c:30185: (24) open(/data/data/org.camcops.camcops/databases/junk.db-journal) - E/SQLiteLog(27596): (14) unable to open database file E/SQLiteDatabase(27596): Failed to open database '/data/data/org.camcops.camcops/databases/junk.db'. E/SQLiteDatabase(27596): android.database.sqlite.SQLiteCantOpenDatabaseException: unable to open database file (code 14): , while compiling: PRAGMA journal_mode E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnection.nativePrepareStatement(Native Method) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnection.acquirePreparedStatement(SQLiteConnection.java:889) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnection.executeForString(SQLiteConnection.java:634) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnection.setJournalMode(SQLiteConnection.java:320) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnection.setWalModeFromConfiguration(SQLiteConnection.java:294) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:215) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:193) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnectionPool.openConnectionLocked(SQLiteConnectionPool.java:463) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:185) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:177) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteDatabase.openInner(SQLiteDatabase.java:804) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteDatabase.open(SQLiteDatabase.java:789) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:694) E/SQLiteDatabase(27596): at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:977) E/SQLiteDatabase(27596): at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:966) E/SQLiteDatabase(27596): at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:250) E/SQLiteDatabase(27596): at ti.modules.titanium.database.DatabaseModule.open(DatabaseModule.java:71) E/SQLiteDatabase(27596): at org.appcelerator.kroll.runtime.v8.V8Object.nativeFireEvent(Native Method) E/SQLiteDatabase(27596): at org.appcelerator.kroll.runtime.v8.V8Object.fireEvent(V8Object.java:62) E/SQLiteDatabase(27596): at org.appcelerator.kroll.KrollProxy.doFireEvent(KrollProxy.java:884) E/SQLiteDatabase(27596): at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1107) E/SQLiteDatabase(27596): at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:347) E/SQLiteDatabase(27596): at android.os.Handler.dispatchMessage(Handler.java:98) E/SQLiteDatabase(27596): at android.os.Looper.loop(Looper.java:212) E/SQLiteDatabase(27596): at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:112) W/System.err(27596): java.lang.NullPointerException W/System.err(27596): at ti.modules.titanium.database.DatabaseModule.open(DatabaseModule.java:78) W/System.err(27596): at org.appcelerator.kroll.runtime.v8.V8Object.nativeFireEvent(Native Method) W/System.err(27596): at org.appcelerator.kroll.runtime.v8.V8Object.fireEvent(V8Object.java:62) W/System.err(27596): at org.appcelerator.kroll.KrollProxy.doFireEvent(KrollProxy.java:884) W/System.err(27596): at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1107) W/System.err(27596): at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:347) W/System.err(27596): at android.os.Handler.dispatchMessage(Handler.java:98) W/System.err(27596): at android.os.Looper.loop(Looper.java:212) W/System.err(27596): at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:112) E/TiExceptionHandler(27596): (main) [126,36620] ----- Titanium Javascript Runtime Error ----- E/TiExceptionHandler(27596): (main) [0,36620] - In undefined:32,32 E/TiExceptionHandler(27596): (main) [1,36621] - Message: Uncaught Error: Java Exception occurred E/TiExceptionHandler(27596): (main) [0,36621] - Source: var db = Titanium.Database.open(DBNAME), E/V8Exception(27596): Exception occurred at undefined:32: Uncaught Error: Java Exception occurred I/TiAPI (27596): access_db: start E/SQLiteLog(27596): (14) cannot open file at line 30185 of [00bb9c9ce4] E/SQLiteLog(27596): (14) os_unix.c:30185: (24) open(/data/data/org.camcops.camcops/databases/junk.db-journal) - E/SQLiteLog(27596): (14) cannot open file at line 30185 of [00bb9c9ce4] E/SQLiteLog(27596): (14) os_unix.c:30185: (24) open(/data/data/org.camcops.camcops/databases/junk.db-journal) - E/SQLiteLog(27596): (14) unable to open database file E/SQLiteDatabase(27596): Failed to open database '/data/data/org.camcops.camcops/databases/junk.db'. E/SQLiteDatabase(27596): android.database.sqlite.SQLiteCantOpenDatabaseException: unable to open database file (code 14): , while compiling: PRAGMA journal_mode E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnection.nativePrepareStatement(Native Method) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnection.acquirePreparedStatement(SQLiteConnection.java:889) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnection.executeForString(SQLiteConnection.java:634) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnection.setJournalMode(SQLiteConnection.java:320) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnection.setWalModeFromConfiguration(SQLiteConnection.java:294) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:215) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:193) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnectionPool.openConnectionLocked(SQLiteConnectionPool.java:463) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:185) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:177) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteDatabase.openInner(SQLiteDatabase.java:804) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteDatabase.open(SQLiteDatabase.java:789) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:694) E/SQLiteDatabase(27596): at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:977) E/SQLiteDatabase(27596): at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:966) E/SQLiteDatabase(27596): at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:250) E/SQLiteDatabase(27596): at ti.modules.titanium.database.DatabaseModule.open(DatabaseModule.java:71) E/SQLiteDatabase(27596): at org.appcelerator.kroll.runtime.v8.V8Object.nativeFireEvent(Native Method) E/SQLiteDatabase(27596): at org.appcelerator.kroll.runtime.v8.V8Object.fireEvent(V8Object.java:62) E/SQLiteDatabase(27596): at org.appcelerator.kroll.KrollProxy.doFireEvent(KrollProxy.java:884) E/SQLiteDatabase(27596): at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1107) E/SQLiteDatabase(27596): at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:347) E/SQLiteDatabase(27596): at android.os.Handler.dispatchMessage(Handler.java:98) E/SQLiteDatabase(27596): at android.os.Looper.loop(Looper.java:212) E/SQLiteDatabase(27596): at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:112) W/System.err(27596): java.lang.NullPointerException W/System.err(27596): at ti.modules.titanium.database.DatabaseModule.open(DatabaseModule.java:78) W/System.err(27596): at org.appcelerator.kroll.runtime.v8.V8Object.nativeFireEvent(Native Method) W/System.err(27596): at org.appcelerator.kroll.runtime.v8.V8Object.fireEvent(V8Object.java:62) W/System.err(27596): at org.appcelerator.kroll.KrollProxy.doFireEvent(KrollProxy.java:884) W/System.err(27596): at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1107) W/System.err(27596): at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:347) W/System.err(27596): at android.os.Handler.dispatchMessage(Handler.java:98) W/System.err(27596): at android.os.Looper.loop(Looper.java:212) W/System.err(27596): at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:112) E/TiExceptionHandler(27596): (main) [163,36784] ----- Titanium Javascript Runtime Error ----- E/TiExceptionHandler(27596): (main) [0,36784] - In undefined:32,32 E/TiExceptionHandler(27596): (main) [0,36784] - Message: Uncaught Error: Java Exception occurred E/TiExceptionHandler(27596): (main) [0,36784] - Source: var db = Titanium.Database.open(DBNAME), E/V8Exception(27596): Exception occurred at undefined:32: Uncaught Error: Java Exception occurred I/TiAPI (27596): access_db: start E/SQLiteLog(27596): (14) cannot open file at line 30185 of [00bb9c9ce4] E/SQLiteLog(27596): (14) os_unix.c:30185: (24) open(/data/data/org.camcops.camcops/databases/junk.db-journal) - E/SQLiteLog(27596): (14) cannot open file at line 30185 of [00bb9c9ce4] E/SQLiteLog(27596): (14) os_unix.c:30185: (24) open(/data/data/org.camcops.camcops/databases/junk.db-journal) - E/SQLiteLog(27596): (14) unable to open database file E/SQLiteDatabase(27596): Failed to open database '/data/data/org.camcops.camcops/databases/junk.db'. E/SQLiteDatabase(27596): android.database.sqlite.SQLiteCantOpenDatabaseException: unable to open database file (code 14): , while compiling: PRAGMA journal_mode E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnection.nativePrepareStatement(Native Method) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnection.acquirePreparedStatement(SQLiteConnection.java:889) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnection.executeForString(SQLiteConnection.java:634) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnection.setJournalMode(SQLiteConnection.java:320) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnection.setWalModeFromConfiguration(SQLiteConnection.java:294) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:215) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:193) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnectionPool.openConnectionLocked(SQLiteConnectionPool.java:463) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:185) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:177) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteDatabase.openInner(SQLiteDatabase.java:804) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteDatabase.open(SQLiteDatabase.java:789) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:694) E/SQLiteDatabase(27596): at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:977) E/SQLiteDatabase(27596): at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:966) E/SQLiteDatabase(27596): at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:250) E/SQLiteDatabase(27596): at ti.modules.titanium.database.DatabaseModule.open(DatabaseModule.java:71) E/SQLiteDatabase(27596): at org.appcelerator.kroll.runtime.v8.V8Object.nativeFireEvent(Native Method) E/SQLiteDatabase(27596): at org.appcelerator.kroll.runtime.v8.V8Object.fireEvent(V8Object.java:62) E/SQLiteDatabase(27596): at org.appcelerator.kroll.KrollProxy.doFireEvent(KrollProxy.java:884) E/SQLiteDatabase(27596): at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1107) E/SQLiteDatabase(27596): at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:347) E/SQLiteDatabase(27596): at android.os.Handler.dispatchMessage(Handler.java:98) E/SQLiteDatabase(27596): at android.os.Looper.loop(Looper.java:212) E/SQLiteDatabase(27596): at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:112) W/System.err(27596): java.lang.NullPointerException W/System.err(27596): at ti.modules.titanium.database.DatabaseModule.open(DatabaseModule.java:78) W/System.err(27596): at org.appcelerator.kroll.runtime.v8.V8Object.nativeFireEvent(Native Method) W/System.err(27596): at org.appcelerator.kroll.runtime.v8.V8Object.fireEvent(V8Object.java:62) W/System.err(27596): at org.appcelerator.kroll.KrollProxy.doFireEvent(KrollProxy.java:884) W/System.err(27596): at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1107) W/System.err(27596): at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:347) W/System.err(27596): at android.os.Handler.dispatchMessage(Handler.java:98) W/System.err(27596): at android.os.Looper.loop(Looper.java:212) W/System.err(27596): at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:112) E/TiExceptionHandler(27596): (main) [132,36916] ----- Titanium Javascript Runtime Error ----- E/TiExceptionHandler(27596): (main) [1,36917] - In undefined:32,32 E/TiExceptionHandler(27596): (main) [0,36917] - Message: Uncaught Error: Java Exception occurred E/TiExceptionHandler(27596): (main) [0,36917] - Source: var db = Titanium.Database.open(DBNAME), E/V8Exception(27596): Exception occurred at undefined:32: Uncaught Error: Java Exception occurred {noformat} h4. Result if toggle_appearance() only is called from click() Crash (screen goes blank though remains invisibly unresponsive); no Titanium exception this time (though there are underlying Android exceptions). Output from {{adb logcat | grep Ti}}: {noformat} ... I/TiAPI (26067): toggle_appearance: start I/TiAPI (26067): toggle_appearance: end I/TiAPI (26067): toggle_appearance: start I/TiAPI (26067): toggle_appearance: end I/TiAPI (26067): toggle_appearance: start I/TiAPI (26067): toggle_appearance: end I/TiAPI (26067): toggle_appearance: start I/TiAPI (26067): toggle_appearance: end I/TiAPI (26067): toggle_appearance: start I/TiAPI (26067): toggle_appearance: end I/TiAPI (26067): toggle_appearance: start I/TiAPI (26067): toggle_appearance: end I/TiAPI (26067): toggle_appearance: start I/TiAPI (26067): toggle_appearance: end I/TiAPI (26067): toggle_appearance: start I/TiAPI (26067): toggle_appearance: end I/TiAPI (26067): toggle_appearance: start I/TiAPI (26067): toggle_appearance: end I/TiAPI (26067): toggle_appearance: start I/TiAPI (26067): toggle_appearance: end I/TiAPI (26067): toggle_appearance: start I/TiAPI (26067): toggle_appearance: end I/TiAPI (26067): toggle_appearance: start I/TiAPI (26067): toggle_appearance: end I/TiAPI (26067): toggle_appearance: start I/TiAPI (26067): toggle_appearance: end I/TiAPI (26067): toggle_appearance: start I/TiAPI (26067): toggle_appearance: end E/BufferQueue( 292): [org.camcops.camcops/org.appcelerator.titanium.TiActivity] dequeueBuffer: can't dequeue multiple buffers without setting the buffer count I/TiAPI (26067): toggle_appearance: start I/TiAPI (26067): toggle_appearance: end E/BufferQueue( 292): [org.camcops.camcops/org.appcelerator.titanium.TiActivity] dequeueBuffer: can't dequeue multiple buffers without setting the buffer count E/BufferQueue( 292): [org.camcops.camcops/org.appcelerator.titanium.TiActivity] dequeueBuffer: can't dequeue multiple buffers without setting the buffer count I/TiAPI (26067): toggle_appearance: start I/TiAPI (26067): toggle_appearance: end {noformat} Full output from {{adb logcat}} (NB the message {{E/QcrilMsgTunnelSocket( 2769): IOException - java.io.IOException: No such file or directory Reason: No such file or directory}} appears spontaneously and is probably unrelated to this app): {noformat} ... I/TiAPI (28154): toggle_appearance: start I/TiAPI (28154): toggle_appearance: end I/TiAPI (28154): toggle_appearance: start I/TiAPI (28154): toggle_appearance: end I/TiAPI (28154): toggle_appearance: start I/TiAPI (28154): toggle_appearance: end I/TiAPI (28154): toggle_appearance: start I/TiAPI (28154): toggle_appearance: end I/TiAPI (28154): toggle_appearance: start I/TiAPI (28154): toggle_appearance: end I/TiAPI (28154): toggle_appearance: start I/TiAPI (28154): toggle_appearance: end I/TiAPI (28154): toggle_appearance: start I/TiAPI (28154): toggle_appearance: end I/TiAPI (28154): toggle_appearance: start I/TiAPI (28154): toggle_appearance: end D/skia (28154): ------- imageref_ashmem create failed <(null)> 36864 D/skia (28154): ------- imageref_ashmem create failed <(null)> 36864 D/skia (28154): ------- imageref_ashmem create failed <(null)> 36864 W/Adreno-EGLSUB(28154): <DequeueBuffer:606>: dequeue native buffer fail: Unknown error 2147483646, buffer=0x0, handle=0x0 E/BufferQueue( 292): [org.camcops.camcops/org.appcelerator.titanium.TiActivity] dequeueBuffer: can't dequeue multiple buffers without setting the buffer count W/Adreno-EGLSUB(28154): <DequeueBuffer:606>: dequeue native buffer fail: Invalid argument, buffer=0x0, handle=0x0 W/Adreno-EGL(28154): <qeglDrvAPI_eglSwapBuffers:3699>: EGL_BAD_SURFACE W/HardwareRenderer(28154): EGL error: EGL_BAD_SURFACE W/HardwareRenderer(28154): Mountain View, we've had a problem here. Switching back to software rendering. E/Surface (28154): dequeueBuffer: IGraphicBufferProducer::requestBuffer failed: -22 E/Surface (28154): dequeueBuffer failed (Invalid argument) E/ViewRootImpl(28154): Could not lock surface E/ViewRootImpl(28154): java.lang.IllegalArgumentException E/ViewRootImpl(28154): at android.view.Surface.nativeLockCanvas(Native Method) E/ViewRootImpl(28154): at android.view.Surface.lockCanvas(Surface.java:243) E/ViewRootImpl(28154): at android.view.ViewRootImpl.drawSoftware(ViewRootImpl.java:2435) E/ViewRootImpl(28154): at android.view.ViewRootImpl.draw(ViewRootImpl.java:2409) E/ViewRootImpl(28154): at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2253) E/ViewRootImpl(28154): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1883) E/ViewRootImpl(28154): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1000) E/ViewRootImpl(28154): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5607) E/ViewRootImpl(28154): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:761) E/ViewRootImpl(28154): at android.view.Choreographer.doCallbacks(Choreographer.java:574) E/ViewRootImpl(28154): at android.view.Choreographer.doFrame(Choreographer.java:544) E/ViewRootImpl(28154): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:747) E/ViewRootImpl(28154): at android.os.Handler.handleCallback(Handler.java:733) E/ViewRootImpl(28154): at android.os.Handler.dispatchMessage(Handler.java:95) E/ViewRootImpl(28154): at android.os.Looper.loop(Looper.java:212) E/ViewRootImpl(28154): at android.app.ActivityThread.main(ActivityThread.java:5137) E/ViewRootImpl(28154): at java.lang.reflect.Method.invokeNative(Native Method) E/ViewRootImpl(28154): at java.lang.reflect.Method.invoke(Method.java:515) E/ViewRootImpl(28154): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:902) E/ViewRootImpl(28154): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:718) E/ViewRootImpl(28154): at dalvik.system.NativeStart.main(Native Method) I/TiAPI (28154): toggle_appearance: start I/TiAPI (28154): toggle_appearance: end D/skia (28154): ------- imageref_ashmem create failed <(null)> 36864 D/skia (28154): ------- imageref_ashmem create failed <(null)> 36864 D/skia (28154): ------- imageref_ashmem create failed <(null)> 36864 D/skia (28154): ------- imageref_ashmem create failed <(null)> 36864 D/skia (28154): ------- imageref_ashmem create failed <(null)> 36864 D/skia (28154): ------- imageref_ashmem create failed <(null)> 36864 E/BufferQueue( 292): [org.camcops.camcops/org.appcelerator.titanium.TiActivity] dequeueBuffer: can't dequeue multiple buffers without setting the buffer count E/Surface (28154): dequeueBuffer failed (Invalid argument) E/ViewRootImpl(28154): Could not lock surface E/ViewRootImpl(28154): java.lang.IllegalArgumentException E/ViewRootImpl(28154): at android.view.Surface.nativeLockCanvas(Native Method) E/ViewRootImpl(28154): at android.view.Surface.lockCanvas(Surface.java:243) E/ViewRootImpl(28154): at android.view.ViewRootImpl.drawSoftware(ViewRootImpl.java:2435) E/ViewRootImpl(28154): at android.view.ViewRootImpl.draw(ViewRootImpl.java:2409) E/ViewRootImpl(28154): at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2253) E/ViewRootImpl(28154): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1883) E/ViewRootImpl(28154): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1000) E/ViewRootImpl(28154): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5607) E/ViewRootImpl(28154): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:761) E/ViewRootImpl(28154): at android.view.Choreographer.doCallbacks(Choreographer.java:574) E/ViewRootImpl(28154): at android.view.Choreographer.doFrame(Choreographer.java:544) E/ViewRootImpl(28154): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:747) E/ViewRootImpl(28154): at android.os.Handler.handleCallback(Handler.java:733) E/ViewRootImpl(28154): at android.os.Handler.dispatchMessage(Handler.java:95) E/ViewRootImpl(28154): at android.os.Looper.loop(Looper.java:212) E/ViewRootImpl(28154): at android.app.ActivityThread.main(ActivityThread.java:5137) E/ViewRootImpl(28154): at java.lang.reflect.Method.invokeNative(Native Method) E/ViewRootImpl(28154): at java.lang.reflect.Method.invoke(Method.java:515) E/ViewRootImpl(28154): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:902) E/ViewRootImpl(28154): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:718) E/ViewRootImpl(28154): at dalvik.system.NativeStart.main(Native Method) E/BufferQueue( 292): [org.camcops.camcops/org.appcelerator.titanium.TiActivity] dequeueBuffer: can't dequeue multiple buffers without setting the buffer count E/Surface (28154): dequeueBuffer failed (Invalid argument) E/ViewRootImpl(28154): Could not lock surface E/ViewRootImpl(28154): java.lang.IllegalArgumentException E/ViewRootImpl(28154): at android.view.Surface.nativeLockCanvas(Native Method) E/ViewRootImpl(28154): at android.view.Surface.lockCanvas(Surface.java:243) E/ViewRootImpl(28154): at android.view.ViewRootImpl.drawSoftware(ViewRootImpl.java:2435) E/ViewRootImpl(28154): at android.view.ViewRootImpl.draw(ViewRootImpl.java:2409) E/ViewRootImpl(28154): at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2253) E/ViewRootImpl(28154): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1883) E/ViewRootImpl(28154): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1000) E/ViewRootImpl(28154): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5607) E/ViewRootImpl(28154): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:761) E/ViewRootImpl(28154): at android.view.Choreographer.doCallbacks(Choreographer.java:574) E/ViewRootImpl(28154): at android.view.Choreographer.doFrame(Choreographer.java:544) E/ViewRootImpl(28154): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:747) E/ViewRootImpl(28154): at android.os.Handler.handleCallback(Handler.java:733) E/ViewRootImpl(28154): at android.os.Handler.dispatchMessage(Handler.java:95) E/ViewRootImpl(28154): at android.os.Looper.loop(Looper.java:212) E/ViewRootImpl(28154): at android.app.ActivityThread.main(ActivityThread.java:5137) E/ViewRootImpl(28154): at java.lang.reflect.Method.invokeNative(Native Method) E/ViewRootImpl(28154): at java.lang.reflect.Method.invoke(Method.java:515) E/ViewRootImpl(28154): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:902) E/ViewRootImpl(28154): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:718) E/ViewRootImpl(28154): at dalvik.system.NativeStart.main(Native Method) I/TiAPI (28154): toggle_appearance: start I/TiAPI (28154): toggle_appearance: end D/skia (28154): ------- imageref_ashmem create failed <(null)> 36864 D/skia (28154): ------- imageref_ashmem create failed <(null)> 36864 D/skia (28154): ------- imageref_ashmem create failed <(null)> 36864 D/skia (28154): ------- imageref_ashmem create failed <(null)> 36864 D/skia (28154): ------- imageref_ashmem create failed <(null)> 36864 D/skia (28154): ------- imageref_ashmem create failed <(null)> 36864 D/skia (28154): ------- imageref_ashmem create failed <(null)> 36864 D/skia (28154): ------- imageref_ashmem create failed <(null)> 36864 {noformat} h4. Result if access_db() only is called from click() Haven't managed to get a crash out of this (nor by calling {{access_db()}} 10,000 times consecutively). h4. Plausible fixes that didn't help Setting {{<application android:hardwareAccelerated="false">}} in {{tiapp.xml}} made no difference. h4. Theories Possible sequence (I have no idea if this is the case): # File handle leak # -> Crash in Android display code # -> Crash in other file access (e.g. database opening) operations? h4. Possible related Android bugs [https://code.google.com/p/android/issues/detail?id=63738] [https://code.google.com/p/android/issues/detail?id=71742]

    Appcelerator JIRA | 2 years ago | Rudolf Cardinal
    android.database.sqlite.SQLiteCantOpenDatabaseException: unable to open database file (code 14): , while compiling: PRAGMA journal_mode
  2. 0

    h4. Summary Views that load images into buttons crash unpredictably in this environment, with the following error: {noformat} E/BufferQueue( 292): [org.camcops.camcops/org.appcelerator.titanium.TiActivity] dequeueBuffer: can't dequeue multiple buffers without setting the buffer count {noformat} Subsequent attempts to open a database then crash with an exception (giving the impression of a database error): {noformat} E/SQLiteDatabase(25764): at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:347) W/System.err(25764): at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:347) E/TiExceptionHandler(25764): (main) [170,48824] ----- Titanium Javascript Runtime Error ----- E/TiExceptionHandler(25764): (main) [1,48825] - In undefined:32,32 E/TiExceptionHandler(25764): (main) [0,48825] - Message: Uncaught Error: Java Exception occurred E/TiExceptionHandler(25764): (main) [0,48825] - Source: var db = Titanium.Database.open(DBNAME), {noformat} h4. Effect App becomes useless because it appears to hang unpredictably. h4. Test code to reproduce {code:title=android_dequeuebuffer_crash.js} /*jslint node: true, plusplus: true */ "use strict"; /*global Titanium */ var DBNAME = "junk.db", PKVAL = 1, ICONSIZE = 48, IM_PR = "/images/camcops/", // image filename prefix ICON_RADIO_UNSELECTED = IM_PR + 'radio_unselected.png', ICON_RADIO_UNSELECTED_T = IM_PR + 'radio_unselected_T.png', ICON_RADIO_SELECTED = IM_PR + 'radio_selected.png', ICON_RADIO_SELECTED_T = IM_PR + 'radio_selected_T.png', view = Titanium.UI.createView({ layout: 'vertical', backgroundColor: '#FFFFFF' }), button = Titanium.UI.createButton({ width: ICONSIZE, height: ICONSIZE, touchEnabled: true, backgroundImage: ICON_RADIO_UNSELECTED, backgroundSelectedImage: ICON_RADIO_UNSELECTED_T, }), state = false, win = Titanium.UI.createWindow(); function rnd(min, max) { return Math.random() * (max - min) + min; } function standalone_execute_noreturn(query, args) { var db = Titanium.Database.open(DBNAME), cursor; if (args === undefined) { cursor = db.execute(query); } else { cursor = db.execute(query, args); } if (cursor !== null) { cursor.close(); } db.close(); } function access_db() { Titanium.API.info("access_db: start"); standalone_execute_noreturn( "UPDATE t SET value = ? WHERE pk = ?", [rnd(0, 1000), PKVAL] ); Titanium.API.info("access_db: end"); } function makedb() { standalone_execute_noreturn( "CREATE TABLE IF NOT EXISTS t (pk INTEGER, value INTEGER)" ); } function toggle_appearance() { Titanium.API.info("toggle_appearance: start"); state = !state; if (state) { button.setBackgroundImage(ICON_RADIO_SELECTED); button.setBackgroundSelectedImage(ICON_RADIO_SELECTED_T); } else { button.setBackgroundImage(ICON_RADIO_UNSELECTED); button.setBackgroundSelectedImage(ICON_RADIO_UNSELECTED_T); } Titanium.API.info("toggle_appearance: end"); } function click() { access_db(); toggle_appearance(); } makedb(); button.addEventListener("click", click); view.add(button); win.add(view); win.open(); {code} h4. Procedure to generate crash Tap the button frequently (usually crashes within first 100-200 taps or so). h4. Result if access_db() and toggle_appearance() are both called from click() Crash (screen goes blank, though remains invisibly responsive) and exception from database access: Output from {{adb logcat | grep Ti}}: {noformat} ... I/TiAPI (25764): access_db: start I/TiAPI (25764): access_db: end I/TiAPI (25764): toggle_appearance: start I/TiAPI (25764): toggle_appearance: end I/TiAPI (25764): access_db: start I/TiAPI (25764): access_db: end I/TiAPI (25764): toggle_appearance: start I/TiAPI (25764): toggle_appearance: end I/TiAPI (25764): access_db: start I/TiAPI (25764): access_db: end I/TiAPI (25764): toggle_appearance: start I/TiAPI (25764): toggle_appearance: end I/TiAPI (25764): access_db: start I/TiAPI (25764): access_db: end I/TiAPI (25764): toggle_appearance: start I/TiAPI (25764): toggle_appearance: end I/TiAPI (25764): access_db: start I/TiAPI (25764): access_db: end I/TiAPI (25764): toggle_appearance: start I/TiAPI (25764): toggle_appearance: end I/TiAPI (25764): access_db: start I/TiAPI (25764): access_db: end I/TiAPI (25764): toggle_appearance: start I/TiAPI (25764): toggle_appearance: end I/TiAPI (25764): access_db: start I/TiAPI (25764): access_db: end I/TiAPI (25764): toggle_appearance: start I/TiAPI (25764): toggle_appearance: end E/BufferQueue( 292): [org.camcops.camcops/org.appcelerator.titanium.TiActivity] dequeueBuffer: can't dequeue multiple buffers without setting the buffer count I/TiAPI (25764): access_db: start I/TiAPI (25764): access_db: end I/TiAPI (25764): toggle_appearance: start I/TiAPI (25764): toggle_appearance: end E/BufferQueue( 292): [org.camcops.camcops/org.appcelerator.titanium.TiActivity] dequeueBuffer: can't dequeue multiple buffers without setting the buffer count E/BufferQueue( 292): [org.camcops.camcops/org.appcelerator.titanium.TiActivity] dequeueBuffer: can't dequeue multiple buffers without setting the buffer count I/TiAPI (25764): access_db: start E/SQLiteDatabase(25764): at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:347) W/System.err(25764): at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:347) E/TiExceptionHandler(25764): (main) [48442,48442] ----- Titanium Javascript Runtime Error ----- E/TiExceptionHandler(25764): (main) [0,48442] - In undefined:32,32 E/TiExceptionHandler(25764): (main) [1,48443] - Message: Uncaught Error: Java Exception occurred E/TiExceptionHandler(25764): (main) [0,48443] - Source: var db = Titanium.Database.open(DBNAME), I/TiAPI (25764): access_db: start E/SQLiteDatabase(25764): at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:347) W/System.err(25764): at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:347) E/TiExceptionHandler(25764): (main) [210,48653] ----- Titanium Javascript Runtime Error ----- E/TiExceptionHandler(25764): (main) [0,48653] - In undefined:32,32 E/TiExceptionHandler(25764): (main) [0,48653] - Message: Uncaught Error: Java Exception occurred E/TiExceptionHandler(25764): (main) [1,48654] - Source: var db = Titanium.Database.open(DBNAME), I/TiAPI (25764): access_db: start E/SQLiteDatabase(25764): at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:347) W/System.err(25764): at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:347) E/TiExceptionHandler(25764): (main) [170,48824] ----- Titanium Javascript Runtime Error ----- E/TiExceptionHandler(25764): (main) [1,48825] - In undefined:32,32 E/TiExceptionHandler(25764): (main) [0,48825] - Message: Uncaught Error: Java Exception occurred E/TiExceptionHandler(25764): (main) [0,48825] - Source: var db = Titanium.Database.open(DBNAME), I/TiAPI (25764): access_db: start E/SQLiteDatabase(25764): at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:347) W/System.err(25764): at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:347) E/TiExceptionHandler(25764): (main) [3777,52602] ----- Titanium Javascript Runtime Error ----- E/TiExceptionHandler(25764): (main) [0,52602] - In undefined:32,32 E/TiExceptionHandler(25764): (main) [1,52603] - Message: Uncaught Error: Java Exception occurred E/TiExceptionHandler(25764): (main) [0,52603] - Source: var db = Titanium.Database.open(DBNAME), {noformat} Full output from {{adb logcat}}: {noformat} ... I/TiAPI (27596): access_db: start I/TiAPI (27596): access_db: end I/TiAPI (27596): toggle_appearance: start I/TiAPI (27596): toggle_appearance: end I/TiAPI (27596): access_db: start I/TiAPI (27596): access_db: end I/TiAPI (27596): toggle_appearance: start I/TiAPI (27596): toggle_appearance: end I/TiAPI (27596): access_db: start I/TiAPI (27596): access_db: end I/TiAPI (27596): toggle_appearance: start I/TiAPI (27596): toggle_appearance: end I/TiAPI (27596): access_db: start I/TiAPI (27596): access_db: end I/TiAPI (27596): toggle_appearance: start I/TiAPI (27596): toggle_appearance: end I/TiAPI (27596): access_db: start I/TiAPI (27596): access_db: end I/TiAPI (27596): toggle_appearance: start I/TiAPI (27596): toggle_appearance: end E/QcrilMsgTunnelSocket( 2769): IOException - java.io.IOException: No such file or directory Reason: No such file or directory I/TiAPI (27596): access_db: start I/TiAPI (27596): access_db: end I/TiAPI (27596): toggle_appearance: start I/TiAPI (27596): toggle_appearance: end I/TiAPI (27596): access_db: start E/SQLiteLog(27596): (14) cannot open file at line 30185 of [00bb9c9ce4] E/SQLiteLog(27596): (14) os_unix.c:30185: (24) open(/data/data/org.camcops.camcops/databases/junk.db-journal) - E/SQLiteLog(27596): (14) cannot open file at line 30185 of [00bb9c9ce4] E/SQLiteLog(27596): (14) os_unix.c:30185: (24) open(/data/data/org.camcops.camcops/databases/junk.db-journal) - E/SQLiteLog(27596): (14) unable to open database file E/SQLiteDatabase(27596): Failed to open database '/data/data/org.camcops.camcops/databases/junk.db'. E/SQLiteDatabase(27596): android.database.sqlite.SQLiteCantOpenDatabaseException: unable to open database file (code 14): , while compiling: PRAGMA journal_mode E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnection.nativePrepareStatement(Native Method) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnection.acquirePreparedStatement(SQLiteConnection.java:889) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnection.executeForString(SQLiteConnection.java:634) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnection.setJournalMode(SQLiteConnection.java:320) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnection.setWalModeFromConfiguration(SQLiteConnection.java:294) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:215) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:193) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnectionPool.openConnectionLocked(SQLiteConnectionPool.java:463) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:185) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:177) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteDatabase.openInner(SQLiteDatabase.java:804) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteDatabase.open(SQLiteDatabase.java:789) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:694) E/SQLiteDatabase(27596): at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:977) E/SQLiteDatabase(27596): at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:966) E/SQLiteDatabase(27596): at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:250) E/SQLiteDatabase(27596): at ti.modules.titanium.database.DatabaseModule.open(DatabaseModule.java:71) E/SQLiteDatabase(27596): at org.appcelerator.kroll.runtime.v8.V8Object.nativeFireEvent(Native Method) E/SQLiteDatabase(27596): at org.appcelerator.kroll.runtime.v8.V8Object.fireEvent(V8Object.java:62) E/SQLiteDatabase(27596): at org.appcelerator.kroll.KrollProxy.doFireEvent(KrollProxy.java:884) E/SQLiteDatabase(27596): at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1107) E/SQLiteDatabase(27596): at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:347) E/SQLiteDatabase(27596): at android.os.Handler.dispatchMessage(Handler.java:98) E/SQLiteDatabase(27596): at android.os.Looper.loop(Looper.java:212) E/SQLiteDatabase(27596): at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:112) W/System.err(27596): java.lang.NullPointerException W/System.err(27596): at ti.modules.titanium.database.DatabaseModule.open(DatabaseModule.java:78) W/System.err(27596): at org.appcelerator.kroll.runtime.v8.V8Object.nativeFireEvent(Native Method) W/System.err(27596): at org.appcelerator.kroll.runtime.v8.V8Object.fireEvent(V8Object.java:62) W/System.err(27596): at org.appcelerator.kroll.KrollProxy.doFireEvent(KrollProxy.java:884) W/System.err(27596): at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1107) W/System.err(27596): at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:347) W/System.err(27596): at android.os.Handler.dispatchMessage(Handler.java:98) W/System.err(27596): at android.os.Looper.loop(Looper.java:212) W/System.err(27596): at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:112) E/TiExceptionHandler(27596): (main) [36494,36494] ----- Titanium Javascript Runtime Error ----- E/TiExceptionHandler(27596): (main) [0,36494] - In undefined:32,32 E/TiExceptionHandler(27596): (main) [0,36494] - Message: Uncaught Error: Java Exception occurred E/TiExceptionHandler(27596): (main) [0,36494] - Source: var db = Titanium.Database.open(DBNAME), E/V8Exception(27596): Exception occurred at undefined:32: Uncaught Error: Java Exception occurred I/TiAPI (27596): access_db: start E/SQLiteLog(27596): (14) cannot open file at line 30185 of [00bb9c9ce4] E/SQLiteLog(27596): (14) os_unix.c:30185: (24) open(/data/data/org.camcops.camcops/databases/junk.db-journal) - E/SQLiteLog(27596): (14) cannot open file at line 30185 of [00bb9c9ce4] E/SQLiteLog(27596): (14) os_unix.c:30185: (24) open(/data/data/org.camcops.camcops/databases/junk.db-journal) - E/SQLiteLog(27596): (14) unable to open database file E/SQLiteDatabase(27596): Failed to open database '/data/data/org.camcops.camcops/databases/junk.db'. E/SQLiteDatabase(27596): android.database.sqlite.SQLiteCantOpenDatabaseException: unable to open database file (code 14): , while compiling: PRAGMA journal_mode E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnection.nativePrepareStatement(Native Method) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnection.acquirePreparedStatement(SQLiteConnection.java:889) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnection.executeForString(SQLiteConnection.java:634) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnection.setJournalMode(SQLiteConnection.java:320) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnection.setWalModeFromConfiguration(SQLiteConnection.java:294) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:215) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:193) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnectionPool.openConnectionLocked(SQLiteConnectionPool.java:463) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:185) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:177) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteDatabase.openInner(SQLiteDatabase.java:804) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteDatabase.open(SQLiteDatabase.java:789) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:694) E/SQLiteDatabase(27596): at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:977) E/SQLiteDatabase(27596): at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:966) E/SQLiteDatabase(27596): at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:250) E/SQLiteDatabase(27596): at ti.modules.titanium.database.DatabaseModule.open(DatabaseModule.java:71) E/SQLiteDatabase(27596): at org.appcelerator.kroll.runtime.v8.V8Object.nativeFireEvent(Native Method) E/SQLiteDatabase(27596): at org.appcelerator.kroll.runtime.v8.V8Object.fireEvent(V8Object.java:62) E/SQLiteDatabase(27596): at org.appcelerator.kroll.KrollProxy.doFireEvent(KrollProxy.java:884) E/SQLiteDatabase(27596): at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1107) E/SQLiteDatabase(27596): at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:347) E/SQLiteDatabase(27596): at android.os.Handler.dispatchMessage(Handler.java:98) E/SQLiteDatabase(27596): at android.os.Looper.loop(Looper.java:212) E/SQLiteDatabase(27596): at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:112) W/System.err(27596): java.lang.NullPointerException W/System.err(27596): at ti.modules.titanium.database.DatabaseModule.open(DatabaseModule.java:78) W/System.err(27596): at org.appcelerator.kroll.runtime.v8.V8Object.nativeFireEvent(Native Method) W/System.err(27596): at org.appcelerator.kroll.runtime.v8.V8Object.fireEvent(V8Object.java:62) W/System.err(27596): at org.appcelerator.kroll.KrollProxy.doFireEvent(KrollProxy.java:884) W/System.err(27596): at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1107) W/System.err(27596): at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:347) W/System.err(27596): at android.os.Handler.dispatchMessage(Handler.java:98) W/System.err(27596): at android.os.Looper.loop(Looper.java:212) W/System.err(27596): at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:112) E/TiExceptionHandler(27596): (main) [126,36620] ----- Titanium Javascript Runtime Error ----- E/TiExceptionHandler(27596): (main) [0,36620] - In undefined:32,32 E/TiExceptionHandler(27596): (main) [1,36621] - Message: Uncaught Error: Java Exception occurred E/TiExceptionHandler(27596): (main) [0,36621] - Source: var db = Titanium.Database.open(DBNAME), E/V8Exception(27596): Exception occurred at undefined:32: Uncaught Error: Java Exception occurred I/TiAPI (27596): access_db: start E/SQLiteLog(27596): (14) cannot open file at line 30185 of [00bb9c9ce4] E/SQLiteLog(27596): (14) os_unix.c:30185: (24) open(/data/data/org.camcops.camcops/databases/junk.db-journal) - E/SQLiteLog(27596): (14) cannot open file at line 30185 of [00bb9c9ce4] E/SQLiteLog(27596): (14) os_unix.c:30185: (24) open(/data/data/org.camcops.camcops/databases/junk.db-journal) - E/SQLiteLog(27596): (14) unable to open database file E/SQLiteDatabase(27596): Failed to open database '/data/data/org.camcops.camcops/databases/junk.db'. E/SQLiteDatabase(27596): android.database.sqlite.SQLiteCantOpenDatabaseException: unable to open database file (code 14): , while compiling: PRAGMA journal_mode E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnection.nativePrepareStatement(Native Method) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnection.acquirePreparedStatement(SQLiteConnection.java:889) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnection.executeForString(SQLiteConnection.java:634) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnection.setJournalMode(SQLiteConnection.java:320) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnection.setWalModeFromConfiguration(SQLiteConnection.java:294) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:215) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:193) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnectionPool.openConnectionLocked(SQLiteConnectionPool.java:463) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:185) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:177) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteDatabase.openInner(SQLiteDatabase.java:804) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteDatabase.open(SQLiteDatabase.java:789) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:694) E/SQLiteDatabase(27596): at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:977) E/SQLiteDatabase(27596): at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:966) E/SQLiteDatabase(27596): at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:250) E/SQLiteDatabase(27596): at ti.modules.titanium.database.DatabaseModule.open(DatabaseModule.java:71) E/SQLiteDatabase(27596): at org.appcelerator.kroll.runtime.v8.V8Object.nativeFireEvent(Native Method) E/SQLiteDatabase(27596): at org.appcelerator.kroll.runtime.v8.V8Object.fireEvent(V8Object.java:62) E/SQLiteDatabase(27596): at org.appcelerator.kroll.KrollProxy.doFireEvent(KrollProxy.java:884) E/SQLiteDatabase(27596): at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1107) E/SQLiteDatabase(27596): at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:347) E/SQLiteDatabase(27596): at android.os.Handler.dispatchMessage(Handler.java:98) E/SQLiteDatabase(27596): at android.os.Looper.loop(Looper.java:212) E/SQLiteDatabase(27596): at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:112) W/System.err(27596): java.lang.NullPointerException W/System.err(27596): at ti.modules.titanium.database.DatabaseModule.open(DatabaseModule.java:78) W/System.err(27596): at org.appcelerator.kroll.runtime.v8.V8Object.nativeFireEvent(Native Method) W/System.err(27596): at org.appcelerator.kroll.runtime.v8.V8Object.fireEvent(V8Object.java:62) W/System.err(27596): at org.appcelerator.kroll.KrollProxy.doFireEvent(KrollProxy.java:884) W/System.err(27596): at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1107) W/System.err(27596): at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:347) W/System.err(27596): at android.os.Handler.dispatchMessage(Handler.java:98) W/System.err(27596): at android.os.Looper.loop(Looper.java:212) W/System.err(27596): at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:112) E/TiExceptionHandler(27596): (main) [163,36784] ----- Titanium Javascript Runtime Error ----- E/TiExceptionHandler(27596): (main) [0,36784] - In undefined:32,32 E/TiExceptionHandler(27596): (main) [0,36784] - Message: Uncaught Error: Java Exception occurred E/TiExceptionHandler(27596): (main) [0,36784] - Source: var db = Titanium.Database.open(DBNAME), E/V8Exception(27596): Exception occurred at undefined:32: Uncaught Error: Java Exception occurred I/TiAPI (27596): access_db: start E/SQLiteLog(27596): (14) cannot open file at line 30185 of [00bb9c9ce4] E/SQLiteLog(27596): (14) os_unix.c:30185: (24) open(/data/data/org.camcops.camcops/databases/junk.db-journal) - E/SQLiteLog(27596): (14) cannot open file at line 30185 of [00bb9c9ce4] E/SQLiteLog(27596): (14) os_unix.c:30185: (24) open(/data/data/org.camcops.camcops/databases/junk.db-journal) - E/SQLiteLog(27596): (14) unable to open database file E/SQLiteDatabase(27596): Failed to open database '/data/data/org.camcops.camcops/databases/junk.db'. E/SQLiteDatabase(27596): android.database.sqlite.SQLiteCantOpenDatabaseException: unable to open database file (code 14): , while compiling: PRAGMA journal_mode E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnection.nativePrepareStatement(Native Method) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnection.acquirePreparedStatement(SQLiteConnection.java:889) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnection.executeForString(SQLiteConnection.java:634) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnection.setJournalMode(SQLiteConnection.java:320) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnection.setWalModeFromConfiguration(SQLiteConnection.java:294) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:215) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:193) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnectionPool.openConnectionLocked(SQLiteConnectionPool.java:463) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:185) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:177) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteDatabase.openInner(SQLiteDatabase.java:804) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteDatabase.open(SQLiteDatabase.java:789) E/SQLiteDatabase(27596): at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:694) E/SQLiteDatabase(27596): at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:977) E/SQLiteDatabase(27596): at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:966) E/SQLiteDatabase(27596): at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:250) E/SQLiteDatabase(27596): at ti.modules.titanium.database.DatabaseModule.open(DatabaseModule.java:71) E/SQLiteDatabase(27596): at org.appcelerator.kroll.runtime.v8.V8Object.nativeFireEvent(Native Method) E/SQLiteDatabase(27596): at org.appcelerator.kroll.runtime.v8.V8Object.fireEvent(V8Object.java:62) E/SQLiteDatabase(27596): at org.appcelerator.kroll.KrollProxy.doFireEvent(KrollProxy.java:884) E/SQLiteDatabase(27596): at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1107) E/SQLiteDatabase(27596): at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:347) E/SQLiteDatabase(27596): at android.os.Handler.dispatchMessage(Handler.java:98) E/SQLiteDatabase(27596): at android.os.Looper.loop(Looper.java:212) E/SQLiteDatabase(27596): at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:112) W/System.err(27596): java.lang.NullPointerException W/System.err(27596): at ti.modules.titanium.database.DatabaseModule.open(DatabaseModule.java:78) W/System.err(27596): at org.appcelerator.kroll.runtime.v8.V8Object.nativeFireEvent(Native Method) W/System.err(27596): at org.appcelerator.kroll.runtime.v8.V8Object.fireEvent(V8Object.java:62) W/System.err(27596): at org.appcelerator.kroll.KrollProxy.doFireEvent(KrollProxy.java:884) W/System.err(27596): at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1107) W/System.err(27596): at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:347) W/System.err(27596): at android.os.Handler.dispatchMessage(Handler.java:98) W/System.err(27596): at android.os.Looper.loop(Looper.java:212) W/System.err(27596): at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:112) E/TiExceptionHandler(27596): (main) [132,36916] ----- Titanium Javascript Runtime Error ----- E/TiExceptionHandler(27596): (main) [1,36917] - In undefined:32,32 E/TiExceptionHandler(27596): (main) [0,36917] - Message: Uncaught Error: Java Exception occurred E/TiExceptionHandler(27596): (main) [0,36917] - Source: var db = Titanium.Database.open(DBNAME), E/V8Exception(27596): Exception occurred at undefined:32: Uncaught Error: Java Exception occurred {noformat} h4. Result if toggle_appearance() only is called from click() Crash (screen goes blank though remains invisibly unresponsive); no Titanium exception this time (though there are underlying Android exceptions). Output from {{adb logcat | grep Ti}}: {noformat} ... I/TiAPI (26067): toggle_appearance: start I/TiAPI (26067): toggle_appearance: end I/TiAPI (26067): toggle_appearance: start I/TiAPI (26067): toggle_appearance: end I/TiAPI (26067): toggle_appearance: start I/TiAPI (26067): toggle_appearance: end I/TiAPI (26067): toggle_appearance: start I/TiAPI (26067): toggle_appearance: end I/TiAPI (26067): toggle_appearance: start I/TiAPI (26067): toggle_appearance: end I/TiAPI (26067): toggle_appearance: start I/TiAPI (26067): toggle_appearance: end I/TiAPI (26067): toggle_appearance: start I/TiAPI (26067): toggle_appearance: end I/TiAPI (26067): toggle_appearance: start I/TiAPI (26067): toggle_appearance: end I/TiAPI (26067): toggle_appearance: start I/TiAPI (26067): toggle_appearance: end I/TiAPI (26067): toggle_appearance: start I/TiAPI (26067): toggle_appearance: end I/TiAPI (26067): toggle_appearance: start I/TiAPI (26067): toggle_appearance: end I/TiAPI (26067): toggle_appearance: start I/TiAPI (26067): toggle_appearance: end I/TiAPI (26067): toggle_appearance: start I/TiAPI (26067): toggle_appearance: end I/TiAPI (26067): toggle_appearance: start I/TiAPI (26067): toggle_appearance: end E/BufferQueue( 292): [org.camcops.camcops/org.appcelerator.titanium.TiActivity] dequeueBuffer: can't dequeue multiple buffers without setting the buffer count I/TiAPI (26067): toggle_appearance: start I/TiAPI (26067): toggle_appearance: end E/BufferQueue( 292): [org.camcops.camcops/org.appcelerator.titanium.TiActivity] dequeueBuffer: can't dequeue multiple buffers without setting the buffer count E/BufferQueue( 292): [org.camcops.camcops/org.appcelerator.titanium.TiActivity] dequeueBuffer: can't dequeue multiple buffers without setting the buffer count I/TiAPI (26067): toggle_appearance: start I/TiAPI (26067): toggle_appearance: end {noformat} Full output from {{adb logcat}} (NB the message {{E/QcrilMsgTunnelSocket( 2769): IOException - java.io.IOException: No such file or directory Reason: No such file or directory}} appears spontaneously and is probably unrelated to this app): {noformat} ... I/TiAPI (28154): toggle_appearance: start I/TiAPI (28154): toggle_appearance: end I/TiAPI (28154): toggle_appearance: start I/TiAPI (28154): toggle_appearance: end I/TiAPI (28154): toggle_appearance: start I/TiAPI (28154): toggle_appearance: end I/TiAPI (28154): toggle_appearance: start I/TiAPI (28154): toggle_appearance: end I/TiAPI (28154): toggle_appearance: start I/TiAPI (28154): toggle_appearance: end I/TiAPI (28154): toggle_appearance: start I/TiAPI (28154): toggle_appearance: end I/TiAPI (28154): toggle_appearance: start I/TiAPI (28154): toggle_appearance: end I/TiAPI (28154): toggle_appearance: start I/TiAPI (28154): toggle_appearance: end D/skia (28154): ------- imageref_ashmem create failed <(null)> 36864 D/skia (28154): ------- imageref_ashmem create failed <(null)> 36864 D/skia (28154): ------- imageref_ashmem create failed <(null)> 36864 W/Adreno-EGLSUB(28154): <DequeueBuffer:606>: dequeue native buffer fail: Unknown error 2147483646, buffer=0x0, handle=0x0 E/BufferQueue( 292): [org.camcops.camcops/org.appcelerator.titanium.TiActivity] dequeueBuffer: can't dequeue multiple buffers without setting the buffer count W/Adreno-EGLSUB(28154): <DequeueBuffer:606>: dequeue native buffer fail: Invalid argument, buffer=0x0, handle=0x0 W/Adreno-EGL(28154): <qeglDrvAPI_eglSwapBuffers:3699>: EGL_BAD_SURFACE W/HardwareRenderer(28154): EGL error: EGL_BAD_SURFACE W/HardwareRenderer(28154): Mountain View, we've had a problem here. Switching back to software rendering. E/Surface (28154): dequeueBuffer: IGraphicBufferProducer::requestBuffer failed: -22 E/Surface (28154): dequeueBuffer failed (Invalid argument) E/ViewRootImpl(28154): Could not lock surface E/ViewRootImpl(28154): java.lang.IllegalArgumentException E/ViewRootImpl(28154): at android.view.Surface.nativeLockCanvas(Native Method) E/ViewRootImpl(28154): at android.view.Surface.lockCanvas(Surface.java:243) E/ViewRootImpl(28154): at android.view.ViewRootImpl.drawSoftware(ViewRootImpl.java:2435) E/ViewRootImpl(28154): at android.view.ViewRootImpl.draw(ViewRootImpl.java:2409) E/ViewRootImpl(28154): at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2253) E/ViewRootImpl(28154): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1883) E/ViewRootImpl(28154): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1000) E/ViewRootImpl(28154): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5607) E/ViewRootImpl(28154): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:761) E/ViewRootImpl(28154): at android.view.Choreographer.doCallbacks(Choreographer.java:574) E/ViewRootImpl(28154): at android.view.Choreographer.doFrame(Choreographer.java:544) E/ViewRootImpl(28154): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:747) E/ViewRootImpl(28154): at android.os.Handler.handleCallback(Handler.java:733) E/ViewRootImpl(28154): at android.os.Handler.dispatchMessage(Handler.java:95) E/ViewRootImpl(28154): at android.os.Looper.loop(Looper.java:212) E/ViewRootImpl(28154): at android.app.ActivityThread.main(ActivityThread.java:5137) E/ViewRootImpl(28154): at java.lang.reflect.Method.invokeNative(Native Method) E/ViewRootImpl(28154): at java.lang.reflect.Method.invoke(Method.java:515) E/ViewRootImpl(28154): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:902) E/ViewRootImpl(28154): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:718) E/ViewRootImpl(28154): at dalvik.system.NativeStart.main(Native Method) I/TiAPI (28154): toggle_appearance: start I/TiAPI (28154): toggle_appearance: end D/skia (28154): ------- imageref_ashmem create failed <(null)> 36864 D/skia (28154): ------- imageref_ashmem create failed <(null)> 36864 D/skia (28154): ------- imageref_ashmem create failed <(null)> 36864 D/skia (28154): ------- imageref_ashmem create failed <(null)> 36864 D/skia (28154): ------- imageref_ashmem create failed <(null)> 36864 D/skia (28154): ------- imageref_ashmem create failed <(null)> 36864 E/BufferQueue( 292): [org.camcops.camcops/org.appcelerator.titanium.TiActivity] dequeueBuffer: can't dequeue multiple buffers without setting the buffer count E/Surface (28154): dequeueBuffer failed (Invalid argument) E/ViewRootImpl(28154): Could not lock surface E/ViewRootImpl(28154): java.lang.IllegalArgumentException E/ViewRootImpl(28154): at android.view.Surface.nativeLockCanvas(Native Method) E/ViewRootImpl(28154): at android.view.Surface.lockCanvas(Surface.java:243) E/ViewRootImpl(28154): at android.view.ViewRootImpl.drawSoftware(ViewRootImpl.java:2435) E/ViewRootImpl(28154): at android.view.ViewRootImpl.draw(ViewRootImpl.java:2409) E/ViewRootImpl(28154): at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2253) E/ViewRootImpl(28154): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1883) E/ViewRootImpl(28154): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1000) E/ViewRootImpl(28154): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5607) E/ViewRootImpl(28154): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:761) E/ViewRootImpl(28154): at android.view.Choreographer.doCallbacks(Choreographer.java:574) E/ViewRootImpl(28154): at android.view.Choreographer.doFrame(Choreographer.java:544) E/ViewRootImpl(28154): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:747) E/ViewRootImpl(28154): at android.os.Handler.handleCallback(Handler.java:733) E/ViewRootImpl(28154): at android.os.Handler.dispatchMessage(Handler.java:95) E/ViewRootImpl(28154): at android.os.Looper.loop(Looper.java:212) E/ViewRootImpl(28154): at android.app.ActivityThread.main(ActivityThread.java:5137) E/ViewRootImpl(28154): at java.lang.reflect.Method.invokeNative(Native Method) E/ViewRootImpl(28154): at java.lang.reflect.Method.invoke(Method.java:515) E/ViewRootImpl(28154): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:902) E/ViewRootImpl(28154): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:718) E/ViewRootImpl(28154): at dalvik.system.NativeStart.main(Native Method) E/BufferQueue( 292): [org.camcops.camcops/org.appcelerator.titanium.TiActivity] dequeueBuffer: can't dequeue multiple buffers without setting the buffer count E/Surface (28154): dequeueBuffer failed (Invalid argument) E/ViewRootImpl(28154): Could not lock surface E/ViewRootImpl(28154): java.lang.IllegalArgumentException E/ViewRootImpl(28154): at android.view.Surface.nativeLockCanvas(Native Method) E/ViewRootImpl(28154): at android.view.Surface.lockCanvas(Surface.java:243) E/ViewRootImpl(28154): at android.view.ViewRootImpl.drawSoftware(ViewRootImpl.java:2435) E/ViewRootImpl(28154): at android.view.ViewRootImpl.draw(ViewRootImpl.java:2409) E/ViewRootImpl(28154): at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2253) E/ViewRootImpl(28154): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1883) E/ViewRootImpl(28154): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1000) E/ViewRootImpl(28154): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5607) E/ViewRootImpl(28154): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:761) E/ViewRootImpl(28154): at android.view.Choreographer.doCallbacks(Choreographer.java:574) E/ViewRootImpl(28154): at android.view.Choreographer.doFrame(Choreographer.java:544) E/ViewRootImpl(28154): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:747) E/ViewRootImpl(28154): at android.os.Handler.handleCallback(Handler.java:733) E/ViewRootImpl(28154): at android.os.Handler.dispatchMessage(Handler.java:95) E/ViewRootImpl(28154): at android.os.Looper.loop(Looper.java:212) E/ViewRootImpl(28154): at android.app.ActivityThread.main(ActivityThread.java:5137) E/ViewRootImpl(28154): at java.lang.reflect.Method.invokeNative(Native Method) E/ViewRootImpl(28154): at java.lang.reflect.Method.invoke(Method.java:515) E/ViewRootImpl(28154): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:902) E/ViewRootImpl(28154): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:718) E/ViewRootImpl(28154): at dalvik.system.NativeStart.main(Native Method) I/TiAPI (28154): toggle_appearance: start I/TiAPI (28154): toggle_appearance: end D/skia (28154): ------- imageref_ashmem create failed <(null)> 36864 D/skia (28154): ------- imageref_ashmem create failed <(null)> 36864 D/skia (28154): ------- imageref_ashmem create failed <(null)> 36864 D/skia (28154): ------- imageref_ashmem create failed <(null)> 36864 D/skia (28154): ------- imageref_ashmem create failed <(null)> 36864 D/skia (28154): ------- imageref_ashmem create failed <(null)> 36864 D/skia (28154): ------- imageref_ashmem create failed <(null)> 36864 D/skia (28154): ------- imageref_ashmem create failed <(null)> 36864 {noformat} h4. Result if access_db() only is called from click() Haven't managed to get a crash out of this (nor by calling {{access_db()}} 10,000 times consecutively). h4. Plausible fixes that didn't help Setting {{<application android:hardwareAccelerated="false">}} in {{tiapp.xml}} made no difference. h4. Theories Possible sequence (I have no idea if this is the case): # File handle leak # -> Crash in Android display code # -> Crash in other file access (e.g. database opening) operations? h4. Possible related Android bugs [https://code.google.com/p/android/issues/detail?id=63738] [https://code.google.com/p/android/issues/detail?id=71742]

    Appcelerator JIRA | 2 years ago | Rudolf Cardinal
    android.database.sqlite.SQLiteCantOpenDatabaseException: unable to open database file (code 14): , while compiling: PRAGMA journal_mode
  3. 0

    Why no sqlite error codes

    Stack Overflow | 4 years ago | Peri Hartman
    android.database.sqlite.SQLiteCantOpenDatabaseException: unable to open database file
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    SQLiteCantOpenDatabaseException

    GitHub | 1 year ago | negue
    android.database.sqlite.SQLiteCantOpenDatabaseException: unknown error (code 14): Could not open database
  6. 0

    GitHub comment 312#166361937

    GitHub | 1 year ago | negue
    android.database.sqlite.SQLiteCantOpenDatabaseException: unknown error (code 14): Could not open database

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. android.database.sqlite.SQLiteCantOpenDatabaseException

      unable to open database file (code 14): , while compiling: PRAGMA journal_mode

      at android.database.sqlite.SQLiteConnection.nativePrepareStatement()
    2. Android Platform
      ContextWrapper.openOrCreateDatabase
      1. android.database.sqlite.SQLiteConnection.nativePrepareStatement(Native Method)
      2. android.database.sqlite.SQLiteConnection.acquirePreparedStatement(SQLiteConnection.java:889)
      3. android.database.sqlite.SQLiteConnection.executeForString(SQLiteConnection.java:634)
      4. android.database.sqlite.SQLiteConnection.setJournalMode(SQLiteConnection.java:320)
      5. android.database.sqlite.SQLiteConnection.setWalModeFromConfiguration(SQLiteConnection.java:294)
      6. android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:215)
      7. android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:193)
      8. android.database.sqlite.SQLiteConnectionPool.openConnectionLocked(SQLiteConnectionPool.java:463)
      9. android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:185)
      10. android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:177)
      11. android.database.sqlite.SQLiteDatabase.openInner(SQLiteDatabase.java:804)
      12. android.database.sqlite.SQLiteDatabase.open(SQLiteDatabase.java:789)
      13. android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:694)
      14. android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:977)
      15. android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:966)
      16. android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:250)
      16 frames
    3. ti.modules.titanium
      DatabaseModule.open
      1. ti.modules.titanium.database.DatabaseModule.open(DatabaseModule.java:71)
      1 frame
    4. org.appcelerator.kroll
      KrollProxy.handleMessage
      1. org.appcelerator.kroll.runtime.v8.V8Object.nativeFireEvent(Native Method)
      2. org.appcelerator.kroll.runtime.v8.V8Object.fireEvent(V8Object.java:62)
      3. org.appcelerator.kroll.KrollProxy.doFireEvent(KrollProxy.java:884)
      4. org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1107)
      4 frames
    5. org.appcelerator.titanium
      TiViewProxy.handleMessage
      1. org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:347)
      1 frame
    6. Android Platform
      Looper.loop
      1. android.os.Handler.dispatchMessage(Handler.java:98)
      2. android.os.Looper.loop(Looper.java:212)
      2 frames
    7. org.appcelerator.kroll
      KrollRuntime$KrollRuntimeThread.run
      1. org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:112)
      1 frame