realm-java icon indicating copy to clipboard operation
realm-java copied to clipboard

io.realm.exceptions.RealmFileException: Unable to open a realm at path '/data/user/0/XXX/files/XXX.realm

Open morevij opened this issue 3 years ago • 2 comments

How frequently does the bug occur?

Sometimes

Description

In our Android mobile app, we have observed this crash error for some of our users since. The pattern is that a new install works fine, then when the app is launched subsequently, they get crashes on startup over and over, when Realm tries to read the file.

Checked previously reported issue https://github.com/realm/realm-js/issues/4358 of realm core where it claimed that this already fixed in latest version But for us its still reported on latest version

Our Realm version we are using 10.11.0

We are using encrypt for DB

Stacktrace & log output

io.realm.exceptions.RealmFileException: Unable to open a realm at path '/data/user/0/XXX/files/XXX.realm': Realm file initial open failed: Invalid mnemonic. top_ref[0]: 3531C93134383FBC, top_ref[1]: 600000000000032, mnemonic: 34 34 35 32, fmt[0]: 50, fmt[1]: 52, flags: 37 Path:Exception backtrace:

<backtrace not supported on this platform> Path: /data/user/0/XXX/files/XXX.realm

Exception backtrace:

<backtrace not supported on this platform>. (Realm file initial open failed: Invalid mnemonic. top_ref[0]: 3531C93134383FBC, top_ref[1]: 600000000000032, mnemonic: 34 34 35 32, fmt[0]: 50, fmt[1]: 52, flags: 37 Path: /data/user/0/XXX/files/XXX.realm

Exception backtrace:

<backtrace not supported on this platform> Path: /data/user/0/XXX/files/XXX.realm

Exception backtrace:

<backtrace not supported on this platform>) (/data/user/0/XXX/files/XXX.realm) 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:9)

    at io.realm.internal.OsSharedRealm.getInstance(OsSharedRealm.java:5)

    at io.realm.BaseRealm.<init>(BaseRealm.java:18)

    at io.realm.BaseRealm.<init>(BaseRealm.java:1)

    at io.realm.Realm.<init>(Realm.java:1)

    at io.realm.Realm.createInstance(Realm.java:1)

    at io.realm.RealmCache.createInstance(RealmCache.java:2)

    at io.realm.RealmCache.doCreateRealmOrGetFromCache(RealmCache.java:13)

    at io.realm.RealmCache.createRealmOrGetFromCache(RealmCache.java:2)

    at io.realm.Realm.getDefaultInstance(Realm.java:5)

    at hm.c.a(RealmDB.kt:1)

    at hm.c.b(RealmDB.kt:1)

Can you reproduce the bug?

Not yet

Reproduction Steps

No response

Version

10.11.0

What SDK flavour are you using?

Local Database only

Are you using encryption?

Yes, using encryption

Platform OS and version(s)

Android almost for all versions

Build environment

Android Studio version: Bumblebee | 2021.1.1 Patch 1 Android Build Tools version: 32.0.0 Gradle version: 7.1.3

morevij avatar Jul 21 '22 08:07 morevij

Hi @morevij. The exception indicates that the file has been corrupted. Can you shed some light on:

  • Is the file somehow manipulated from other places
  • How is the overall usage of the realm, app restart procedures, etc.
  • What is the frequency and how is it spread on various devices/Android versions And of course any other patterns that you might have noticed.

rorbech avatar Aug 09 '22 07:08 rorbech

@morevij Are you using compaction?

finnschiermer avatar Aug 09 '22 08:08 finnschiermer

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.

github-actions[bot] avatar Jan 17 '23 00:01 github-actions[bot]