-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Inconsistent "Unable to open a realm at path" exceptions after upgrading to 0.98.6 #3426
Comments
Can anyone help me with this? It's happening to a considerable amount of our users now, and we didn't see this error once on previous versions of Realm. Could this be related with this, where some users that ran into that issue are left with a corrupted realm file? The error message is very generic so that doesn't help, neither the fact that we can't reproduce it. If this keeps happening we'll have to move out of Realm. Thanks. |
The generic Do you have any reason to think that #3422 would be resulting in a corrupted Realm file? If so, we'd appreciate details so we can understand and address that. An exception during a migration block shouldn't be able to corrupt the Realm file. |
No particular reason to think that #3422 is related, only that crashes from that report were pretty strange and they were happening during the execution of a migration block, so that could have corrupted the Realm file. If that shouldn't happen then nothing else changed on the app side other than migrating from 0.96.2 to 0.98.6. Do you have any ETA on when #3438 will be available? Anything else I can help with for figuring it out? Thanks |
We have no ETA on #3438 at this time. Are you able to reproduce this at all yourself? Are you in contact with any users that are able to reproduce this? Being able to retrieve a Realm file that is hitting this issue would provide more information about what's going on here. |
Just following up on @bdash's last comment:
|
I've been trying to reproduce this myself and couldn't. I waited to respond to this to see if submitting a new version of the app with the latest Realm version would help, but it's been live for a few days now and it didn't. Unfortunately I couldn't find any users experiencing this that are also geographically close to me yet so no way to get ahold of a problematic Realm file. I'll keep trying to find a way to reproduce it - any pointers would be appreciated. |
Woo! I also got this crash, and with these Realm files! Any way to fix it? |
@justinWShJ could you please open a new issue with a detailed bug report including exact steps to reproduce? I can open the file you shared fine in the Realm Browser version 0.101. |
I'm closing this issue since no one has been able to reproduce similar issues. #3560 was recently merged, which should help diagnose issues relating to accessing files moving forward. |
I've updated to 1.0.1, error is still present - the traces now include some more detail and are one of the following two variants: 1:
2:
And for 2) I have no idea what could be causing a bad file header - is there any way to recover from that? Thanks. |
Sorry to hear you're still having trouble with this. I've reopened the issue for you.
Is it possible this device is jailbroken and the permissions for this location were changed?
A bad Realm file header indicates a corrupted file, which can happen if non-Realm APIs were used to touch the file at all. This commonly happens when users attempt to replace, delete or update a Realm file using system file manager APIs while continuing to access the file using Realm APIs. |
Thanks for the response and reopening the issue.
According to Crashlytics the users having this issue are not jailbroken.
It would be strange that the reason for this is file manipulation, specially considering that this started happening exactly after updating to a newer Realm version. Maybe this is indeed related with #3422, where users that had that problem are now left with a corrupted file, despite @bdash's intuition that there's no relation. I would try to reproduce it but besides being intricate, chances of being able to actually reproduce it are slim - I'd need to somehow create a realm file pre-0.96.2 for an older schema version, then 'update' to 0.96.2 and to the latest schema version, run the migration and hope for #3422 to appear, then update to a newer realm version, create a release build, run the app, and hope for the bad header issue to appear. If there's suspicion from you guys that there could be a link between these two I can try - otherwise, any other suggestion? Last resort I will just recreate the file when this exception happens, but I'd like to avoid that, anything not synchronized to our servers at that point will be lost. |
I'm sorry for the lack of response, @maxneust, I haven't had anything very useful to write back. If you do manage to reproduce this and share how we can too, I'll gladly investigate this further. Would it be possible to send us one of the affected Realm files so we can see what went wrong? We might be able to retrieve some data from it. |
I have this issue now. Next code in 1.0.2 version of Realm:
Sometimes I get next error:
Sometimes I get next one: |
@borzh: Is this issue reproducible for you on your own device? |
My bad, I am working on a project with a team and I didn't realized that meanwhile in one thread Realm was reading/saving database, in the other thread the Realm database was being deleted (via normal file deletion, lol). |
Thanks for following up @borzh. I'll be closing this again for lack of any new information. |
I am facing the same issue when using realm-java alongside realm-js for a React Native app. When the app is re-opened, I am able to access the realm file from native code. Don't know what exactly the reason behind the issue. The crash just logs the below error: |
I had the same issue and tried too many ways to fix it. Once you created this folder and run the project, XCode creates the Realm files inside this folder automatically. |
I've updated to 0.98.6, and a few of our users started getting this issue when calling [RLMRealm defaultRealm] on initialization. I've never seen this type of crash before, only on 0.98.6.
Goals
Open the default realm.
Expected Results
Default realm opened and ready to use.
Actual Results
Realm not opened, crash.
Steps to Reproduce
Can't reproduce it consistently - this only started happening in the latest version of the app, which included a Realm update from 0.96.2 to 0.98.6. It occurs to 1-5% of our users.
Code Sample
This is the initialization code that crashes on the [RLMRealm defaultRealm] call.
Version of Realm and Tooling
BuildVersion: 15B42
/Applications/Xcode.app/Contents/Developer
Xcode 7.3
Build version 7D175
/Users/maxi/.rvm/gems/ruby-2.2.1/bin/pod
0.39.0
Realm (0.98.6)
/bin/bash
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin15)
(not in use here)
/usr/local/bin/git
git version 2.5.0
The text was updated successfully, but these errors were encountered: