SwiftData + iCloudkit sync Error

In my Swiftui - SwiftData based Application I get the following error after running it both on simulator and real device... The App itself runs, and all Cloudkit requirements are met on data model side. So the problem is, that it is simply no syncing to iCloud:

error: CoreData+CloudKit: -[NSCloudKitMirroringDelegate _performSetupRequest:]_block_invoke(): <NSCloudKitMirroringDelegate: 0x282648620>: Failed to set up CloudKit integration for store: <NSSQLCore: 0x10440b270> (URL: file:///var/mobile/Containers/Data/Application/731332F0-B79C-4433-AF57-875C3CC72FCD/Library/Application%20Support/default.store) <CKError 0x28112d860: "Partial Failure" (2/1011); "Failed to modify some record zones"; uuid = 98551939-72A4-4EBB-BB0E-6E6D87DCE285; partial errors: { com.apple.coredata.cloudkit.zone:defaultOwner = <CKError 0x281112070: "Server Rejected Request" (15/2001); "Request failed with http status code 500"; uuid = 98551939-72A4-4EBB-BB0E-6E6D87DCE285> }> error: CoreData+CloudKit: recoverFromError:](): <NSCloudKitMirroringDelegat> - Attempting recovery from error: <CKError 0x28112d860: "Partial Failure" (2/1011); "Failed to modify some record zones"; uuid = 98551939-72A4-4EBB-BB0E-6E6D87DCE285; partial errors: { com.apple.coredata.cloudkit.zone:defaultOwner = <CKError 0x281112070: "Server Rejected Request" (15/2001); "Request failed with http status code 500"; uuid = 98551939-72A4-4EBB-BB0E-6E6D87DCE285> }> error: CoreData+CloudKit: _recoverFromError:withZoneIDs:forStore:inMonitor:](): <NSCloudKitMirroringDelegate: 0x282648620> - Failed to recover from error: CKErrorDomain:15 Recovery encountered the following error: (null):0

Can anyone help me with this Problem Thank you!

Kind Regards Chris

500s do happen. You'll need to file a feedback report with a sysdiagnose for us to provide more info about why though. The CoreData error doesn't capture the requestID from CloudKit, that information is in your application's logs from sender = "CloudKit".

SOLVED:

In the .entitlements File there was a record Missing:

Key: App Sandbox Type: Bool Value: YES

Somehow according to some tutorials this entitlement needs to be added in order for the cloud sync to work.

SwiftData + iCloudkit sync Error
 
 
Q