Understanding CloudKit Error about chain PCS data

In the last update of my app I added a CloudKit sync and now I have a user telling me that sync isn't working. He sent me his device logs and I found the following. I tried to google the error message about the

same batch didn't have chain PCS data on it for record
error message, but found nothing. Does anybody have an idea what causes the problem? And how do I fix it?

Here's a part from the log: (there are many many more lines like these)


E3025D29-4C92-46EE-AB90-9C821B7B5824:(***:__defaultOwner__) =  in the same batch didn't have chain PCS data on it for record ">
27D87174-F296-4BEE-9C20-66CB040EF8B3:(***:__defaultOwner__) =  in the same batch didn't have chain PCS data on it for record ">

Any help is greaty appreciated!!!

Replies

Ok... the pasting of the code here somehow did not work properly...

Here are the unformatted Logs that I have:


<CKError 0x2847f96b0: "Partial Failure" (2/1011); "Failed to modify some records"; partial errors: {


E3025D29-4C92-46EE-AB90-9C821B7B5824:(***:__defaultOwner__) = <CKError 0x2847fbed0: "Internal Error" (1/5001); "Parent record <CKRecordID: 0x104fb0c60; recordName=CF722F9C-6324-4164-82EB-8C9A1DA472CD, zoneID=***:__defaultOwner__> in the same batch didn't have chain PCS data on it for record <CKRecordID: 0x104fb0910; recordName=E3025D29-4C92-46EE-AB90-9C821B7B5824, zoneID=***:__defaultOwner__>">

27D87174-F296-4BEE-9C20-66CB040EF8B3:(***:__defaultOwner__) = <CKError 0x281b5d4a0: "Internal Error" (1/5001); "Parent record <CKRecordID: 0x104f522b0; recordName=CF722F9C-6324-4164-82EB-8C9A1DA472CD, zoneID=***:__defaultOwner__> in the same batch didn't have chain PCS data on it for record <CKRecordID: 0x104f04360; recordName=27D87174-F296-4BEE-9C20-66CB040EF8B3, zoneID=***:__defaultOwner__>">

I just encountered this myself. Did you find a solution?

How I encountered it:
  1. A creates a ToDo list and shares it with B, which works fine. Both A (owner) and B (subscriber) see the list.

  2. A adds ItemOne to the list, which works fine. Both A and B can now see that the list contains a single item, ItemOne.

  3. B adds ItemTwo to the list, which causes the error you've noted.

In my example, ItemTwo.parent is properly set to the shared list. Seems like it should work, and DOES work when owner A tries it, but not when subscriber B tries it.

Still investigating...
More info. A follow-on error reports that "PrivateDB can't be used to access another user's zone" so I'm guessing that subscriber B is attempting to save to owner A's private database instead of subscriber B's shared database.

Still investigating...
Hello there,

Can you post the code in which User B adds ItemTwo to the list? As you mentioned in your followup message, you should indeed make sure that this CloudKit operation is enqueued to User B's sharedCloudDatabase.
There's nothing of interest in the code, but I did confirm that the operation was indeed enqueued to the private database, though, as you say, it should have been enqueued to the shared database. So, my error!