realm / realm-browser-osx

DEPRECATED - Realm Browser for Mac OS X has been replaced by realm-studio which is cross platform.
https://realm.io
503 stars 54 forks source link

Please enter a valid encryption key for this Realm file #371

Closed rahulmenezes closed 6 years ago

rahulmenezes commented 7 years ago

I get the following message when trying to open a realm file: "Please enter a valid encryption key for this Realm file".

Last time I saw this, I solved the issue by upgrading to the latest Realm Browser version but I am already on the latest version this time.

Realm Browser: 3.0.1 Realm version 4.1.0

bmunkholm commented 7 years ago

Can you open it fine from the app? Then the file is ok, and it certainly sounds like a mismatched version. If you can't open the file from your app, then it's likely corrupted.

rahulmenezes commented 7 years ago

This is a customer's realm file. He is able to use the app fine, however when he sends feedback(which has the realm file in it) we cannot open it in realm browser. When I import his realm into my emulator and try to open it, I get a "Bad File Header(#1)" error.

bmunkholm commented 6 years ago

@rahulmenezes And I assume you are not using encryption? Is it just one user? It could then be corrupt.

rahulmenezes commented 6 years ago

We are using encryption. We just had another user have this issue too. I wonder if it has something to do with the compactOnLaunch() parameter we recently added.

bmunkholm commented 6 years ago

Well if it is encrypted, you need to enter the encryption key to open it in the browser.

rahulmenezes commented 6 years ago

Yes and when I do enter the key I get this message: ""Please enter a valid encryption key for this Realm file".

bdash commented 6 years ago

What format are you entering the encryption key in? I believe the browser expects the hex representation of the key to be entered.

rahulmenezes commented 6 years ago

Yes, I am entering the 128-character string of the hex password.

bmunkholm commented 6 years ago

@rahulmenezes Can you please validate that you can create another encrypted file with the key, and open it with the browser? If you can then at least we know that you enter the key correctly, and then it seems like the file may be corrupted. If that's the case, then I, unfortunately, don't think there is much we can do.

bmunkholm commented 6 years ago

closing this for now. Let me know if you continue to have trouble.

ivnsch commented 6 years ago

Where do I find the encryption key (not setting any in my code)? Using Realm Browser 3.0.1 and RealmSwift 3.7.5