Version Lock hashes do not match #262

Closed
opened 2025-12-29 15:27:50 +01:00 by adam · 3 comments
Owner

Originally created by @Angel-Avila on GitHub (Apr 11, 2019).

I'm not really sure what is happening. I'm getting the following error:

[CoreStore: Assertion Failure] CoreStoreSchema.swift:180 init(modelVersion:entityConfigurations:versionLock:)
↪︎ A 'VersionLock' was provided for the 'CoreStoreSchema' with version "1", but the actual hashes do not match. This may result in unwanted migrations or unusable persistent stores.
Expected lock values: [
"Pokemon": [0xa6, 0x0, 0x0, 0x0]
]
Actual lock values: [
"Pokemon": [0xa6, 0xfb, 0x4d, 0x4e]
]

But here is my stack initialization:

stack = DataStack(
            CoreStoreSchema(
                modelVersion: "1",
                entities: [Entity<Pokemon>("Pokemon")],
                versionLock: [
                    "Pokemon": [0xa6, 0x0, 0x0, 0x0]
                ])
        )

Also, if I delete the versionLock argument from the initialization and run the application I get the following message:

🔸 [CoreStore: Notice] CoreStoreSchema.swift:188 init(modelVersion:entityConfigurations:versionLock:)
↪︎ These are hashes for the 'CoreStoreSchema' with version name "1". Copy the dictionary below and pass it to the 'CoreStoreSchema' initializer's "versionLock" argument:
versionLock: [
"Pokemon": [0xa6, 0xfb, 0x4d, 0x4e]
]

Now, if I put that argument back as the output suggests and run the app, now I get:

Expected lock values: [
"Pokemon": [0xa6, 0x0, 0x0, 0x0]
]
Actual lock values: [
"Pokemon": [0xa6, 0xfb, 0x4d, 0x4e]
]

And if put the versionLock dictionary back with the suggested values, I'm back at square one so...I'm at a loss here.

Originally created by @Angel-Avila on GitHub (Apr 11, 2019). I'm not really sure what is happening. I'm getting the following error: > ❗ [CoreStore: Assertion Failure] CoreStoreSchema.swift:180 init(modelVersion:entityConfigurations:versionLock:) ↪︎ A 'VersionLock' was provided for the 'CoreStoreSchema' with version "1", but the actual hashes do not match. This may result in unwanted migrations or unusable persistent stores. Expected lock values: [ "Pokemon": [0xa6, 0x0, 0x0, 0x0] ] Actual lock values: [ "Pokemon": [0xa6, 0xfb, 0x4d, 0x4e] ] But here is my stack initialization: ``` stack = DataStack( CoreStoreSchema( modelVersion: "1", entities: [Entity<Pokemon>("Pokemon")], versionLock: [ "Pokemon": [0xa6, 0x0, 0x0, 0x0] ]) ) ``` Also, if I delete the `versionLock` argument from the initialization and run the application I get the following message: > 🔸 [CoreStore: Notice] CoreStoreSchema.swift:188 init(modelVersion:entityConfigurations:versionLock:) ↪︎ These are hashes for the 'CoreStoreSchema' with version name "1". Copy the dictionary below and pass it to the 'CoreStoreSchema' initializer's "versionLock" argument: versionLock: [ "Pokemon": [0xa6, 0xfb, 0x4d, 0x4e] ] Now, if I put that argument back as the output suggests and run the app, now I get: > Expected lock values: [ "Pokemon": [0xa6, 0x0, 0x0, 0x0] ] Actual lock values: [ "Pokemon": [0xa6, 0xfb, 0x4d, 0x4e] ] And if put the `versionLock` dictionary back with the suggested values, I'm back at square one so...I'm at a loss here.
adam added the duplicate label 2025-12-29 15:27:50 +01:00
adam closed this issue 2025-12-29 15:27:50 +01:00
Author
Owner

@JohnEstropia commented on GitHub (Apr 12, 2019):

@Angel-Avila Hi, this should have been fixed here: https://github.com/JohnEstropia/CoreStore/issues/311

Please update and let me know how it goes.

@JohnEstropia commented on GitHub (Apr 12, 2019): @Angel-Avila Hi, this should have been fixed here: https://github.com/JohnEstropia/CoreStore/issues/311 Please update and let me know how it goes.
Author
Owner

@Angel-Avila commented on GitHub (Apr 12, 2019):

@JohnEstropia I did see that post and did update before even posting this so I thought it was some other error. Maybe it didn't fix in some cases? It's my newest repo if that helps
Or if you need any more info just tell me

@Angel-Avila commented on GitHub (Apr 12, 2019): @JohnEstropia I did see that post and did update before even posting this so I thought it was some other error. Maybe it didn't fix in some cases? It's my newest repo if that helps Or if you need any more info just tell me
Author
Owner

@Angel-Avila commented on GitHub (Apr 12, 2019):

Just had to do a build folder clean with alt pressed. Thanks!

@Angel-Avila commented on GitHub (Apr 12, 2019): Just had to do a build folder clean with `alt` pressed. Thanks!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/CoreStore#262