question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"Attempt to re-open an already-closed object: SQLiteDatabase" error on a Play Store pre-launch tests

See original GitHub issue

Current behavior

In a process of releasing a bundle to the Play Store, I received an errors on a pre-launch tests. It shows up as : «attempt to re-open an already-closed object: SQLiteDatabase /data/user/0/com.app/databases/RKStorage»

Expected behavior

App should not get any errors.

Repro steps

I’ve got two separate angles at which we can look at this problem.

  1. Automated Sentry error response:

My Sentry error system caught an exception, which may happen then an app has been closed after being put into a background (by pressing Home, I guess)

image

At first glance, the app is already to be closed, so why even bother? I don’t know what the user actually saw, which makes me worry a bit. It doesn’t happen before.

  1. Pre-launch tests from the Play Store

Also, there are pre-launch tests, which are mandatory before uploading an app to the Play Store. And they are showing the same errors.

image

Related issue - https://github.com/firebase/quickstart-unity/issues/861.

Looks like a problem with pre-release test code on a Google side. But worth looking at any way, cause async-library being caught in an error log.

Thanks!

Environment

  • Platforms tested:
    • [8.1.0] Android Nokia 1
    • iOS
    • macOS
    • Windows
  • AsyncStorage version: 1.12.1
  • Environment: react-native: =0.63.3 => 0.63.3
  • Logs/Errors that may be relevant:
An error occurred while executing doInBackground()

android.os.AsyncTask$3 in done at line 353

    java.util.concurrent.FutureTask in finishCompletion at line 383
    java.util.concurrent.FutureTask in setException at line 252
    java.util.concurrent.FutureTask in run at line 271
    com.reactnativecommunity.asyncstorage.AsyncStorageModule$SerialExecutor$1 in run at line 63
    java.util.concurrent.ThreadPoolExecutor in runWorker at line 1162
    java.util.concurrent.ThreadPoolExecutor$Worker in run at line 636
    java.lang.Thread in run at line 764
IllegalStateException

attempt to re-open an already-closed object: SQLiteDatabase: /data/user/0/com.app/databases/RKStorage
    android.database.sqlite.SQLiteClosable in acquireReference at line 55
    android.database.sqlite.SQLiteDatabase in compileStatement at line 1068
    com.reactnativecommunity.asyncstorage.AsyncStorageModule$2 in doInBackgroundGuarded at line 228
    com.reactnativecommunity.asyncstorage.AsyncStorageModule$2 in doInBackgroundGuarded at line 219
    com.facebook.react.bridge.GuardedAsyncTask in doInBackground at line 36
    com.facebook.react.bridge.GuardedAsyncTask in doInBackground at line 20
    android.os.AsyncTask$2 in call at line 333
    java.util.concurrent.FutureTask in run at line 266
    com.reactnativecommunity.asyncstorage.AsyncStorageModule$SerialExecutor$1 in run at line 63
    java.util.concurrent.ThreadPoolExecutor in runWorker at line 1162
    java.util.concurrent.ThreadPoolExecutor$Worker in run at line 636
    java.lang.Thread in run at line 764

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
keeprockcommented, Jan 12, 2021

Thanks @limaAniceto.

Could you be so kindly to show me, which version you’ve got prior to bumping? I’m looking for a stable version. Got some other error reports, which may be linked to this.

2reactions
saghulcommented, Jan 12, 2021

Same here, we got this crash too, alas the tracebacks are not that helpful:

Fatal Exception: java.lang.RuntimeException: An error occurred while executing doInBackground()
       at android.os.AsyncTask$4.done(AsyncTask.java:399)
       at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383)
       at java.util.concurrent.FutureTask.setException(FutureTask.java:252)
       at java.util.concurrent.FutureTask.run(FutureTask.java:271)
       at com.reactnativecommunity.asyncstorage.AsyncStorageModule$SerialExecutor$1.run(AsyncStorageModule.java:63)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
       at java.lang.Thread.run(Thread.java:919)

Caused by java.lang.IllegalStateException: attempt to re-open an already-closed object: SQLiteDatabase: /data/user/0/org.jitsi.meet/databases/RKStorage
       at android.database.sqlite.SQLiteClosable.acquireReference(SQLiteClosable.java:57)
       at android.database.sqlite.SQLiteDatabase.queryWithFactory(SQLiteDatabase.java:1809)
       at android.database.sqlite.SQLiteDatabase.query(SQLiteDatabase.java:1685)
       at android.database.sqlite.SQLiteDatabase.query(SQLiteDatabase.java:1853)
       at com.reactnativecommunity.asyncstorage.AsyncStorageModule$1.doInBackgroundGuarded(AsyncStorageModule.java:159)
       at com.reactnativecommunity.asyncstorage.AsyncStorageModule$1.doInBackgroundGuarded(AsyncStorageModule.java:146)
       at com.facebook.react.bridge.GuardedAsyncTask.doInBackground(GuardedAsyncTask.java:35)
       at com.facebook.react.bridge.GuardedAsyncTask.doInBackground(GuardedAsyncTask.java:19)
       at android.os.AsyncTask$3.call(AsyncTask.java:378)
       at java.util.concurrent.FutureTask.run(FutureTask.java:266)
       at com.reactnativecommunity.asyncstorage.AsyncStorageModule$SerialExecutor$1.run(AsyncStorageModule.java:63)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
       at java.lang.Thread.run(Thread.java:919)

Got these from Crashlytics, I don’t know how to reproduce the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android + Room + attempt to re-open an already-closed object
IllegalStateException : attempt to re-open an already-closed object: SQLiteDatabase: /data/user/0/com.example.dev/databases/test.db at ...
Read more >
java.lang.IllegalStateException: attempt to re-open an already ...
java.lang.IllegalStateException : attempt to re-open an already-closed object: SQLiteDatabase: (database path) This issue has happened for ...
Read more >
Use a pre-launch report to identify issues - Play Console Help
A pre-launch report is automatically generated when you publish an app to internal, closed, or open testing. It helps to identify issues proactively...
Read more >
attempt to re-open an already-closed object - Google Groups
I believe it means that your application is not properly detecting when it has been partially closed so it needs to reopen the...
Read more >
Could you fix Pre-launch report false-positives ... - Issue Tracker
I see this error because Google automatically tested phone when you launch application on play store and i got the error on theses...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found