Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RealmFileException: Top ref outside file #6497

Closed
JoyHong opened this issue Apr 22, 2019 · 7 comments
Closed

RealmFileException: Top ref outside file #6497

JoyHong opened this issue Apr 22, 2019 · 7 comments

Comments

@JoyHong
Copy link

JoyHong commented Apr 22, 2019

main(1)

io.realm.exceptions.RealmFileException

Unable to open a realm at path '/data/data/packageName/files/userprofile.realm': Top ref outside file (size = 108824). top_ref[0]: 1AA78, top_ref[1]: 1A9F8, mnemonic: 54 2D 44 42, fmt[0]: 9, fmt[1]: 9, flags: 0 Path:. (Top ref outside file (size = 108824). top_ref[0]: 1AA78, top_ref[1]: 1A9F8, mnemonic: 54 2D 44 42, fmt[0]: 9, fmt[1]: 9, flags: 0 Path: /data/data/packageName/files/userprofile.realm) (/data/data/packageName/files/userprofile.realm) in /Users/cm/Realm/realm-java-release/realm/realm-library/src/main/cpp/io_realm_internal_OsSharedRealm.cpp line 101

The relation crash report so much that i don't known how to fix it, can u please give me a help?

@bmunkholm
Copy link
Contributor

bmunkholm commented May 6, 2019

@JoyHong IS this from a user or something you can reproduce? Which version of Realm are you using?
Please use the issue template to report issues as that ensures to answer some questions.
Can you provide the realm file?

@JoyHong
Copy link
Author

JoyHong commented Oct 25, 2019

Sorry,the issue is reported from Google Play console

I can not reproduce it

@cmelchior
Copy link
Contributor

Are you using encryption?

@JoyHong
Copy link
Author

JoyHong commented Oct 28, 2019

No

@Zhuinden
Copy link
Contributor

Are you by any chance using pre-bundled Realm file or downloading it from remote?

File copying can fail and you'd end up with an incomplete file. It's happened to me before.

@cmelchior cmelchior changed the title io.realm.exceptions.RealmFileException Top ref outside file RealmFileException: Top ref outside file Nov 27, 2019
@lucaspommateau
Copy link

lucaspommateau commented Jul 28, 2020

Hello,
I have the same error in production, on an Android application.

  • Realm version: 6.1.0
Stacktrace
Fatal Exception: io.realm.exceptions.RealmFileException: Unable to open a realm at path '/data/data/mypackage/files/my_database.realm': Top ref outside file (size = 458752). top_ref[0]: 3031500000410E0, top_ref[1]: 46020200, mnemonic: 54 2D 44 42, fmt[0]: 9, fmt[1]: 9, flags: 0 Path:Exception backtrace:
<backtrace not supported on this platform>. (Top ref outside file (size = 458752). top_ref[0]: 3031500000410E0, top_ref[1]: 46020200, mnemonic: 54 2D 44 42, fmt[0]: 9, fmt[1]: 9, flags: 0 Path: /data/data/mypackage/files/my_database.realm
Exception backtrace:
<backtrace not supported on this platform>) (/data/data/mypackage/files/my_database.realm) in /Users/cm/Realm/realm-java-release/realm/realm-library/src/main/cpp/io_realm_internal_OsSharedRealm.cpp line 101
     at io.realm.internal.OsSharedRealm.nativeGetSharedRealm(OsSharedRealm.java)
     at io.realm.internal.OsSharedRealm.<init>(OsSharedRealm.java:171)
     at io.realm.internal.OsSharedRealm.getInstance(OsSharedRealm.java:241)
     at io.realm.internal.OsSharedRealm.getInstance(OsSharedRealm.java:231)
     at io.realm.RealmCache.doCreateRealmOrGetFromCache(RealmCache.java:337)
     at io.realm.RealmCache.createRealmOrGetFromCache(RealmCache.java:290)
     at io.realm.Realm.getDefaultInstance(Realm.java:407)
     at com.groupeseb.moddatatracking.api.data.local.EventLocalDataSource$12.run(EventLocalDataSource.java:206)
     at android.os.Handler.handleCallback(Handler.java:900)
     at android.os.Handler.dispatchMessage(Handler.java:103)
     at android.os.Looper.loop(Looper.java:219)
     at android.app.ActivityThread.main(ActivityThread.java:8347)
     at java.lang.reflect.Method.invoke(Method.java)
     at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1055)
  • Device:
    image
  • Version:
    image
  • I do not use encryption
  • I do not use pre-bundled realm file or downloaded one
    I have no reproduction 😞

@cmelchior
Copy link
Contributor

Since the underlying implementation changed drastically in Realm Java 7.0.0. I'm closing this as outdated. Please re-open if you are still seeing this on 7.0.2 and above.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants