Increased number of CKErrorServerRejectedRequest

Hi, I have a CloudKit based app in production on the App Store for the past 5 years. One feature in the app downloads a lot of records, over a few different recordTypes, from a user's private database using an array of CKQueryOperations (using an NSOperationQueue). This has been working fine for the past few years, and even now works fine for most users, but an increasing number of users are seeing one of the operations in the array fail for CKErrorServerRejectedRequest. This has been happening over a few weeks now, and the customer support is getting burdensome. Asking the user to repeat the feature sometimes fails, and sometimes succeeds, with no obvious reason. This is also happening for operations for recordTypes where there aren't any records in the private database, as well as for recordTypes where there are hundreds of records. I haven't made any changes over the past year that directly impacts this process.

Why would this sudden increase be happening and how do I go about analyzing and fixing it?

Also, my current code handles this by cancelling all the operations in the operation queue, because the comment I saw in CKError.h for this error says "This is a non-recoverable error". I'm not sure I completely understand what that means ... is the operation non-recoverable (and hence I should retry by creating a new operation), or is the user's private database corrupted, or what?

Would be great if I could get some insight / suggestions.

I am sorry to hear that you are experiencing some problems using CloudKit. Could you please create a feedback https://feedbackassistant.apple.com and post the id here, so we can follow-up on this issue.

I can actually able to occasionally reproduce the problem in the Development environment as well, running my app in the simulator with Xcode. I can inspect the error given, and it seems to contain a couple of interesting things in the userInfo dictionary: [0] (null) @"ContainerID" : @"BXXXXXXX.com.mycontainer.identifier" [1] (null) @"NSUnderlyingError" : domain: @"CKInternalErrorDomain" - code: 2000 [2] (null) @"CKHTTPStatus" : (long)500 [3] (null) @"NSDebugDescription" : @"CKInternalErrorDomain: 2000" [4] (null) @"RequestUUID" : @"2DCA0896-557A-4F0C-A331-4F58BC6EB86D" [5] (null) @"OperationID" : @"19F0BF027F05095D"

Just recreating the same operation and sending to CloudKit seems to work ... but will continue testing.

Increased number of CKErrorServerRejectedRequest
 
 
Q