We recently added Firebase to our app and noticed a high increase of SQLite exceptions.
Logs:
android.database.sqlite.SQLiteReadOnlyDatabaseException:
at android.database.sqlite.SQLiteConnection.nativeExecuteForLastInsertedRowId(Native Method:0)
at android.database.sqlite.SQLiteConnection.executeForLastInsertedRowId(SQLiteConnection.java:788)
at android.database.sqlite.SQLiteSession.executeForLastInsertedRowId(SQLiteSession.java:788)
at android.database.sqlite.SQLiteStatement.executeInsert(SQLiteStatement.java:86)
at android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:1474)
at bkf.a(:com.google.android.gms.DynamiteModulesC:70)
at bkw.run(:com.google.android.gms.DynamiteModulesC:32)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:761)>
or
android.database.sqlite.SQLiteDiskIOException:
at android.database.sqlite.SQLiteConnection.nativeExecuteForLastInsertedRowId(Native Method:0)
at android.database.sqlite.SQLiteConnection.executeForLastInsertedRowId(SQLiteConnection.java:788)
at android.database.sqlite.SQLiteSession.executeForLastInsertedRowId(SQLiteSession.java:788)
at android.database.sqlite.SQLiteStatement.executeInsert(SQLiteStatement.java:86)
at android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:1472)
at bkf.a(:com.google.android.gms.DynamiteModulesC:70)
at bkw.run(:com.google.android.gms.DynamiteModulesC:46)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:761)
In our app we're using SQLite too (multiple threads, single instances of SQLiteOpenHelper), however we don't get any exceptions there.
We also noticed that these exceptions were thrown for about 90% on Sony devices. (SDK 23 and above)
Which comes first in my mind, is a failed SQLite implementation on these devices but I'm not able to reproduce it on our Sony devices, so my questions are:
is this a known Firebase issue?
can anyone confirm my guess?
and well,
what will be a possible workaround
Any help would be appreciated.
Edit:
For sure it's related to SQLiteReadOnlyDatabaseException (it's mentioned in the logs ;) ) but it affects mostly Sony devices and it's not our db which fails but Googles, so I don't think it's duplicated to SQLiteReadOnlyDatabaseException: attempt to write a readonly database
Related
I do not have any database-related code in my android app. Still, I do see database-related crashes from the usage of androidx in my app. Please help me understand and find a fix for this issue.
Fatal Exception: android.database.sqlite.SQLiteDiskIOException: disk I/O error (code 4874): , while compiling: PRAGMA journal_mode
at android.database.sqlite.SQLiteConnection.nativePrepareStatement(SQLiteConnection.java)
at android.database.sqlite.SQLiteConnection.acquirePreparedStatement(SQLiteConnection.java:897)
at android.database.sqlite.SQLiteConnection.executeForString(SQLiteConnection.java:642)
at android.database.sqlite.SQLiteConnection.setJournalMode(SQLiteConnection.java:323)
at android.database.sqlite.SQLiteConnection.setWalModeFromConfiguration(SQLiteConnection.java:294)
at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:218)
at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:196)
at android.database.sqlite.SQLiteConnectionPool.openConnectionLocked(SQLiteConnectionPool.java:464)
at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:186)
at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:178)
at android.database.sqlite.SQLiteDatabase.openInner(SQLiteDatabase.java:916)
at android.database.sqlite.SQLiteDatabase.open(SQLiteDatabase.java:893)
at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:796)
at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:1309)
at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:268)
at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:223)
at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:163)
at androidx.sqlite.db.framework.FrameworkSQLiteOpenHelper$OpenHelper.getWritableSupportDatabase(FrameworkSQLiteOpenHelper.java:92)
at androidx.sqlite.db.framework.FrameworkSQLiteOpenHelper.getWritableDatabase(FrameworkSQLiteOpenHelper.java:53)
at androidx.room.RoomDatabase.beginTransaction(RoomDatabase.java:328)
at androidx.work.impl.utils.ForceStopRunnable.cleanUp(ForceStopRunnable.java:135)
at androidx.work.impl.utils.ForceStopRunnable.run(ForceStopRunnable.java:79)
at androidx.work.impl.utils.SerialExecutor$Task.run(SerialExecutor.java:75)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:818)
Based on this issue and this issue, you may be out of disk space.
WorkManager stores job information in a SQLite database, and that is where you are crashing.
It appears that a future version of WorkManager (2.6.x) might offer better APIs for dealing with this case.
I am trying to connect to mysql using wampp and the following error is thrown how to solve this?
W/System.err: java.io.FileNotFoundException: http://192.168.2.198/login.php
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:250)
at com.example.mysqltest.BackgroundWorker.doInBackground(BackgroundWorker.java:46)
at com.example.mysqltest.BackgroundWorker.doInBackground(BackgroundWorker.java:19)
at android.os.AsyncTask$2.call(AsyncTask.java:304)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:243)
W/System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:761)
There are following possibility to occur this issue
maybe your project or file location is not perfect
maybe because of the port number or IP not match time of calling
First, try to run this page in your mobile browser web browser and it will work in mobile browser then it will work in API definitely if not work then you need to change in your config
I am using SqlCipher in my android application to encrypt the database.
My app works in both online and offline and has many DB transactions.
I am using SQLCipher 3.5.7 version.
I rarely get the below exception and it occur mostly in Samsung devices.
I was unable to reproduce the exception. Kindly help.
java.util.concurrent.TimeoutException: net.sqlcipher.database.SQLiteCompiledSql.finalize() timed out after 60 seconds at java.lang.Object.wait(Native Method) at
java.lang.Thread.parkFor$(Thread.java:2137) at
sun.misc.Unsafe.park(Unsafe.java:358) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:190) at
java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:868) at
java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireQueued(AbstractQueuedSynchronizer.java:900) at
java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(AbstractQueuedSynchronizer.java:1223) at
java.util.concurrent.locks.ReentrantLock$FairSync.lock(ReentrantLock.java:225) at java.util.concurrent.locks.ReentrantLock.lock(ReentrantLock.java:286) at
net.sqlcipher.database.SQLiteDatabase.lock(SQLiteDatabase.java:553) at
net.sqlcipher.database.SQLiteCompiledSql.releaseSqlStatement(SQLiteCompiledSql.java:106) at
net.sqlcipher.database.SQLiteCompiledSql.finalize(SQLiteCompiledSql.java:152) at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:250) at java.lang.Daemons$FinalizerDaemon.runInternal(Daemons.java:237) at java.lang.Daemons$Daemon.run(Daemons.java:103) at java.lang.Thread.run(Thread.java:764)
So, I'm constantly getting this buffer overflow crash (393238).
One example, I've just fixed is, when I run Log.d("test", null) I get the crash.
If I remove this line of code, there's no crash.
As far as I know, every single bug in my code, whether it's an ArrayOutOfBounds, Incorrect Type, Null Exceptions, etc. are all causing Buffer Overflow crashes.
I don't know why this is happening. Why is Android not gracefully handling and returning Exception messages, rather than crashing the program with a Buffer Overflow message all the time?
Also, I've tried running on my own phone through usb debugging, Nexus emulator, etc. Still happens.
Here is the exact message:
W/ErrorProcessor: onFatalError, processing error from engine(4)
com.google.android.apps.gsa.shared.speech.a.g: Error reading from input stream
at com.google.android.apps.gsa.staticplugins.recognizer.i.a.a(SourceFile:342)
at com.google.android.apps.gsa.staticplugins.recognizer.i.a$1.run(SourceFile:1367)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:428)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at com.google.android.apps.gsa.shared.util.concurrent.a.ak.run(SourceFile:66)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:761)
at com.google.android.apps.gsa.shared.util.concurrent.a.ad$1.run(SourceFile:85)
Caused by: com.google.android.apps.gsa.shared.exception.GsaIOException: Error code: 393238 | Buffer overflow, no available space.
at com.google.android.apps.gsa.speech.audio.Tee.g(SourceFile:2531)
at com.google.android.apps.gsa.speech.audio.ap.read(SourceFile:555)
at java.io.InputStream.read(InputStream.java:101)
at com.google.android.apps.gsa.speech.audio.al.run(SourceFile:362)
at com.google.android.apps.gsa.speech.audio.ak$1.run(SourceFile:471)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:428)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at com.google.android.apps.gsa.shared.util.concurrent.a.ak.run(SourceFile:66)
at com.google.android.apps.gsa.shared.util.concurrent.a.ax.run(SourceFile:139)
at com.google.android.apps.gsa.shared.util.concurrent.a.ax.run(SourceFile:139)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:761)
at com.google.android.apps.gsa.shared.util.concurrent.a.ad$1.run(SourceFile:85)
I had the same thing. My app ran fine on my main computer from android studio on both a real android tablet and the tablet emulator. When I did the exact same thing on my laptop I got this crash, for both real device and emulator.
I ended up 'fixing it' by deleting the project build directory, and doing a Tools->AVD Manager->Actions Wipe Data. I then rebuilt/ran the project and it worked. Go figure...
I have a MediaPlayer app with a live streaming function. When I test the app with a physically device(API 22 Lollipop and API 23 Marshmallow) there are no problems with starting of the stream.
Today I want to test the application with a Emulator (API 25 Nougat). Stream is not working and I get the following error:
(SourceFile:139)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:761)
at com.google.android.apps.gsa.shared.util.concurrent.a.ad$1.run(SourceFile:85)
02-23 23:58:09.834 2166-3554/com.google.android.googlequicksearchbox:search W/ErrorProcessor: onFatalError, processing error from engine(4)
com.google.android.apps.gsa.shared.speech.a.g: Error reading from input stream
at com.google.android.apps.gsa.staticplugins.recognizer.i.a.a(SourceFile:342)
at com.google.android.apps.gsa.staticplugins.recognizer.i.a$1.run(SourceFile:1367)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:428)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at com.google.android.apps.gsa.shared.util.concurrent.a.ak.run(SourceFile:66)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:761)
at com.google.android.apps.gsa.shared.util.concurrent.a.ad$1.run(SourceFile:85)
Caused by: com.google.android.apps.gsa.shared.exception.GsaIOException: Error code: 393238 | Buffer overflow, no available space.
at com.google.android.apps.gsa.speech.audio.Tee.g(SourceFile:2531)
at com.google.android.apps.gsa.speech.audio.ap.read(SourceFile:555)
at java.io.InputStream.read(InputStream.java:101)
at com.google.android.apps.gsa.speech.audio.al.run(SourceFile:362)
at com.google.android.apps.gsa.speech.audio.ak$1.run(SourceFile:471)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:428)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at com.google.android.apps.gsa.shared.util.concurrent.a.ak.run(SourceFile:66)
at com.google.android.apps.gsa.shared.util.concurrent.a.ax.run(SourceFile:139)
at com.google.android.apps.gsa.shared.util.concurrent.a.ax.run(SourceFile:139)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:761)
at com.google.android.apps.gsa.shared.util.concurrent.a.ad$1.run(SourceFile:85)
I can recognize only one thing where I think it is important.
GsaIOException: Error code: 393238 | Buffer overflow, no available space
But I don't know what it could mean. Can anyone explain what kind of Exception it is. And where I can search at the code to find the problem?
I had a similar issue, for me it was crashing on devices too, with the same error. This is how I fixed it for devices:
<uses-permission android:name="android.permission.RECORD_AUDIO" />
More details here: Looping Error on Android Emulator
To make the app work on simulator, after applying the fix from the above link, I had to create a new simulator based on x86 architecture (not x86_64 as before) and it worked.
I was getting these exact messages while trying to debug my device with logcat. Could not figure out where they were coming from. Finally realized that a preceding debug session with the emulator was generating these. I simply quit the emulator to stop them.
I did receive the same issue, and i did the following things to make this crash occurs.
Few api's that i wrote needed to allocate some memory since a file needed to be parsed and kept in that buffer. I started parsing the file without allocating the buffer hence received that message.
So you could look into similar code where you might be doing the same.
I've resolved this by deleting the apk files that i have created before and they still remain in Project Files list.