-
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
Opening Realm files of format version 5 is not supported by this version of Realm #7089
Comments
v5.0.0 dropped support for opening Realm files written by versions before v3.0.0. It's not obvious to me why we don't support opening file format version 5. We support migrating from 6+ and the 5->6 migration just consisted of recreating the string indexes. |
Thank You for the reply. I'm disappointed and have regrets now on using Realm. I'm not sure of a way to update the old Realm files for all the people that downloaded my app on the app store without deleting the old realm file and getting negative reviews. This is a real pickle. Thank you anyways. |
Based on some internal conversations it sounds like restoring support for opening file format version 5 won't be a problem. |
I am kind of puzzled here. As far as I can tell file format version 6 goes back to version 2.0.0, which is from 2016. Are you upgrading from a file that old? |
The Realm release notes said the problem was fixed but the problem persists. I've opened question on stack overflow that shows all my information:
https://stackoverflow.com/questions/66000503/opening-realm-files-of-format-version-5-is-not-supported-by-this-version-of-real
Goals
Open a older realm file. The realm file has the exact schema version. No classes, attributes or anything has changed in the schema. The code works perfect as long as a Realm file doesn't exist already.
Expected Results
Realm file to be read without crashing.
Actual Results
Fatal error: 'try!' expression unexpectedly raised an error: Error Domain=io.realm Code=6 "Opening Realm files of format version 5 is not supported by this version of Realm" UserInfo={Error Code=6, NSFilePath=/var/mobile/Containers/Data/Application/04864A2A-4605-49B2-893F-15F76F60DD9B/Documents/default.realm, Underlying=Database has an unsupported version (5) and cannot be upgraded Exception backtrace:
0 Realm 0x000000010104e4ac _ZN5realm2DB7do_openERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbbNS_9DBOptionsE + 5356 1 Realm 0x0000000101050694 _ZN5realm2DB4openERNS_11ReplicationENS_9DBOptionsE + 244
2 Realm 0x000000010105517c _ZN5realm2DB6createERNS_11ReplicationENS_9DBOptionsE + 392
3 Realm 0x0000000100b5cf40 _ZN5realm5_impl16RealmCoordinator7open_dbEv + 992
4 Realm 0x0000000100b5c148 _ZN5realm5_impl16RealmCoordinator12do_get_realmENS_5Realm6ConfigERNSt3__110shared_ptrIS2_EENS_4util8OptionalINS_9VersionIDEEERNS8_17CheckedUniqueLockE + 68
5 Realm 0x0000000100b5bf64 _ZN5realm5_impl16RealmCoordinator9get_realmENS_5Realm6ConfigENS_4util8OptionalINS_9VersionIDEEE + 668
6 Realm 0x0000000100e4f204 _ZN5realm5Realm16get_shared_realmENS0_6ConfigE + 176
7 Realm 0x0000000100db93d4 ﹍[RLMRealm realmWithConfiguration:queue:error:]﹍ 1796
8 RealmSwift 0x0000000102a6f478 $sSo8RLMRealmC13configuration5queueABSo0A13ConfigurationC_So012OS_dispatch_C0CSgtKcfCTO + 156
9 RealmSwift 0x0000000102ac8734 $s10RealmSwift0A0V13configuration5queueA2C13ConfigurationV_So012OS_dispatch_D0CSgtKcfC + 216
10 Vending Receipt 0x000000010050d0cc $s15Vending_Receipt0B7StorageC11getReceipts_5sort15sort29ascending10RealmSwift7ResultsVyAA0B0CGSS_S2SSbtF + 1572
11 Vending Receipt 0x00000001004e4868 $s15Vending_Receipt14SearchReceiptsC11UpdateTableyyF + 1980
12 Vending Receipt 0x00000001004e11d0 $s15Vending_Receipt14SearchReceiptsC11viewDidLoadyyF + 5768
13 Vending Receipt 0x00000001004e1250 $s15Vending_Receipt14SearchReceiptsC11viewDidLoadyyFTo + 32
14 UIKitCore 0x00000001a72f2e50 CC6E5AC7-8248-35F6-8B42-2E25C93DCF0A + 4623952
15 UIKitCore 0x00000001a72f7408 CC6E5AC7-8248-35F6-8B42-2E25C93DCF0A + 4641800
16 UIKitCore 0x00000001a72f77e8 CC6E5AC7-8248-35F6-8B42-2E25C93DCF0A + 4642792
17 UIKitCore 0x00000001a722b738 CC6E5AC7-8248-35F6-8B42-2E25C93DCF0A + 3807032
18 UIKitCore 0x00000001a723fbb0 CC6E5AC7-8248-35F6-8B42-2E25C93DCF0A + 3890096
19 UIKitCore 0x00000001a7240fe0 CC6E5AC7-8248-35F6-8B42-2E25C93DCF0A + 3895264
20 UIKitCore 0x00000001a7223e78 CC6E5AC7-8248-35F6-8B42-2E25C93DCF0A + 3776120
21 UIKitCore 0x00000001a7ec2398 CC6E5AC7-8248-35F6-8B42-2E25C93DCF0A + 17007512
22 QuartzCore 0x00000001a83c7df4 461501DD-204F-3516-9F5D-BDD0BA19FDA1 + 1400308
23 QuartzCore 0x00000001a83ce398 461501DD-204F-3516-9F5D-BDD0BA19FDA1 + 1426328
24 QuartzCore 0x00000001a83d96e8 461501DD-204F-3516-9F5D-BDD0BA19FDA1 + 1472232
25 QuartzCore 0x00000001a8324d7c 461501DD-204F-3516-9F5D-BDD0BA19FDA1 + 732540
26 QuartzCore 0x00000001a834ef40 461501DD-204F-3516-9F5D-BDD0BA19FDA1 + 905024
27 UIKitCore 0x00000001a79b6d8c CC6E5AC7-8248-35F6-8B42-2E25C93DCF0A + 11718028
28 UIKitCore 0x00000001a7a5dac4 CC6E5AC7-8248-35F6-8B42-2E25C93DCF0A + 12401348
29 UIKitCore 0x00000001a7a54afc CC6E5AC7-8248-35F6-8B42-2E25C93DCF0A + 12364540
30 CoreFoundation 0x00000001a50cdbf0 F3021642-E3C0-33F8-9911-DD303A6056D0 + 633840
31 CoreFoundation 0x00000001a50cdaf0 F3021642-E3C0-33F8-9911-DD303A6056D0 + 633584
32 CoreFoundation 0x00000001a50cce38 F3021642-E3C0-33F8-9911-DD303A6056D0 + 630328
33 CoreFoundation 0x00000001a50c73e0 F3021642-E3C0-33F8-9911-DD303A6056D0 + 607200
34 CoreFoundation 0x00000001a50c6ba0 CFRunLoopRunSpecific + 572
35 GraphicsServices 0x00000001bbe2f598 GSEventRunModal + 160
36 UIKitCore 0x00000001a79b82f4 CC6E5AC7-8248-35F6-8B42-2E25C93DCF0A + 11723508
37 UIKitCore 0x00000001a79bd874 UIApplicationMain + 164
38 Vending Receipt 0x00000001004d3444 main + 88
39 libdyld.dylib 0x00000001a4da5568 0B475C78-3C12-3121-B7F8-2B95B83DAF44 + 5480, NSLocalizedDescription=Opening Realm files of format version 5 is not supported by this version of Realm}: file Vending_Receipt/ReceiptModel.swift, line 52 2021-02-01 15:16:21.102889-0600 Vending Receipt[558:58472] Fatal error: 'try!' expression unexpectedly raised an error: Error Domain=io.realm Code=6 "Opening Realm files of format version 5 is not supported by this version of Realm" UserInfo={Error Code=6, NSFilePath=/var/mobile/Containers/Data/Application/04864A2A-4605-49B2-893F-15F76F60DD9B/Documents/default.realm, Underlying=Database has an unsupported version (5) and cannot be upgraded
Steps for others to Reproduce
Code Sample
let realm = try! Realm()
Version of Realm and Tooling
tee /dev/tty | pbcopy
ProductName: macOS
ProductVersion: 11.1
BuildVersion: 20C69
/Applications/Xcode.app/Contents/Developer
Xcode 12.4
Build version 12D4e
/Users/Paul/.rvm/rubies/ruby-2.4.1/bin/pod
1.10.1
Realm (10.5.1)
RealmSwift (10.5.1)
/bin/bash
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin20)
/usr/bin/git
git version 2.24.3 (Apple Git-128)
The text was updated successfully, but these errors were encountered: