CloudKit - 503 THROTTLED "public/users/discover"

Hello dev community,

We call the public/users/discover endpoint from our server as a mechanism to share state. We've been using it for years without any issues.

Starting on May 25, 2021 we started receiving 503s from the /database/1/<container>/production/public/users/discover endpoint for a high-percentage of our calls.

Sample Response

Status Code: 503

Response Body:

{
  "uuid" : "e8df63ea-14f5-4e5c-9444-68cc3213cda8",
  "retryAfter" : 173,
  "serverErrorCode" : "THROTTLED"
}

I've read that there is a request limit of 40 requests/second, but we're nowhere near that volume. I'd estimate we're closer to 0.3 requests/second. Yet, 90+% of our calls return that response with a 503 status code.

Documentation indicates that a throttled call should respond with a 429 status code, so the 503 is confusing me. Plus the retryAfter response parameter never changes. It's always 173, so I can't even write smart retry logic to wait for an appropriate time to call again.

I've reviewed our activity in the Telemetry and Logs sections of the CloudKit console, and they confirm that we're not close to a throttled threshold.

Has anyone else experienced this?

Thanks in advance for any advice!

I've had similar issues using the iOS-side discoverAllUsers API for users with large address books. For me, its one call (operation) but underneath the hood, CloudKit is taking chunks of contacts and fetching identities. Would be great is Apple special-cased the discoverAllUsers API to not hit these throttling limits per client-call.

Started happening to me too at the same time. DTS told me Apple just turned on throttling and to file a bug report about it. I want to make sure my code is waiting before submitting a bug.

I was on the verge of filing a bug report as @gilroykilroy recommended... But when I started making new calls to get fresh request UUIDs, I noticed I was getting nothing but 200s back on June 25, 2021.

We will continue to monitor, but I believe Apple has resolved this on their end...

If you have found a solution for this, can you please post here? This problem is affecting only some of my users and I cannot re-produce it on my side.

I cannot replicate this on my side either, but it's affecting many of my users randomly.

any update on this? anyone?

CloudKit - 503 THROTTLED "public/users/discover"
 
 
Q