CloudKit + NSPersistentCloudKitContainer: CKError "Service Unavailable" (6/2022); "Request failed with http status code 503"

I am developing a macOS and iOS application that uses NSPersistentCloudKitContainer to sync data across devices. For about an hour, I was able to successfully save records to the CoreData container and have them sync successfully with CloudKit. After further testing, I began receiving errors similar to the following:

CoreData: error: CoreData+CloudKit: -[NSCloudKitMirroringDelegate _exportFinishedWithResult:exporter:](1347): <PFCloudKitExporter: 0x28034d540>: Export failed with error: <CKError 0x282fbf4b0: "Service Unavailable" (6/2022); "Request failed with http status code 503"; uuid = 14B9CBAC-8636-4AD8-9A80-82B1705E08D9; Retry after 71.0 seconds>

Now any device that tries to save records to CloudKit will get this error and I am unable to continue developing my iCloud sync features. Note that I am currently in Development environment with a new iCloud container, and do not yet have any users or pushed these changes to production.

I have tried the following:

  1. Reinstall the application
  2. Restart all devices
  3. Logging out and back into iCloud from devices
  4. Updating my AppleID to use a single new iCloud container identifier from the developer portal as suggested in a comment here: https://developer.apple.com/forums/thread/694496 and updating all my provisioning profiles
  5. Reset the development environment from the CloudKit dashboard

After trying all the above, this issue still persists and am unable to continue development using CloudKit.

Searching around it seems this issue has been encountered by other users, but there does not seem to be a fix I can make on my end to resolve it.

I will also mention I have other iCloud container identifiers for this app that I used previously trying to integrate this app with iCloud. I created a new container identifier with my latest approach to sync and am unsure if those older containers are somehow causing issues.

Please help!

Replies

Today I have different errors!

CoreData: error: CoreData+CloudKit: -[NSCloudKitMirroringDelegate _performSetupRequest:]_block_invoke(1106): <NSCloudKitMirroringDelegate: 0x2803b9790>: Failed to set up CloudKit integration for store: <NSSQLCore: 0x103c0d6c0> (URL: file:///var/mobile/Containers/Data/Application/7C41756B-0596-4010-B35D-3F98B27F83A7/Library/Application%20Support/com.grantdavisinteractive.Mimir/cloud-library.sqlite)
Error Domain=NSCocoaErrorDomain Code=134060 "A Core Data error occurred." UserInfo={NSLocalizedFailureReason=The mirroring delegate could not initialize because it's store was removed from the coordinator.}
CoreData: error: CoreData+CloudKit: -[NSCloudKitMirroringDelegate recoverFromError:](2115): <NSCloudKitMirroringDelegate: 0x2803b9790> - Attempting recovery from error: Error Domain=NSCocoaErrorDomain Code=134060 "A Core Data error occurred." UserInfo={NSLocalizedFailureReason=The mirroring delegate could not initialize because it's store was removed from the coordinator.}
CoreData: error: CoreData+CloudKit: -[NSCloudKitMirroringDelegate recoverFromError:]_block_invoke(2134): The store was removed before the mirroring delegate could recover from an error:
Error Domain=NSCocoaErrorDomain Code=134060 "A Core Data error occurred." UserInfo={NSLocalizedFailureReason=The mirroring delegate could not initialize because it's store was removed from the coordinator.}