-
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
Realm file initial open failed #7088
Comments
@ragu-pth it looks like your check to see if the file exists should come before |
@leemaguire That is the check to see if the file exists, and if so, return the existing configuration file.
As mentioned in the ticket, this code works perfectly on many runs of the app, but then suddenly, on the (N+1)th run, it will fail with the above error and then proceed to throw that error on every subsequent run unless the app is deleted. Pulling realm files off via XCode, the persistent realm can't be opened by the Realm Browser, saying it needs an encryption key, despite never being set up with an encryption key and not needing one on previous runs. The transient realm opened just fine, despite it being created in the exact same manner since both realm configurations are created in the code snipped I sent. |
Just got the error again after several successful runs with the app.
|
Is there any way to get help on this issue? |
@ragu-pdx Are you still seeing your issue with the latest version of Realm? |
@leemaguire The issue is hard to reproduce, but we have seen it on newer versions of Realm. We only just installed 10.13, so it will be a little while to truly know whether it comes about or not. What explicit changes have occurred on the Realm source to address this issue, and what is your understanding / hypotheses as to the root cause of this issue? |
Hi @ragu-pdx, we haven't been able to reproduce your issue. Have you updated to our latest version?, are you still getting this error?, If that's the case can you send us the realm file which we are not able to open, this will give us a clue to what could be happening. |
Hi @ragu-pdx, we haven't been able to reproduce your issue. Have you updated to our latest version?, are you still getting this error?, If that's the case can you send us the realm file which we are not able to open, this will give us a clue to what could be happening. |
Closing this issue as there is no response from the user. @ragu-pdxif you are still experiencing this issue, you can post a message and we will reopen the issue and look more into it |
!!! MANDATORY TO FILL OUT !!!
Goals
Reliably open Realm files when iOS application launches.
Expected Results
No Realm database crashes when opening a known realm within iOS app
Actual Results
Randomly on app launches, the Realm will fail to open and fail on every subsequent launch. Every call to persistentRealm fails with this same error.
Attempting to download the Realm from the device through XCode and opening in Realm Studio, it states that the persistentRealm is encrypted even though it was never set as encrypted (see code below). Transient Realm is created the exact same way, and it is able to be opened with Realm Studio.
Steps for others to Reproduce
Difficult to reliably reproduce as it doesn't occur on every run from a fresh application install. The application is using CoreBluetooth with background permissions to retrieve data in the background and store it to a realm db.
Code Sample
User+Realm.swift
Retrieves the proper realm;
user.peristentRealm
is the property called and crashing. The file definitely exists as it worked on many previous application launches, and then, suddenly on a subsequent run, it fails. Once it fails on a run, ever subsequent app launch will fail with the same error.Version of Realm and Tooling
Realm framework version: 10.5.1
Realm Object Server version: None
Xcode version: 12.4
iOS/OSX version: 14.4
Dependency manager + version: Cocoapods 1.10.0
The text was updated successfully, but these errors were encountered: