CloudKit Production sync fails with CKInternalErrorDomain 1011 and BAD_REQUEST on _pcs_data

Hi, I’m seeing a CloudKit Production sync failure in an iOS app using SwiftData/Core Data with private CloudKit mirroring.

Sync worked correctly after release, then stopped working without any new app build being released.

Device logs show: CKInternalErrorDomain Code=1011 and Core Data reports that CloudKit mirroring was never successfully initialized.

CloudKit Production logs also show a native PRIVATE database request failing with: USER_ERROR / BAD_REQUEST involving the internal record type: _pcs_data

The Production schema, private zone, and subscription are still present. I have not reset Production or deleted any zones/subscriptions.

I have already filed a Feedback Assistant report with diagnostics.

Has anyone seen this pattern before? Is there a safe developer-side remediation, or is this typically an Apple-side CloudKit/PCS issue?

I want to avoid any destructive action that could risk existing user data.

Answered by Frameworks Engineer in 907262022

If you can share your feedback report number here that would be helpful. Typically these issues are uninitialized fields in your CKRecords. There will be more information in your application logs around the original failure that include the field name and record type.

See this document more about debugging NSPersistentCloudKitContainer.

Accepted Answer

If you can share your feedback report number here that would be helpful. Typically these issues are uninitialized fields in your CKRecords. There will be more information in your application logs around the original failure that include the field name and record type.

See this document more about debugging NSPersistentCloudKitContainer.

Thank you very much ! your guidance was exactly what I needed. Following your suggestion, I checked the original CloudKit failure more closely and found that the issue was caused by a field missing from the Production schema. After updating the schema, CloudKit synchronization started working again immediately. Your pointer to the field/record-type details in the logs and to TN3164 was extremely helpful. Thank you again, I really appreciate your help.

CloudKit Production sync fails with CKInternalErrorDomain 1011 and BAD_REQUEST on _pcs_data
 
 
Q