Failed to open database RKStorage (language)
See original GitHub issueCurrent behavior
After changing the device language the app crashs.
Expected behavior
No impact on the app when user changes the device language.
Repro steps
- Install a release build using some language, like
en_US
- Kill the app
- Change the device language, for example
pt_BR
- Open the app
- App crashs
Environment
- Async Storage version: 1.6.1
- React-Native version: 0.60.4
- Platform tested: Android
- Logs/Error that are relevant:
Failed to open database "/data/user/0/com.app/databases/RKStorage".
android.database.sqlite.SQLiteException: Failed to change locale for db "/data/user/0/com.app/databases/RKStorage" to "en_US".
at android.database.sqlite.SQLiteConnection.setLocaleFromConfiguration(SQLiteConnection.java:394)
at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:219)
at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:194)
at android.database.sqlite.SQLiteConnectionPool.openConnectionLocked(SQLiteConnectionPool.java:493)
at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:200)
at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:192)
at android.database.sqlite.SQLiteDatabase.openInner(SQLiteDatabase.java:864)
at android.database.sqlite.SQLiteDatabase.open(SQLiteDatabase.java:849)
at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:724)
at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:714)
at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:295)
at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:238)
at com.facebook.react.modules.storage.ReactDatabaseSupplier.ensureDatabase(ReactDatabaseSupplier.java:88)
at com.facebook.react.modules.storage.AsyncStorageModule.ensureDatabase(AsyncStorageModule.java:432)
at com.facebook.react.modules.storage.AsyncStorageModule.access$000(AsyncStorageModule.java:38)
at com.facebook.react.modules.storage.AsyncStorageModule$1.doInBackgroundGuarded(AsyncStorageModule.java:132)
at com.facebook.react.modules.storage.AsyncStorageModule$1.doInBackgroundGuarded(AsyncStorageModule.java:129)
at com.facebook.react.bridge.GuardedAsyncTask.doInBackground(GuardedAsyncTask.java:32)
at com.facebook.react.bridge.GuardedAsyncTask.doInBackground(GuardedAsyncTask.java:20)
at android.os.AsyncTask$2.call(AsyncTask.java:333)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at com.facebook.react.modules.storage.AsyncStorageModule$SerialExecutor$1.run(AsyncStorageModule.java:64)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
at java.lang.Thread.run(Thread.java:764)
Caused by: android.database.sqlite.SQLiteDatabaseLockedException: database is locked (code 5)
at android.database.sqlite.SQLiteConnection.nativeExecute(Native Method)
at android.database.sqlite.SQLiteConnection.execute(SQLiteConnection.java:556)
at android.database.sqlite.SQLiteConnection.setLocaleFromConfiguration(SQLiteConnection.java:385)
... 24 more
(1032) statement aborts at 14: [INSERT OR REPLACE INTO catalystLocalStorage VALUES (?, ?);] attempt to write a readonly database
attempt to write a readonly database (code 1032)
android.database.sqlite.SQLiteReadOnlyDatabaseException: attempt to write a readonly database (code 1032)
at android.database.sqlite.SQLiteConnection.nativeExecute(Native Method)
at android.database.sqlite.SQLiteConnection.execute(SQLiteConnection.java:556)
at android.database.sqlite.SQLiteSession.execute(SQLiteSession.java:619)
at android.database.sqlite.SQLiteStatement.execute(SQLiteStatement.java:44)
at com.reactnativecommunity.asyncstorage.AsyncStorageModule$2.doInBackgroundGuarded(AsyncStorageModule.java:235)
at com.reactnativecommunity.asyncstorage.AsyncStorageModule$2.doInBackgroundGuarded(AsyncStorageModule.java:205)
at com.facebook.react.bridge.GuardedAsyncTask.doInBackground(GuardedAsyncTask.java:32)
at com.facebook.react.bridge.GuardedAsyncTask.doInBackground(GuardedAsyncTask.java:20)
at android.os.AsyncTask$2.call(AsyncTask.java:333)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at com.reactnativecommunity.asyncstorage.AsyncStorageModule$SerialExecutor$1.run(AsyncStorageModule.java:62)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
at java.lang.Thread.run(Thread.java:764)
--------- beginning of crash
[ 31506:31506 E/AndroidRuntime ]
FATAL EXCEPTION: main
Process: com.app, PID: 31506
android.app.RemoteServiceException: Context.startForegroundService() did not then call Service.startForeground()
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1821)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6626)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:811)
Issue Analytics
- State:
- Created 4 years ago
- Reactions:7
- Comments:13 (5 by maintainers)
Top Results From Across the Web
Failed to open database RKStorage (language) #178 - GitHub
Current behavior After changing the device language the app crashs. ... Failed to open database RKStorage (language) #178.
Read more >Where is AsyncStorage Data Physically Located on Android ...
In SQLite Manager go to Database->Connect Database and "open file" window will open there you select All files at bottom of your window...
Read more >Data Storage on Android - Mobile Security Gitbook
Asking the user to decrypt the database with a PIN or password once the app is opened (weak passwords and PINs are vulnerable...
Read more >com.amazon.avod.thirdpartyclient_v3.0.219.32341 ...
INTERNET, Allows applications to open network sockets. android.permission. ... Clearing and deleting database RKStorage failed.
Read more >Language settings in FM file - Claris Community - FileMaker Pro
The only way to escape the curse is, AFAIK, to open the cursed database on the new system, save a clone and start...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi folks
I have seen similar errors popping up in our Sentry report.
Do you know what can we do? Upgrade/downgrade lib version?
This error is reported from multiple users on Sentry for my app as well. Error is
database is locked (code 5)