NSPersistentCloudKitContainer Production sharing stuck with partial export, CKError partialFailure and _pcs_data BAD_REQUEST

I have a macOS app using NSPersistentCloudKitContainer with separate private and shared persistent stores and zone-wide CloudKit Sharing.

The same Core Data model and sharing implementation work correctly in Development: the complete object graph is shared and bidirectional owner/participant synchronization works.

In Production, however, sharing is stuck in a partially exported state.

The owner has a complete and internally consistent Core Data object graph. fetchShares(matching:) reports the expected managed objects as belonging to the Production share. However, inspection of the Production shared CloudKit zone shows that many of the corresponding CKRecords were never exported.

For example, the participant successfully imports records that actually exist in the shared zone, but entire expected record types such as CD_Missionary and CD_Area are absent from that zone.

The Production owner's private persistent store repeatedly reports failed setup/export events. The relevant Core Data + CloudKit log pattern is:

Never successfully initialized and cannot execute request due to error: CKErrorDomain Code=2

with an underlying:

CKInternalErrorDomain Code=1011

I also correlated multiple failed Core Data export events with CloudKit server logs. Within seconds of the failed exports, CloudKit reports:

Database: PRIVATE Operation: RecordDelete Overall Status: USER_ERROR Error: BAD_REQUEST Returned Record Type: _pcs_data

The failure is reproducible across multiple export attempts.

The Production shared zone itself exists and has zone-wide sharing enabled. The expected cloudkit.share record type is present in Production. I compared the visible Production and Development schemas, including cloudkit.share, and found no obvious record-type/field discrepancy.

The important comparison is that Development sharing with the same model/implementation works correctly, while the existing Production mirroring/share state repeatedly fails.

I have filed Feedback Assistant report FB24739413, including a sysdiagnose captured while the failure was active, Core Data/CloudKit event diagnostics, CloudKit server-log request IDs, store identifiers, zone information, and reproduction details.

My main question is about recovery rather than diagnosis:

What is the supported way to recover an existing Production NSPersistentCloudKitContainer share/mirroring state like this and cause the missing managed objects to be exported, without deleting or purging the owner's managed objects?

I have deliberately not reset the Production environment, deleted/recreated the share, purged the shared zone, reset the owner's persistent store, or mass-modified the managed objects to try to force re-export.

In particular, I understand that purgeObjectsAndRecordsInZone can delete the corresponding managed objects, so I do not want to use destructive recovery techniques without guidance.

Is there a supported mechanism for rebuilding/reinitializing the Production mirroring/share state while preserving the owner's existing Core Data object graph, or is this a situation that requires intervention/instructions from Apple?

Environment

macOS 26.6.2 Core Data + NSPersistentCloudKitContainer CloudKit private + shared persistent stores zone-wide sharing Production failure only Development sharing works correctly Feedback: FB24739413

The error is quite similar to the one that has been addressed in this post, and so I'd suggest that you start with the post, if not yet.

Looking into the sysdiagnose you provided in FB24739413, I see the following error, which confirms you are likely running into the same situation, though the symptom isn't quite the same.

Finished operation <CKModifyRecordsOperation: 0xb8eb96400; databaseScope=Private, operationID=E6A6912D1FEB9F2F, resolvedConfig={ timeoutForRequest=60, flags=autoRetry, container=iCloud.com.thormountaincode.MissionHousesPlanner, discretionary=Infers Disc }, qos=Utility, stateFlags=executing, <private>> with error: <CKUnderlyingError 0xb90d0f5d0: "PartialFailure" (1011); "Failed to modify some records"; partial errors: { 6FF55CD8-0C81-4922-A35D-CA91DBA5A53F:(com.apple.coredata.cloudkit.share.4E5D812D-B804-4FFE-8F02-44B088E8BB0B:defaultOwner) = <CKError 0xb90036610: "Invalid Arguments" (12/2006); server message = "Cannot create or modify field 'CD_moveReceipt' in record 'CD_Missionary' in production schema"; op = E6A6912D1FEB9F2F; uuid = 43810C8E-EFCF-42D2-8E82-01F9BE083671> ... 201 "Batch Request Failed" CKErrors omitted ... }>

CD_moveReceipt (and probably CD_moveReceipt_ckAsset) is a field NSPersistentCloudKitContainer creates to support CloudKit sharing. I am unclear why that is missed in your schema – My best guess is that you probably did not completely test the share feature before deploying your schema to the production environment, and CloudKit Console fails to detect the difference since then.

In this situation, figuring out what's missed by analyzing your sysdiagnose and manually adding and deploying the missed schema will be the way out.

Regarding your question:

Is there a supported mechanism for rebuilding/reinitializing the Production mirroring/share state while preserving the owner's existing Core Data object graph, or is this a situation that requires intervention/instructions from Apple?

You can start with checking if your development schema has the same issue. If the development schema is complete, and the production schema isn't, try to re-deploy the schema with CloudKit Console. If CloudKit Console does not detect the known difference and hence you can do the deployment, that will be a bug of CloudKit Console. You can start with filing a feedback against CloudKit Console for CloudKit folks to fix the issue.

If the development schema isn't complete either, it will be that you haven't tested all the feature in the development environment, or CloudKit fails to create the right development schema just in time, which will be a CloudKit bug. The later is highly unlikely based on my experience.

Best,
——
Ziqiao Chen
 Worldwide Developer Relations.

NSPersistentCloudKitContainer Production sharing stuck with partial export, CKError partialFailure and _pcs_data BAD_REQUEST
 
 
Q