Hi,
I’m running into a strange CloudKit issue and I’m trying to figure out whether this could be related to the China mainland iCloud environment, or whether I’m missing something on the client side.
I’m testing on macOS with Xcode 26.6, using the CloudKit Development environment and the Private Database. The Apple Account signed in on the Mac is a China mainland account, and CKAccountStatus reports available.
The original container is:
iCloud.com.hu.sujian
With that container:
I can create a custom zone in CloudKit Console.
The app can save a normal CKRecord to the Private Database default zone.
But the app consistently fails when creating a custom CKRecordZone.
The error is:
CKErrorDomain Code=15 (serverRejectedRequest)
Underlying CKInternalErrorDomain Code=2000
I also opened DTS case 21678909 and filed FB24394907.
As part of the DTS investigation, I created a completely new CloudKit container:
iCloud.com.hu.sujian.dtstest21678909
I then repeated the same tests using the same Apple Account and the same minimal test app.
On the new container, both of these app-side operations fail:
Saving a CKRecord to the Private Database default zone
CKErrorDomain Code=15 (serverRejectedRequest)
CKInternalErrorDomain Code=2000
HTTP status: 500
Request UUID:
D4B4DC7A-4167-4987-8BB1-4C61E658EDB6
Creating a custom CKRecordZone named SujianLibrary
CKErrorDomain Code=15 (serverRejectedRequest)
CKInternalErrorDomain Code=2000
HTTP status: 500
Request UUID:
00B4A294-9C63-4DBC-9133-03D969536B73
However, if I open CloudKit Console for that same new container, I can create a custom Private Database zone successfully.
I created:
DTSConsoleTest21678909
and it shows up normally as:
REGULAR_CUSTOM_ZONE
The code is very small. The relevant paths are essentially:
let container = CKContainer(identifier: containerIdentifier)
let database = container.privateCloudDatabase
let record = CKRecord(recordType: "DTSWriteTest")
record["message"] = "test" as CKRecordValue
try await database.save(record)
and:
let zone = CKRecordZone(zoneName: "SujianLibrary")
try await database.save(zone)
What confuses me is that CloudKit Console works, while the app receives an HTTP 500 from the CloudKit service.
The behavior also changed slightly between the two containers:
Original container:
default-zone record write from app: works
custom-zone creation from app: fails
custom-zone creation in Console: works
New container:
default-zone record write from app: fails
custom-zone creation from app: fails
custom-zone creation in Console: works
FB24394907 contains the full reproduction details and logs.
Has anyone seen something similar, especially with a China mainland iCloud account?
I also have a small standalone reproduction project if that would be useful.
Thanks.
0
0
200