realm-java
realm-java copied to clipboard
Unrecoverable error. No such table exists Exception backtrace: <backtrace not supported on this platform> in /tmp/realm-java/realm/realm-library/src/main/cpp/io_realm_internal_OsSharedRealm.cpp line 107
How frequently does the bug occur?
Sometimes
Description
Android app with latest realm (10.10.1) crashes with the error mentioned in the stack trace provided by Firebase Crashlytics.
According to Firebase, the crash occurs for case when device is trying to update widget.
Cant reproduce on my device (Pixel 2XL, emulator).
According to stack-trace, the crash is occurring on this line:
Realm realm = Realm.getDefaultInstance())
Details from Firebase:
in background(96%),
Android versions: Android 10 - 94%
Devices: Huawei - 94%
Let me know if additional details are required
Stacktrace & log output
io.realm.internal.OsSharedRealm.nativeGetSharedRealm (OsSharedRealm.java)
io.realm.internal.OsSharedRealm.<init> (OsSharedRealm.java:176)
io.realm.internal.OsSharedRealm.getInstance (OsSharedRealm.java:261)
io.realm.BaseRealm.<init> (BaseRealm.java:143)
io.realm.BaseRealm.<init> (BaseRealm.java:110)
io.realm.Realm.<init> (Realm.java:159)
io.realm.Realm.createInstance (Realm.java:506)
io.realm.RealmCache.createInstance (RealmCache.java:508)
io.realm.RealmCache.doCreateRealmOrGetFromCache (RealmCache.java:461)
io.realm.RealmCache.createRealmOrGetFromCache (RealmCache.java:422)
io.realm.Realm.getDefaultInstance (Realm.java:414)
<my.app.package>.MainService.updateWidgetValues (MainService.java:202)
androidx.core.app.WakefulIntentService.onHandleWork (WakefulIntentService.java:79)
androidx.core.app.JobIntentService$CommandProcessor.doInBackground (JobIntentService.java:396)
androidx.core.app.JobIntentService$CommandProcessor.doInBackground (JobIntentService.java:387)
android.os.AsyncTask$3.call (AsyncTask.java:378)
java.util.concurrent.FutureTask.run (FutureTask.java:266)
java.util.concurrent.ThreadPoolExecutor.processTask (ThreadPoolExecutor.java:1187)
java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1152)
java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:641)
java.lang.Thread.run (Thread.java:929)
Can you reproduce the bug?
Not yet
Reproduction Steps
No response
Version
io.realm:realm-gradle-plugin:10.10.1
What SDK flavour are you using?
Local Database only
Are you using encryption?
No, not using encryption
Platform OS and version(s)
Android 10
Build environment
Android Studio version: 2021.2.1 Android Build Tools version: 32.0.0 Gradle version: 7.1.2
➤ Clemente Tort Barbero commented:
Is this still an issue?
Still an issue
for last 30 days (Jun 12 - Jul 11, 2022)
This issue has 5033 crash events affecting 377 users

@svyd there isn't much we can do with the information you provide us as calling Realm.getDefaultInstance() alone doesn't give us much information. Make sure you have a reproduction case where you specify the configuration you have for your realm (using encryption, migrations, etc.) or even better, share a sample repository with said reproduction case.
@edualonso We are also observing the same issue but unfortunately don't have repro steps.
@svyd @dhanesh007 Any of you that has been able to gather more information about this issue?
Closing due to inactivity.
I'd like to follow up on this issue as it still persists. @edualonso are you able to tell what can cause this error to occur in Realm.getDefaultInstance()? As we are not querying a specific table, just getting the default instance of Realm I think it would help us to better investigate if we knew what can cause Realm to throw this specific error
我也遇到了这个问题 我的版本是 classpath "io.realm:realm-gradle-plugin:10.0.1"
复现步骤:只要添加系统权限就会崩溃
2023-03-09 18:01:47.844 10436-10436/com.jc.scale E/CrashReport: io.realm.exceptions.RealmError: Unrecoverable error. Permission denied in /Users/cm/Realm/realm-java-release/realm/realm-library/src/main/cpp/io_realm_internal_OsSharedRealm.cpp line 107
at io.realm.internal.OsSharedRealm.nativeGetSharedRealm(Native Method)
at io.realm.internal.OsSharedRealm.
We're running into the same crash on Realm: io.realm:realm-gradle-plugin:10.11.1. This started happening on our latest release and has only impacted one user so far but we have only rolled out to a small number of users. The crash happens on App launch after calling Realm.getInstance(config) in the function below.
Inside our Application.onCreate() we're calling initRealm with the Application context:
private val baseConfig: RealmConfiguration
get() = RealmConfiguration.Builder()
.name(Constants.REALM_STORE_NAME)
.build()
private fun initRealm(context: Context) {
Realm.init(context)
val config: RealmConfiguration = try {
RealmConfiguration.Builder()
.name(Constants.REALM_STORE_NAME)
.schemaVersion(REALM_VERSION.toLong())
.migration(Migration())
.build()
} catch (e: Exception) {
baseConfig
}
storeRealm = try {
Realm.getInstance(config)
} catch (ex: RealmMigrationNeededException) {
Realm.deleteRealm(config)
Realm.getInstance(config)
} catch (ex: Exception) {
throw ex
}
}
The crash happened on a Moto G Stylus 5G (2022) running Android 12. We have not been able to reproduce so far.
We're using the local database only.
Android Studio version: Android Studio Flamingo | 2022.2.1 Android Build Tools version: 33 Gradle version: 7.5.1
Stack trace of crash:
Fatal Exception: io.realm.exceptions.RealmError: Unrecoverable error. No such table exists
Exception backtrace:
<backtrace not supported on this platform> in /tmp/realm-java/realm/realm-library/src/main/cpp/io_realm_internal_OsSharedRealm.cpp line 107
at io.realm.internal.OsSharedRealm.nativeGetSharedRealm(OsSharedRealm.java)
at io.realm.internal.OsSharedRealm.<init>(OsSharedRealm.java:174)
at io.realm.internal.OsSharedRealm.getInstance(OsSharedRealm.java:259)
at io.realm.BaseRealm.<init>(BaseRealm.java:142)
at io.realm.BaseRealm.<init>(BaseRealm.java:109)
at io.realm.Realm.<init>(Realm.java:161)
at io.realm.Realm.createInstance(Realm.java:535)
at io.realm.RealmCache.createInstance(RealmCache.java:508)
at io.realm.RealmCache.doCreateRealmOrGetFromCache(RealmCache.java:461)
at io.realm.RealmCache.createRealmOrGetFromCache(RealmCache.java:422)
at io.realm.Realm.getInstance(Realm.java:464)
at com.our.app.data.db.DataStore.initRealm(DataStore.kt:87)
at com.our.app.data.db.DataStore.<init>(DataStore.kt:59)
at com.our.app.data.db.DataStore.<init>(DataStore.kt:55)
at com.our.app.data.db.DataStore$Companion.init(DataStore.kt:24)
at com.our.app.application.OurApp.onCreate(KslClassifiedsApplication.kt:131)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1213)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6906)
at android.app.ActivityThread.access$1600(ActivityThread.java:261)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2154)
at android.os.Handler.dispatchMessage(Handler.java:111)
at android.os.Looper.loopOnce(Looper.java:238)
at android.os.Looper.loop(Looper.java:357)
at android.app.ActivityThread.main(ActivityThread.java:8089)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1026)
Our Migration class is structured like so:
class Migration: RealmMigration {
override fun hashCode(): Int {
return REALM_VERSION
}
override fun equals(other: Any?): Boolean {
return other is Migration
}
override fun migrate(realm: DynamicRealm, oldVersion: Long, newVersion: Long) {
val schema = realm.schema
var version = oldVersion
// First migration, add sort column to SavedSearch
if (version == 0L) {
schema["SavedSearch"]?.addField("sortKey", String::class.java)
version++
}
if (version == 1L) {
schema.create("LocationSearchItem")
.addField("zip", String::class.java, FieldAttribute.PRIMARY_KEY)
.addField("id", String::class.java)
.addField("name", String::class.java)
.addField("label", String::class.java)
.addField("latitude", String::class.java)
.addField("longitude", String::class.java)
.addField("searchDate", Date::class.java)
version++
}
...
@rorbech If any additional info would be helpful, let me know. I'll update if we're able to reproduce.
@starchey Thanks for the feedback. There are number of code paths that could lead to this, but I can't really figure out which one that is triggered from you input. Do you by chance have any insights in whether this happens once when running the migration, first installation or sometime later out of the blue?
@starchey Thanks for the feedback. There are number of code paths that could lead to this, but I can't really figure out which one that is triggered from you input. Do you by chance have any insights in whether this happens once when running the migration, first installation or sometime later out of the blue?
I'm not sure whether it happens on first install or on a migration. All I can tell from the trace is when it happens, it happens on launch. 94% of the crashes happened on Motorola devices which make up a small percent of a user-base (majority of those on a Moto G Stylus 5G).
Facing same issue. Repetitive crash in crashlytics. If anyone got the solution, please help here.
This error happened to ~1% of the users to me when I migrated to v10.18.0 on all my apps.