error: CoreData+CloudKit: Never successfully initialized and cannot execute request - incomprehensible archive

anyone getting the following error with CloudKit+CoreData on iOS16 RC? delete/resintall app, delete user CloudKit data and reset of environment don't fix.

[error] error: CoreData+CloudKit: -[NSCloudKitMirroringDelegate _requestAbortedNotInitialized:](2044): <NSCloudKitMirroringDelegate: 0x2816f89a0> - Never successfully initialized and cannot execute request '<NSCloudKitMirroringImportRequest: 0x283abfa00> 41E6B8D6-08C7-4C73-A718-71291DFA67E4' due to error: Error Domain=NSCocoaErrorDomain Code=4864 "*** -[NSKeyedUnarchiver _initForReadingFromData:error:throwLegacyExceptions:]: incomprehensible archive (0x53, 0x6f, 0x6d, 0x65, 0x20, 0x65, 0x78, 0x61)" UserInfo={NSDebugDescription=*** -[NSKeyedUnarchiver _initForReadingFromData:error:throwLegacyExceptions:]: incomprehensible archive (0x53, 0x6f, 0x6d, 0x65, 0x20, 0x65, 0x78, 0x61)}

still broken in iOS16 final

to fix this I had to reset the environment, let the record tables be recreated and then re-add the recordName and modifiedTimestamp indexes for the public database. exporting the environment schema and then reimporting didn't work.

This still happens in iOS17. anyone know a solution or a workaround? We cant be resetting the environment in production.

still happens in iOS18.0.1

This is happening to me in production, but not the development environment. CloudKit Dashboard also display an error when I try to query the affected Record Type. Any proper solution to this scenario? Ok in Development, fails in Production?

no solution yet. if it happens in dev then you can reset the environment. in prod you are screwed.

still happening in iOS18.3.1

I had this happen again when I was adding a couple new properties to my schema. I had forgotten to switch back to the development settings in the entitlements file and ran against production. It gave some errors and I remembered I needed to switch to development, run the app there so it could update the schema, then promote the schema to production. When I did that, I started getting those incomprehensible archive errors again.

So I looked at the records in the CloudKit dashboard and I noticed a couple entries that had the word FAKE in them in all caps. Didn't know how they got there, so deleted them.

Then switched back to production and everything worked again.

Oh, I did reset the development environment as well, but the problem was in production, not development. Those FAKE records were in production.

Seems to be working now. Phew!

I was worried I'd have to make all new entities and change the location of my CoreData store or something. Dodged a bullet I think.

error: CoreData&#43;CloudKit: Never successfully initialized and cannot execute request - incomprehensible archive
 
 
Q