CKError: Request failed with http status code 503

Hello,


I have been struggling with a CloudKit error for the past couple months. It appeared very suddenly, without any changes being made to the code. I started getting the following error message:


<CKError 0x1763ed80: "Service Unavailable" (6/2022); "Request failed with http status code 503"; Retry after 30.0 seconds>

I expected the error to go away after a few days or weeks (since it looks like a bug/outage on Apple's side). However, this problem has persisted. I've scoured the internet but no one seems to have the same problem as me. Anyway, I've nailed down the part of my code which is triggering the error. By taking the following two lines:


let locationPredicate = NSPredicate(format: "distanceToLocation:fromLocation:(Location,%@) < %f", location, distance)

let query = CKQuery(recordType: "ServiceRequest", predicate: locationPredicate)

And changing them to this line:


let query = CKQuery(recordType: "ServiceRequest", predicate: NSPredicate(value: true))

The error disappears. Does anyone have any idea what is going on here? I'm completely stumped, and it's been dramatically affecting the progress I've been able to make on the app I'm working on.

Thanks,

Micah

Replies

Hi,


Did you ever make any progress with this?


I'm getting what looks like the same error when I'm trying to fetch zone changes for a shared database...


Hunter