-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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: Unable to open a realm at path #7301
Comments
Thanks for reporting the issue, we are currently investigating it. Are the affected users not able to use the app, or are these random crashes? |
They can't use the app, because those who are having this problem are having it every time the app tries to open the DB. The Init block is in the Application OnCreate function. |
@vernazza Does the issue happen on fresh installs/reinstalls or are they ending up there after a while? If on fresh installs would you be able to list the exact devices it is happening on? |
Actually they are not fresh installs, but before that version, realm was not used, so it's the first time that those users use realm. The problem seems to be on the creation of the DB file. The devices that had the problems are Samsung Galaxy A51, Samsung Galaxy S9, Huaweu JNY-LX1. All 3 are Android 10 |
Are you by any chance able to get a realm file from a device where this happens are able to share it or open it on a local device? And do you know whether it reoccurs if the app is uninstalled and installed again? |
Update. Models:
So, it doesn't seem to be related to a specific vendor or to a specific OS |
Sorry, where it happens the DB is not created, so there is nothing to retrieve. |
I have been getting the same exception since migrating to realm 10.3.0 Implementation
Calling Function
Full trace
Affected devices Affected OSes Android 5.1.1(29%), 9(14%) and 7(57%) Tooling
This is happenning in production and I'm yet to reproduce it on debug. +++ Our users have reported that the app works if they uninstall and reinstall |
Hello @adhiamboperes. Just out of curiosity: you mention you started seeing this crash after migrating to 10.3.1. Which version did you migrate from? And to be 100% sure, you were and are not using encryption in the database, right? |
I am seeing this in v10.3.0. i updated from realm v10.2.0 @edualonso |
It seems that the problem is related to an incomplete DB while copying from the assets. I solved my problem like this:
and calling this instead of BTW, I also tried reverting to Realm 10.0.0 and I kept getting the problem. |
Thanks @vernazza , I'll try this fix and update if it helps |
Reproduced today. Crash happened in production and probably on the fresh install. Realm version: 10.3.1 Device: OUKITEL WP7, Android 9 init process:
|
@clementetb i am also facing this issue
|
@mahmoudElfeel67 This is not the same issue. Please create another github issue. Thanks! |
I am reading your snippet and I noticed that on your Is that App initialization code triggered at all? |
Having the same issue. The realm file turns into a malformed file for some reason randomly. Couldnt Find the real cause. Realm Version: 10.10.1 Can the realm malformation happen if the user left the process while the realm transaction occurs?
|
Realm 10.10.1 D/AndroidRuntime: Shutting down VM
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.coolme.me.square18, PID: 11723
java.lang.ExceptionInInitializerError: RealmTransformer doesn't seem to be applied. Please update the project configuration to use the Realm Gradle plugin. See https://docs.mongodb.com/realm/sdk/android/install/#customize-dependecies-defined-by-the-realm-gradle-plugin
at io.realm.RealmConfiguration.<clinit>(RealmConfiguration.java:80)
at io.realm.RealmConfiguration.access$000(RealmConfiguration.java:68)
at io.realm.RealmConfiguration$Builder.initializeBuilder(RealmConfiguration.java:552)
at io.realm.RealmConfiguration$Builder.<init>(RealmConfiguration.java:538)
at io.realm.Realm.initializeRealm(Realm.java:320)
at io.realm.Realm.init(Realm.java:261)
at com.coolme.me.square18.MyApplication.onCreate(MyApplication.kt:15)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1223)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6734)
at android.app.ActivityThread.access$1500(ActivityThread.java:256)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2090)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7842)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
I/Process: Sending signal. PID: 11723 SIG: 9 |
I found the solution: Use Kotlin SDK instead of Java SDK |
Hint - 99% crashes are heppening in the background only, when workmanger is getting triggered. |
Hi, I was debugging my app and I just bumped in what seems to be the same issue.
The application was working just fine, did a few changes not Realm reladed to the code and suddenly it started throwing this error. It's an Android application in Kotlin and: Let me know if I can help in any way with the debug. Kind regards, |
I am running into this issue on Android(The app is ReactNative), iOS works fine. We get the following exception. This is happening mostly on Samsung devices.
When I split the Realm file(using the split command) and only use the first part I get a similar crash as above. I think this points to the Realm file not being copied properly. This is happening to quite a lot of users. On Android, the assets are compressed by default so I think that might be interfering with the copying process. |
Hi @susonthapa. This repository is for |
Caused by io.realm.exceptions.RealmFileException if anyone got the solution , please help me to get myself out of it. Thanks |
In my case, I identified the root cause of the issue as the version of the Android application being used by our users, which was 1.0.1. Upon attempting to update to the newer version 1.0.2, I encountered an issue with realm encryption file access. While reviewing the changes I had made, I realized that I had modified the application name from 'x' to 'y'. This change impacted the encryption key generated from KeyPairGeneratorSpec, which was based on the application name. To resolve the issue, I re-added the previous application name for key pair generation, in addition to other feature changes made in the application. This successfully resolved the issue with realm encryption file access. |
actually i am also getting error on update , when user update the app from playstore it get crash . while uninstalling the previous and installing the new one went well, app name is same for both the versions |
I'm facing the same issue by now:
|
Can you check by any chance if you updated your app name? |
I have already looked into that but no because we use the app identifier and the apps are live for a while (+/- 4 years) |
Do you have compaction enabled in your Realm? |
No |
I got my answer to this issue on the issue below: |
I'm also facing the same problem. This issue seems to occur intermittently, affecting only certain devices while most work fine. After analyzing the pattern, the error appears more likely to occur when the system marks the application as "unused" and initiates the power-saving or sleep mode. This leads me to hypothesize that the error might be connected to the system's attempt to put the application to sleep, affecting the Realm database operations. |
+1, crash happens most of the time in the background 91%. Also it is in 4 sec after user start session. Also most crashes on Xiaomi devices 92%. |
Some users facing same issue after I updated the realm version from 6.0.2 to 10.11.1 app crashing when updated from play store and works fine when freshly installed default.realm': Invalid top array size same as @tfkci |
Goal
Open a realm database
Actual Results
In a few devices, Realm cannot initialize the file and it throws an exception:
Steps & Code to Reproduce
I cannot replicate the problem. I have the crash reports from open test users.
This is how I initialize the DB in the app
Then, later, the first time I do
Realm.getDefaultInstance()
it crashes for some users.
Version of Realm and tooling
Realm version(s): 10.3.1
Realm Sync feature enabled: No
Android Studio version: 4.1.2
Android Build Tools version: 4.1.2
Gradle version: 6.8.1
Which Android version and device(s):
at the moment it happened on different Samsung models with Android 10
Affected users are about 0.3% of the open tests user base
The text was updated successfully, but these errors were encountered: