Thanks for being a part of WWDC25!

How did we do? We’d love to know your thoughts on this year’s conference. Take the survey here

"BAD_REQUEST" in iCloudKit Telemetry

I've recently added iCloud backup on my chat app. Conversations are backing up fine but some users are losing their chats and when I see the telemetry it show "BAD_REQUEST" error. I couldn't find any details or solution for it. Does anyone has any idea what it could be? My development scheme is already fully deployed to production.

Answered by DTS Engineer in 830625022

BAD_REQUEST typically means that the CloudKit server receives an invalid request. That can happen when, for example, your request has a CloudKit record or field that doesn't exist in the CloudKit schema.

You mentioned your development scheme had been fully deployed to production, but that doesn't completely rule out the possibility of having invalid requests. For example, if you are using Core Data / SwiftData + CloudKit (NSPersistentCloudKitContainer), and the Core Data / SwiftData model in your app isn't completely mapped to the CloudKit schema, a bad request may happen.

What CloudKit API are you using? For Core Data / SwiftData + CloudKit and the CloudKit framework, you might consider capturing and analyzing a sysdiagnose to hopefully find detailed messages that indicate the concrete reason of a bad request.

If you are only using NSUbiquitousKeyValueStore, or using file system APIs to access iCloud Drive, you don't directly get involved to CloudKit requests, and so I’d suggest that you file a feedback report with what APIs you use and how you use them for the CloudKit folks to investigate – If you do so, please share your report ID here for folks to track.

Best,
——
Ziqiao Chen
 Worldwide Developer Relations.

BAD_REQUEST typically means that the CloudKit server receives an invalid request. That can happen when, for example, your request has a CloudKit record or field that doesn't exist in the CloudKit schema.

You mentioned your development scheme had been fully deployed to production, but that doesn't completely rule out the possibility of having invalid requests. For example, if you are using Core Data / SwiftData + CloudKit (NSPersistentCloudKitContainer), and the Core Data / SwiftData model in your app isn't completely mapped to the CloudKit schema, a bad request may happen.

What CloudKit API are you using? For Core Data / SwiftData + CloudKit and the CloudKit framework, you might consider capturing and analyzing a sysdiagnose to hopefully find detailed messages that indicate the concrete reason of a bad request.

If you are only using NSUbiquitousKeyValueStore, or using file system APIs to access iCloud Drive, you don't directly get involved to CloudKit requests, and so I’d suggest that you file a feedback report with what APIs you use and how you use them for the CloudKit folks to investigate – If you do so, please share your report ID here for folks to track.

Best,
——
Ziqiao Chen
 Worldwide Developer Relations.

@Aakif Are you seeing a spike in errors or a higher latency in your Telemetry data starting 20. March 2025? I have an increase in bandwidth and latency but cannot correlate the to any code changes I made during that time.

As you posted this message also on the 20th, maybe it is related.

Hi  @alexsteinerde

I also saw a spike around that same time period but it was only temporarily:

"BAD_REQUEST" in iCloudKit Telemetry
 
 
Q