-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Unable to initialize Realm - Invalid mnemonic #6061
Comments
Following tickets seem to be related: |
Can we get some kind've response for this issue? We are noticing this is happening to more and more of our users. The only remedy at the moment is to simply delete our application and re-install it. This can be very problematic for us as users may have critical business information on the device that has not synced up to our servers yet. |
All that error indicates is that the thing being opened isn't a Realm file; there's a field in the header of the file that should always contain the string "T-DB" and it doesn't. |
@tgoyne |
@tgoyne |
I don't really know what advice I can give. Your app is doing something which leads to it having something that isn't a Realm file at the path where a Realm file should be, so you'll need to track down what in your app is causing this to happen. There's not much in Realm itself that could cause this other than trying to open an encrypted realm without providing a key or a currently unknown bug. |
Hi @tgoyne I have the actual physical realm file if that is of use? All I know we do is we set the RLMRealmConfiguration, and we compact quite often. |
Hi @tgoyne I tried opening the Realm file in question using Realm Browser (v3.0.1) expecting it to fail, but I was able to open it. Is this expected behaviour? |
Hi @tgoyne Is there an update to my last finding? |
If you can open an unencrypted realm file in the browser but it gives the invalid mnemonic error when trying to open it from ios then you are probably not actually opening the same file. |
Hi Thomas,
The file is encrypted and it is the same file.
Would you like to examine it?
…Sent from my iPhone
On Feb 8, 2019, at 5:16 PM, Thomas Goyne <notifications@github.com<mailto:notifications@github.com>> wrote:
If you can open an unencrypted realm file in the browser but it gives the invalid mnemonic error when trying to open it from ios then you are probably not actually opening the same file.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#6061 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AHVamknxWuQEhj4SGYFQbhloHeRtw-QSks5vLfcngaJpZM4Z8Csb>.
|
Attempting to open an encrypted realm file without supplying an encryption key is very likely to give the invalid mnemonic error. |
I have the encryption key, which I used to open it.
Just to summarize:
1) I have the Realm file that is causing the mnemonic exception; it is encrypted
2) I have the encryption key to it
3) I am able to open the realm file using Realm browser
Would providing the file and key for your examination help us progress this strange problem?
…Sent from my iPhone
On Feb 8, 2019, at 6:01 PM, Thomas Goyne <notifications@github.com<mailto:notifications@github.com>> wrote:
Attempting to open an encrypted realm file without supplying an encryption key is very likely to give the invalid mnemonic error.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#6061 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AHVamrmCp-oTht3thd7QndXIHCieacKVks5vLgG6gaJpZM4Z8Csb>.
|
Being able to open the file when supplying the key in the browser but getting the not-a-realm-file error when opening it in the app suggests that in some edge case the app is failing to supply the key when opening the realm. If the file can be opened correctly in any cases then I have no idea what looking at the file could reveal. |
That’s an interesting theory. I’ll test this theory and report back my findings.
Thanks!
…Sent from my iPhone
On Feb 8, 2019, at 6:43 PM, Thomas Goyne <notifications@github.com<mailto:notifications@github.com>> wrote:
Being able to open the file when supplying the key in the browser but getting the not-a-realm-file error when opening it in the app suggests that in some edge case the app is failing to supply the key when opening the realm.
If the file can be opened correctly in any cases then I have no idea what looking at the file could reveal.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#6061 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AHVams2_fa8_XdCN4sX2cCL-KfXf07pqks5vLgulgaJpZM4Z8Csb>.
|
Hi @tgoyne I am able to open the database when I hardcode the encryption key as part of the default configuration setting. Based on this testing, it would suggest your theory might be correct. In the meantime, I'd like to close out this support issue. Thanks for your assistance. |
Hey - looks like you forgot to add a T:* label - could you please add one? |
Bugs: When trying to instantiate a DefaultRealm object, an exception occurs.
Goals
Instantiate a DefaultRealm successfully
Expected Results
Instantiate a DefaultRealm successfully
Actual Results
Exception with the stack trace
/var/mobile/Containers/Data/Application/DC37B002-A218-4074-9318-7142CB94BCE3/Documents/9937ECCF-85C5-43DD-BAE2-5A4DFFC61F4D/SceneDoc.realm: Unable to open a realm at path '/var/mobile/Containers/Data/Application/DC37B002-A218-4074-9318-7142CB94BCE3/Documents/9937ECCF-85C5-43DD-BAE2-5A4DFFC61F4D/SceneDoc.realm': Invalid mnemonic. top_ref[0]: D159356A000052FC, top_ref[1]: D6E09A922D56CF5A, mnemonic: 7F 5D 15 34, fmt[0]: 207, fmt[1]: 87, flags: FF.
(
0 CoreFoundation 0x000000018236eda4 + 252
1 libobjc.A.dylib 0x00000001815285ec objc_exception_throw + 56
2 Realm 0x0000000108b431a8 Z18RLMSetErrorOrThrowP7NSErrorPU15__autoreleasingS0 + 512
3 Realm 0x0000000108b1a54c _Z26RLMRealmTranslateExceptionPU15__autoreleasingP7NSError + 120
4 Realm 0x0000000108b1b8d4 _ZL33translateSharedGroupOpenExceptionP21RLMRealmConfigurationPU15__autoreleasingP7NSError + 512
5 Realm 0x0000000108b1b65c +[RLMRealm realmWithConfiguration:error:] + 2776
6 Realm 0x0000000108b19a60 +[RLMRealm defaultRealm] + 76
7 SceneDoc 0x0000000104c1cfc4 +[RealmController initRealm] + 380
8 SceneDoc 0x0000000104c1ce30 +[RealmController sharedInstance] + 56
9 SceneDoc 0x0000000104cb3658 -[LoginVC handleLoginSuccess] + 1436
10 SceneDoc 0x0000000104cb2f1c __32-[LoginVC loginCredentialsDone:]_block_invoke + 68
11 SceneDoc 0x000000010528f718 -[SDCBaseGCD performMainThreadCallSync:] + 104
12 SceneDoc 0x0000000104bc5754 -[SDCUserServiceGCDCall getAuthenticationToken:password:] + 3012
13 SceneDoc 0x0000000104e05798 __81-[SDCThriftGCDManager getAuthenticationToken:password:successBlock:failureBlock:]_block_invoke + 56
14 SceneDoc 0x000000010550e6b4 __NR__dispatch_after_block_invoke + 76
15 libdispatch.dylib 0x000000010914119c _dispatch_client_callout + 16
16 libdispatch.dylib 0x000000010914e454 _dispatch_continuation_pop + 588
17 libdispatch.dylib 0x0000000109142e64 _dispatch_source_invoke + 1368
18 libdispatch.dylib 0x0000000109145b6c _dispatch_main_queue_callback_4CF + 732
19 CoreFoundation 0x0000000182317070 + 12
20 CoreFoundation 0x0000000182314bc8 + 2272
21 CoreFoundation 0x0000000182234da8 CFRunLoopRunSpecific + 552
22 GraphicsServices 0x000000018421a020 GSEventRunModal + 100
23 UIKit 0x000000018c254758 UIApplicationMain + 236
24 SceneDoc 0x0000000104bdd838 main + 128
25 libdyld.dylib 0x0000000181cc5fc0 + 4
)
Steps to Reproduce
Not sure what causes it to happen, but right after we set the defaultConfiguration, if we call defaultRealm, the exception will occur.
Code Sample
N/A
Version of Realm and Tooling
Realm framework version: 3.7.6
Realm Object Server version: N/A
Xcode version: 10.1
iOS/OSX version: 10.14.2
The text was updated successfully, but these errors were encountered: