realm / realm-swift

Realm is a mobile database: a replacement for Core Data & SQLite
https://realm.io
Apache License 2.0
16.31k stars 2.14k forks source link

Unable to open encrypted realm file after upgrade from RealmSwift 5.3.5 to 10.1.1 #6907

Closed chajuss closed 3 years ago

chajuss commented 3 years ago

I have an iOS app that used Realm Swift 5.3.5 as an internal database. We were had our realm file encrypted, and were able to open it using Realm Studio 5.0.1.6 with our stored key.

After upgrading to Realm Swift 10.1.1, we're unable to open the file in Realm Studio 5.0.1 as we get the following error: Opening Realm files of format version 20 is not supported by this version of Realm

Using MongoDB Realm Studio 10.0.0.4, I have the following error:

`Unable to open a realm at path '/Users/oric/Documents/new realm/***.realm': Realm file initial open failed Path:Exception backtrace: 0 .com.mongodb.realm-studio.kTxtnK 0x000000010dba19d1 _ZN5realm15InvalidDatabaseC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS19allocatorIcEEEES9

Version of Realm and Tooling

Realm framework version: 5.3.5 - 10.1.1

Realm Object Server version: - N/A

Xcode version: 12.1

iOS/OSX version: 14.1

Dependency manager + version: cocoapods 1.10.0

leemaguire commented 3 years ago

@chajuss Please use Realm Studio v10 to open your Realm file https://github.com/realm/realm-studio/releases/tag/v10.0.0

chajuss commented 3 years ago

@chajuss Please use Realm Studio v10 to open your Realm file https://github.com/realm/realm-studio/releases/tag/v10.0.0

@leemaguire Thanks for the fast reply, however please read carefully my post: I did try to open with Realm Studio v10 and got the exception backtrack I've provided.

leemaguire commented 3 years ago

@chajuss could you send the Realm file to lee.maguire@mongodb.com so we an investigate. Also are you seeing this issue with any other Realm files you have?

chajuss commented 3 years ago

@leemaguire I've sent you the file to provided email. This occurs with every Realm file we are using (all are structured the same as provided one), and we don't have any other types of Realm files to test with.

leemaguire commented 3 years ago

@chajuss Are you using compaction, or did you do any schema changes during the upgrade?

chajuss commented 3 years ago

@leemaguire not using compaction, but did a schema change during the upgrade

leemaguire commented 3 years ago

Linking https://github.com/realm/realm-studio/pull/1351 as it may serve as the solution.

leemaguire commented 3 years ago

@chajuss does the latest version of Realm Studio solve your issue?

chajuss commented 3 years ago

@leemaguire I'll check and post an update ASAP

chajuss commented 3 years ago

Using Version 10.1.2 (10.1.2.43) solved the issue. Thanks!