Core Data + Cloud Kit - Updating to macOS 13.3 causing migration fail

Hi there,

Had no issues with Core Data and Cloud Kit syncing. Then, when I updated my macOS to 13.3, I am getting the following error from cloud kit:

reason=Can't find or automatically infer mapping model for migration, NSUnderlyingError=0x60000367b330 {Error Domain=NSCocoaErrorDomain Code=134190 "(null)" UserInfo={entity=Item, property=image, Reason=Unable to use inferred mapping to move external reference into store.}}}

The reason I think it's due to the macOS update is because my cloud kit initialization and syncing has no trouble on my phone simulator or physical devices. Also, I didn't change my model in any significant way, and checking out old versions of my code lead to the same error.

Has anyone else experienced issues with Core Data migration on macOS 13.3? Or can anyone explain why I might see this issue on macOS specifically?

NSPersistentStoreDescription(url: storeURL)

^ Updating the storeURL above resolves the issue on macOS. I suppose the sandbox on my macOS device was incompatible with my iCloud data for some reason. Need to investigate further, but I think this at least allows for a temporary work around.

Core Data + Cloud Kit - Updating to macOS 13.3 causing migration fail
 
 
Q