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:
- Reinstall the application
- Restart all devices
- Logging out and back into iCloud from devices
- 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
- 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!