Learn how to integrate your app with iCloud for effective data storage.

Documentation

Posts under iCloud subtopic

Post

Replies

Boosts

Views

Activity

SwiftData with CloudKit Error: Error updating background task request
Hi, Overview I have a SwiftData project which automatically syncs with CloudKit. When I run the app, I see the following error in Xcode logs. Error updating background task request: Error Domain=BGSystemTaskSchedulerErrorDomain Code=3 "(null)" My attempt I can enable Background processing (under Signing & Capabilities > Background modes), but I don't know the BGTaskSchedulerPermittedIdentifiers to add in the Info.plist Questions How can I resolve this? If I should enable background processing, what are the BGTaskSchedulerPermittedIdentifiers to add in Info.plist?
19
0
2.3k
16h
CKError 10/2007 "Invalid bundle ID for container" although the container is assigned to the App ID
Every CloudKit request from my app fails with CKError "Permission Failure" (10/2007), server message "Invalid bundle ID for container". Setup: SwiftData / NSPersistentCloudKitContainer, private database, Development environment, explicit container identifier (not the default container). What I verified, following TN3164: The App ID has iCloud with CloudKit enabled and exactly this container assigned. The container is visible in CloudKit Console under the same team. The Xcode-managed provisioning profiles contain the container in both the production and the development container identifier lists. The signed entitlements of the app match: application-identifier, team identifier, container identifiers, environment Development, CloudKit service, get-task-allow. The error occurs on two different devices and in two independent code paths: initializeCloudKitSchema and the normal SwiftData store. It fails while setting up the record zone com.apple.coredata.cloudkit.zone. Per TN3164 this means the association is not synchronized to the CloudKit server. The app is already on the App Store (the current version does not use CloudKit yet) and the next version must keep this container identifier, so switching to a new container is not an option. I have reported this through Feedback Assistant and to Developer Support. I can provide the App ID, container identifier and the failing request IDs privately to anyone from Apple who needs them. Is there anything else I can check on my side, or does this need a manual fix on the CloudKit server?
0
0
32
1d
CKShare invitation acceptance fails after moving to Unlisted App Distribution — "required version not found in App Store"
We recently moved our app to Unlisted App Distribution (Apple ID 6810578300) after a Guideline 3.2 (Business) rejection under Public distribution. Apple's Unlisted App Request support team approved the transition and confirmed by email that "Unlisted app distribution shouldn't impact the usage of CloudKit sharing, because unlisted app distribution only removes your app from App Store search" — but in practice, CKShare invitation acceptance is now broken. Setup: The app uses CloudKit Sharing (CKShare, generated via UICloudSharingController on macOS) to grant team members access to a shared database. An admin generates an invitation link from the Mac app and sends it to iOS users. Problem: Since the move to Unlisted distribution, tapping/opening a CKShare invitation link fails, even on devices where the app is already installed and fully up to date — including our own development devices. The failure shows one of two behaviors: "[AppName] cannot be opened because it requires a newer version of [AppName], which could not be found in the App Store." The link redirects to the app's App Store page, which itself shows "Open" (already installed/up to date), creating a loop with no way to actually accept the share. We've ruled out: stale installs, device-specific issues, reinstalling the app (Mac and iOS), and network/region issues — this reproduces consistently across multiple devices and Apple IDs. Hypothesis: CKShare's acceptance flow appears to perform a version-compatibility check against the public App Store catalog/search index. Since Unlisted apps are deliberately excluded from that index, this check seems to fail even when the installed app is current, producing a false "no compatible version found" error. Question: Is this a known interaction between CloudKit Sharing and Unlisted App Distribution? Is there a supported workaround — an entitlement, Info.plist key, or CKShare configuration — that allows share-link acceptance to succeed for an app that is intentionally excluded from App Store search? Any guidance from the CloudKit engineering team would be greatly appreciated, as this currently blocks our team from using the app's core sharing feature entirely.
0
0
29
2d
iCloud OAuth2 interest form: What should an unreleased app enter for the required App Store URL?
Hello, I am an individual developer enrolled in the paid Apple Developer Program, developing a native iOS calendar app that has not yet been released on the App Store. I would like to apply for iCloud Calendar access through Apple Account authorization, without requiring users to generate app-specific passwords. In this forum thread, an Apple DTS engineer recommended the iCloud OAuth2 interest form. I can access the form, but both “App Name” and “App Store URL” are required. Could someone clarify the correct process for an unreleased app? Can an individual developer submit an application before the app is published on the App Store? For “App Name,” may I enter the app’s current working name, or must it match an existing App Store Connect record? For “App Store URL,” what should I enter when no public App Store page exists? Would a URL based on an unpublished App Store Connect record’s numeric Apple ID be accepted, or is there an alternative submission process? I contacted Apple Developer Program Support, but they explained that their team handles developer account matters and referred me to technical support and the forums. If another team handles these application requirements, could you please direct me to the appropriate contact? Thank you for your guidance.
1
0
263
4d
Apple Account authorization instead of app-specific-password
Apple's app-specific password support article says: "For supported third-party apps that access your iCloud Mail, Calendar, and Contacts, you can authorize the app using your Apple Account instead of using an app-specific password." I can't find any documentation about (1) what makes an app "supported," (2) how to apply or qualify, or (3) the technical mechanics — Sign in with Apple, OAuth scopes, MDM, etc. I'm building an iOS app (already approved for Gmail with the gmail.modify scope and CASA-assessed) that monitors a user's mailbox for scam emails with their explicit consent. I'd love to offer the same to iCloud Mail users without requiring the manual app-specific password flow, if there's a Sign in with Apple-style alternative available. Has anyone had success applying for this, or can an Apple engineer point to additional documentation? Thanks!
4
0
501
4d
CloudKit Production RecordSave fails on _pcs_data (BAD_REQUEST) — reproducible across 2 Apple IDs, works fine in Development
Summary of my issue: CloudKit sync works perfectly in the Development environment, but every single record save to Production fails identically — every build, two different Macs, two different networks, and now under two different, unrelated Apple IDs. The failure isn't in my own record types; it fails on Apple's internal _pcs_data system record, which blocks the entire save (my app's real records included) from ever completing. Because it reproduces under a second, unrelated Apple ID, this doesn't look like account-specific corruption — it looks like broken server-side state on this container's Production environment itself. Exact error I'm seeing: Console.app (identical every occurrence): CoreData+CloudKit: -[NSCloudKitMirroringDelegate _requestAbortedNotInitialized:] (2192): – Never successfully initialized and cannot execute request '' due to error: Error Domain=CKErrorDomain Code=2 UserInfo={ContainerID=, NSDebugDescription=, CKPartialErrors=, RequestUUID=, NSLocalizedDescription=, CKErrorDescription=, NSUnderlyingError=0xa0b048810 {Error Domain=CKInternalErrorDomain Code=1011 UserInfo={CKErrorDescription=, NSLocalizedDescription=, CKPartialErrors=}}} CloudKit Dashboard → Production → Monitor → Logs (5+ RecordSave attempts across days/machines/accounts): Apple ID #1: json { "database": "PRIVATE", "zone": "com.apple.coredata.cloudkit.zone", "userId": "_e7c2879989e20df06db9ddb272805ea7", "operationType": "RecordSave", "platform": "Mac", "overallStatus": "USER_ERROR", "error": "BAD_REQUEST", "interfaceType": "NATIVE", "returnedRecordTypes": "_pcs_data" } Apple ID #2 (unrelated account, tested later): json { "database": "PRIVATE", "zone": "com.apple.coredata.cloudkit.zone", "userId": "_5b6b9a3c5c508babc44894d9f9d324e7", "operationType": "RecordSave", "platform": "Mac", "clientOS": "OSX;26.5.x", "overallStatus": "USER_ERROR", "error": "BAD_REQUEST", "interfaceType": "NATIVE", "returnedRecordTypes": "_pcs_data" } Every other operation type in the same sessions succeeds normally: ZoneFetch, ZoneSave, RecordFetch, SubscriptionCreate, AssetUploadTokenFetch, ZoneChanges, and DatabaseChanges all return overallStatus: SUCCESS. Only RecordSave fails, always on _pcs_data, for both accounts. My best guess...: _pcs_data is Apple's internal Protected Cloud Storage record, used to wrap the encryption keys NSPersistentCloudKitContainer needs before it can write anything to a zone (automatic for any CoreData/SwiftData + CloudKit app, independent of whether any schema field is manually marked "Encrypted"). If that record fails to save, the zone can never finish initializing, which produces exactly the "never successfully initialized" error above. Since Development works fine and Production fails identically for two completely unrelated Apple IDs on the same container, the broken PCS/key-wrapping state appears to live on this container's Production environment itself, not on any one account. What I've tried so far: Entitlements verified correct via codesign -d --entitlements :-, 4 separate times across different signing/provisioning states (Production icloud-container-environment, correct container/team, CloudKit + CloudDocuments services) Push Notifications / aps-environment: added, enabled on the App ID, provisioning profile regenerated — no effect, and confirmed not required for the core mirroring path anyway Schema deployment: CloudKit Dashboard "Deploy Schema Changes to Production" shows an empty diff (0 record types/indexes/security roles) — Production already matches Development exactly No fields marked "Encrypted" in any record type iCloud app permission for this app confirmed ON in System Settings iCloud Keychain "Sync this Mac" toggled off then back on — no effect Exactly 1 iCloud container assigned to the App ID, no duplicates Tested on 2 Macs, 2 networks, 2 unrelated Apple IDs — identical failure every time Development environment works perfectly on every test, including a 31.5MB audio asset upload Advanced Data Protection toggled on then off — no effect CloudKit Dashboard "Reset Environment" — not offered for Production (Apple restricts this to Development only) How to Reproduce: I built a minimal (~150 line) SwiftData + CloudKit project using the same bundle ID, team, and container as my real app: a single @Model class with one field, ModelConfiguration(cloudKitDatabase: .automatic), and a button that inserts and saves a record, observing NSPersistentCloudKitContainer.eventChangedNotification and displaying any error in its own UI. Archived and exported with Production entitlements (not a Debug run), it reproduces the same failure family while working perfectly in Development. Happy to share it if useful. What I'm asking for: This is 100% reproducible, isolated to Production for this specific container, and reproduces under two unrelated Apple IDs with every client-side configuration verified correct. Has anyone else seen _pcs_data RecordSave fail with BAD_REQUEST in Production only? Is there a known fix, or does this need Apple to inspect/reset the server-side PCS state for this container's Production environment? Related threads: I found a couple of related threads while searching before posting this. In Handling CKError.partialFailure with pcs_data errors, an Apple DTS engineer (Ziqiao Chen) explained that _pcs_data/BAD_REQUEST is normally transient and that NSPersistentCloudKitContainer retries automatically, so it usually isn't worth worrying about. That matches what I'd expect for an occasional blip — but in my case it's 100% reproducible, permanent, and blocks every save, which seems like a real deviation from that expected behavior rather than routine noise. I also found a CKShare thread with the exact same signature (RecordSave / BAD_REQUEST / returnedRecordTypes: _pcs_data in a Production private database) that appears to be unresolved, so I don't think I'm the only one hitting this.
2
0
158
1w
NSPersistentCloudKitContainer Production sharing stuck with partial export, CKError partialFailure and _pcs_data BAD_REQUEST
I have a macOS app using NSPersistentCloudKitContainer with separate private and shared persistent stores and zone-wide CloudKit Sharing. The same Core Data model and sharing implementation work correctly in Development: the complete object graph is shared and bidirectional owner/participant synchronization works. In Production, however, sharing is stuck in a partially exported state. The owner has a complete and internally consistent Core Data object graph. fetchShares(matching:) reports the expected managed objects as belonging to the Production share. However, inspection of the Production shared CloudKit zone shows that many of the corresponding CKRecords were never exported. For example, the participant successfully imports records that actually exist in the shared zone, but entire expected record types such as CD_Missionary and CD_Area are absent from that zone. The Production owner's private persistent store repeatedly reports failed setup/export events. The relevant Core Data + CloudKit log pattern is: Never successfully initialized and cannot execute request due to error: CKErrorDomain Code=2 with an underlying: CKInternalErrorDomain Code=1011 I also correlated multiple failed Core Data export events with CloudKit server logs. Within seconds of the failed exports, CloudKit reports: Database: PRIVATE Operation: RecordDelete Overall Status: USER_ERROR Error: BAD_REQUEST Returned Record Type: _pcs_data The failure is reproducible across multiple export attempts. The Production shared zone itself exists and has zone-wide sharing enabled. The expected cloudkit.share record type is present in Production. I compared the visible Production and Development schemas, including cloudkit.share, and found no obvious record-type/field discrepancy. The important comparison is that Development sharing with the same model/implementation works correctly, while the existing Production mirroring/share state repeatedly fails. I have filed Feedback Assistant report FB24739413, including a sysdiagnose captured while the failure was active, Core Data/CloudKit event diagnostics, CloudKit server-log request IDs, store identifiers, zone information, and reproduction details. My main question is about recovery rather than diagnosis: What is the supported way to recover an existing Production NSPersistentCloudKitContainer share/mirroring state like this and cause the missing managed objects to be exported, without deleting or purging the owner's managed objects? I have deliberately not reset the Production environment, deleted/recreated the share, purged the shared zone, reset the owner's persistent store, or mass-modified the managed objects to try to force re-export. In particular, I understand that purgeObjectsAndRecordsInZone can delete the corresponding managed objects, so I do not want to use destructive recovery techniques without guidance. Is there a supported mechanism for rebuilding/reinitializing the Production mirroring/share state while preserving the owner's existing Core Data object graph, or is this a situation that requires intervention/instructions from Apple? Environment macOS 26.6.2 Core Data + NSPersistentCloudKitContainer CloudKit private + shared persistent stores zone-wide sharing Production failure only Development sharing works correctly Feedback: FB24739413
1
0
501
1w
iCloud CardDAV returns 401 with fresh app-specific password — also reproducible with vdirsyncer
Hi, I’m trying to access my own iCloud Contacts via CardDAV from a self-hosted web application. Apple’s documentation still states that app-specific passwords can be used for third-party access to iCloud Contacts when the app does not support Apple’s newer authorization flow. However, authentication currently fails consistently with HTTP 401 at the very first CardDAV request. Setup: Apple Account with 2FA enabled correct Apple Account ID / iCloud address freshly generated app-specific password CardDAV endpoint: https://contacts.icloud.com/ HTTP Basic Auth read-only PROPFIND requesting current-user-principal I have reproduced the same result with three independent clients: my own PHP/libcurl implementation a minimal direct cURL/libcurl reference request vdirsyncer 0.21.0 vdirsyncer fails during discovery with: 401 Unauthorized https://contacts.icloud.com/.well-known/carddav In my direct request, Basic Authorization is definitely sent and the server responds 401 before any redirect or personal CardDAV shard discovery occurs. I have also verified: no username mismatch no redirect/auth-header loss no HTTP/1.1 vs HTTP/2 issue no password transformation by the application a fresh app-specific password was copied directly from Apple and tested immediately Interestingly, direct CardDAV access for this same project/account worked previously, so CardDAV itself has worked for this account before. Has anything changed recently regarding authentication to iCloud Contacts/CardDAV? Specifically: Are app-specific passwords still expected to authenticate directly against contacts.icloud.com? Is there any additional account setting or authorization required now? Is .well-known/carddav still the supported discovery route? Is Apple’s newer “Account Data Sharing” authorization available to independent/self-hosted applications for iCloud Contacts, and if so, is there developer documentation for that flow? I’m deliberately not asking about writing contacts yet — this is only a read-only CardDAV authentication/discovery test. Thanks for any pointers. Cheers, Vince
0
0
152
2w
Sandboxed Mac app denied mach-lookup com.apple.cloudd when signed with Mac Team Store Provisioning Profile on macOS 26
A sandboxed Mac app with correct CloudKit entitlements fails to connect to com.apple.cloudd (the CloudKit daemon) when distributed via TestFlight (Mac Team Store Provisioning Profile). The identical binary works correctly when launched from Xcode (Mac Team Provisioning Profile also present). All entitlements are correctly embedded and the App ID is properly configured in Apple Developer Portal. Environment macOS 26.5.1 (25F80) Xcode 26.5 (17F42) SwiftData with NSPersistentCloudKitContainer / ModelConfiguration(cloudKitDatabase: .private(...)) Steps to Reproduce Create a sandboxed Mac app using SwiftData with CloudKit sync Enable iCloud + CloudKit in Signing & Capabilities Archive and distribute to TestFlight (Mac Team Store Provisioning Profile) Install via TestFlight on macOS 26 and launch Check Console for kernel sandbox messages Expected Result CloudKit connects to com.apple.cloudd and syncs data, matching behavior of the iOS version using the same container. Actual Result Console shows repeated kernel sandbox denials followed by CloudKit setup failure: kernel Sandbox: CheatSheet Mac(82347) deny(1) mach-lookup com.apple.cloudd kernel Sandbox: CheatSheet Mac(82347) deny(1) mach-lookup com.apple.duetactivityscheduler CheatSheet Mac CoreData+CloudKit: Failed to set up CloudKit integration for store Error Domain=CKErrorDomain Code=6 "Error connecting to CloudKit daemon." Key Diagnostic Finding When launched from Xcode, taskgated-helper validates both the Mac Team Store Provisioning Profile AND the Mac Team Provisioning Profile, and CloudKit succeeds: cloudd: TCC approved access for container containerID=iCloud.com.michaelendres.CheatSheet:Production When launched from TestFlight, only the Mac Team Store Provisioning Profile is present, and the sandbox denies com.apple.cloudd despite identical entitlements in the binary: codesign -d --entitlements shows: com.apple.developer.icloud-services: [CloudKit] com.apple.developer.icloud-container-identifiers: [iCloud.com.michaelendres.CheatSheet] com.apple.developer.icloud-container-environment: Production com.apple.security.app-sandbox: true Conclusion The Mac Team Store Provisioning Profile on macOS 26 does not appear to grant the sandbox exception for mach-lookup com.apple.cloudd, while the Mac Team Provisioning Profile (development) does. This prevents any Mac App Store / TestFlight app using CloudKit from syncing on macOS 26.
17
0
2.1k
2w
CKQuery returns zero records while CKFetchRecordZoneChangesOperation returns 2275 in the same zone — container index corruption?
We have a production CloudKit container where every CKQuery against one specific user's private database returns zero records with no error. The records are present and readable by other means. In a single app launch, against the same private custom zone on that account: CKQuery, NSPredicate(value: true) 0 records, no error CKFetchRecordZoneChangesOperation 2275 records (231 Inspection, 2040 InspectionPhoto, 2 Job, 2 cloudkit.share) Queries return zero for every record type, in both the default zone and the custom zone, and with both NSPredicate(value: true) and a field predicate on an indexed queryable field. Account status is .available and userRecordID resolves normally. No client change preceded this. Other users on the same container and the same binary are unaffected. The user did not delete anything; the trigger appears to have been an unexpected iCloud sign-out mid-session. The same account's private default zone additionally cannot be enumerated at all: CKError.serverRejectedRequest (15) "AppDefaultZone does not support getChanges call" CKInternalErrorDomain code 2027 We understand getChanges is not supported on the default zone. Noting it because our Company record type lives there, so its state cannot be verified by any index-free path, and an empty query result there is uninterpretable. This looks like the container index loss described by DTS in thread 775063 ("I ever saw some CloudKit containers losing their indices, and so a query to the container may not return the right result set"). Filed as FB24641992 with a full diagnostic log attached, including the container identifier, team identifier and the affected user record ID. We have shipped a client-side workaround that falls back to zone enumeration whenever a query returns zero, so the user is unblocked, but the index is still broken and that account now runs entirely on fallback paths. Question: is there a way to get a container re-indexed for a specific account, and is there anything we can do client-side to detect or avoid this state? We could not produce a focused sample project for a code-level support request because the fault is server-side account state, not client code — the same calls on a healthy account in the same container from the same binary return matching results.
0
0
177
3w
NSCocoaErrorDomain Code=513 after user delete's
I work on an app that saves data to the Documents folder in the users iCloud Drive. This uses the iCloud -> iCloud Documents capability with a standard container. We've noticed an issue where a user will delete the apps data by doing to Settings > {Name} > iCloud > Storage > App Name > select "delete data from iCloud", and then our app can no longer write to or create the Documents folder. Once that happens, we get this error: Error Domain=NSCocoaErrorDomain Code=513 "You don't have permission to save the file "Documents" in the folder "iCloud~your~bundle~identifier"." UserInfo={NSFilePath=/private/var/mobile/Library/Mobile Documents/iCloud~your~bundle~identifier/Documents, NSURL=file:///private/var/mobile/Library/Mobile%20Documents/iCloud~your~bundle~identifier/Documents, NSUnderlyingError=0x1102c7ea0 {Error Domain=NSPOSIXErrorDomain Code=13 "Permission denied"}} This is reproducible using the sample project here https://developer.apple.com/documentation/uikit/synchronizing-documents-in-the-icloud-environment. Steps to reproduce in that project: Tap the plus sign in the top right corner to create a new document Add a document name and tap "Save to Documents" Go to Settings > {Name} > iCloud > Storage > SimpleiCloudDocument App Name > select "delete data from iCloud" Reopen the app and repeat steps 1-2 Observe error on MainViewController+Document.swift:59 Deleting and reinstalling the app doesn't seem to help.
6
0
619
3w
CloudKit won't sign in for Private Database
I'm trying to review whether my database files are actually populating to the CloudKit private database. For Private and Shared databases, I get a message that I need to sign in again. I do sign in again, but this message never goes away. I have also tried acting as iCloud User. When I enter my iCloud user id and password, I get an authentication error.
1
0
233
3w
NSPersistentCloudKitContainer never exports changes from the .shared store (participant side)
Hello, I am building an iOS app that uses NSPersistentCloudKitContainer with a two-store configuration (.private + .shared), following the "Sharing Core Data objects between iCloud users" sample. Sharing works in one direction only: the owner's records reach the participant, but nothing the participant writes is ever exported. I have spent a full day isolating this and have ruled out every cause I can think of. I would appreciate guidance on what else to check, or confirmation that this is a limitation I have misunderstood. I have deliberately kept the details below complete, because the interesting part of this report is not the failure itself but everything that has already been eliminated. Environment Xcode 26.6 (17F113) Owner device: iPhone 15 Pro, iOS 26.5.2 Participant device: iPhone 13 mini, iOS 26.0.1 Two devices, two different iCloud accounts CloudKit container: iCloud.com.onton.quipuledger, Development environment NSPersistentCloudKitContainer with two stores: private.sqlite — databaseScope = .private shared.sqlite — databaseScope = .shared Both created exactly as in the sample (the shared description is a copy() of the private one, with a new NSPersistentCloudKitContainerOptions whose scope is .shared) Both stores have NSPersistentHistoryTrackingKey and NSPersistentStoreRemoteChangeNotificationPostOptionKey set viewContext has transactionAuthor, mergePolicy (NSMergeByPropertyObjectTrumpMergePolicy) and automaticallyMergesChangesFromParent = true What works The owner calls share(_:to:) with a set of objects and gets a CKShare. The owner sets publicPermission = .readWrite, saves the share via CKDatabase.modifyRecords, then calls persistUpdatedShare(_:in:). The participant accepts the invitation link. All shared records arrive correctly in the participant's shared.sqlite (164 objects), and subsequent owner-side changes continue to arrive. Import events succeed. What fails Every export from the participant's .shared store fails, regardless of what is written. On the participant device: New object assigned to the shared store via context.assign(_:to:) → never exported Update to an existing record that arrived from the owner → never exported Both are saved successfully to the local store (verified by reading the sqlite file) and appear in the persistent history The corresponding NSPersistentCloudKitContainer.Event reports: type: .export succeeded: false error: NSCocoaErrorDomain Code=134060 userInfo: [:] // completely empty — no underlying error countAffectedObjects: 0 Reading the store's internal metadata tables shows the export never begins: ANSCKEXPORTMETADATA — empty (no history token was ever recorded) ANSCKEXPORTEDOBJECT — 0 rows ANSCKEXPORTOPERATION — 0 rows Meanwhile the same device's .private store exports successfully, and the owner device's .private store (which holds the shared zone) exports successfully as well. What I have ruled out Permissions. On the participant, share.currentUserParticipant reports permission == .readWrite, role == .publicUser, acceptanceStatus == .accepted. Record types. All types exist in the Development schema (verified in CloudKit Console). I also ran initializeCloudKitSchema() to be certain. Server-side rejection. The CloudKit Console Logs show no errors at all — the request never reaches the server. The records themselves. Failure is independent of content: a single entity with no relationships fails exactly like a multi-object graph. Association with the share. fetchShares(matching:) on the participant returns the correct share for the record, with the correct zone name and owner name. Core Data does know the object belongs to the shared zone. Corrupted mirroring metadata. Deleting and reinstalling the app on the participant device reproduces the problem from a clean state. CloudKit itself refusing participant writes. Using the raw CloudKit API on the same device, I saved a CKRecord directly into the same shared zone — this succeeded, and the owner device received a push notification for it. So the account, the zone, the permissions and the record type are all fine; only the Core Data mirroring path fails. Question Given that Core Data correctly associates the object with the share, and that the same device can write to the same zone through the raw CloudKit API, why would the mirroring delegate never schedule an export for the .shared store? Specifically: Is exporting participant-side changes from a .shared store supported by NSPersistentCloudKitContainer? The sample project demonstrates share management and owner-side writes, but I could not find an example of a participant creating or modifying objects in the shared store. If it is supported, what would cause NSCocoaErrorDomain 134060 with an empty userInfo and zero affected objects? Is there a way to obtain the underlying reason? (-com.apple.CoreData.CloudKitDebug 1 produced no additional output for me when the app was launched via devicectl.) Is there any additional setup required on the participant side beyond accepting the share — for example, does a newly created object need to be related to an object that is already part of the share in order to be exported? Thank you very much for your help.
0
0
239
4w
CloudKit private database: all writes fail with HTTP 500 (empty body), CKErrorDomain 15 / CKInternalErrorDomain 2001, account-scoped, reads unaffected. Began immediately after Apple Account legal name change
Since approximately 03:11 UTC on 2026-08-28, every CloudKit private-database write from my iCloud account fails. The app had been syncing normally for weeks before this moment. Failure signature: Every record save returns HTTP 500 with an empty response body (Server: AppleHttpServer, via icloud-xrail). Client-side error: CKErrorDomain 15 (Server Rejected Request) with underlying CKInternalErrorDomain: 2001. Reads succeed. CKContainer.accountStatus reports available. Authentication is fine. Only writes fail. Reproduces identically via NSPersistentCloudKitContainer mirroring and via a raw CKModifyRecordsOperation probe. Device: iPhone 15 Pro Max, iOS 17.2.1. Development environment, private database. Evidence this is account-scoped server state, not app configuration: It reproduces identically in two containers: the original production container and a freshly created container set up after the failures began. A brand-new container failing the same way rules out container-specific corruption or schema issues. Entitlements, embedded provisioning profile, and App ID iCloud capability have all been verified correct (codesign inspection and App Store Connect API). No code or configuration change coincided with the onset. The failure follows my Apple ID across probes over many hours. Every write 500s, without exception. Correlating event: the legal name on my Apple Account was changed at account.apple.com the same morning, shortly before the failures began. I cannot prove causation, but the timing is exact, and the account-scoped, writes-only signature is consistent with a wedge in the account's server-side state (PCS / user-record layer) introduced by the identity change. I request a check of this account's CloudKit/PCS state. Sample failing request UUIDs (x-apple-request-uuid) for locating these in server logs: 244DA811-E4AA-4771-88F0-7C092EFD8DEF, 2026-08-28 ~09:57 UTC 1FD544D6-6ED2-4181-8976-B4F4C35830D9 E55EFF8F-FC32-48BD-9165-F4EA263F130A Many more available on request. The app logs every attempt. Related reports: this appears closely related to thread 843819 (same week, same signature: private-db writes CKError 15 / HTTP 500, fresh container also affected, Console works), and possibly to the recent cluster of private-database reports in threads 838743, 840248, and 839650. Please correlate rather than triage in isolation. Impact: this blocks shipping a family-sharing feature built on CKShare, the purchase-deciding feature of the app. All development on sync is stopped. I can supply on request: a CloudKit sysdiagnose captured during a failing save (per TN3163), additional request UUIDs with timestamps, and the exact local timeline of the account name change.
0
0
214
4w
CloudKit Private Database requests fail with CKError 15 / HTTP 500, while Console works
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.
1
0
480
4w
Collaboration and Send Copy while sharing. How to make it right in Messages?
Hi! I'm working on the app where users can share their content via collaboration or just send copy as a json file. The problem I'm facing is that I cannot make it work correctly in Messages. Having only one option like Collaboration or Send Copy work just fine but with active selector between those two options on share sheet is confuse me a lot. I use ShareLink along with Transferable protocol @ViewBuilder private var control: some View { if let presentation { ShareLink( item: shareItem(for: presentation), preview: preview(for: presentation) ) { label } } else { Button {} label: { label } .disabled(true) } } public static var transferRepresentation: some TransferRepresentation { CKShareTransferRepresentation { item in return item.exportedShare(for: plan) } .exportingCondition { $0.collaborationPlan != nil } FileRepresentation(exportedContentType: .customDocumentType) { item in SentTransferredFile(item.copyFileURL) } } private func exportedShare( for plan: ShareCollaborationPlan ) -> CKShareTransferRepresentation<Self>.ExportedShare { let container = CKContainer(identifier: plan.containerIdentifier) let allowedSharingOptions = LiveCollaborationPermissionPolicy .makeAllowedSharingOptions() switch plan { case let .existing(handle): return .existing( handle.shareForPresentation(title: title), container: container, allowedSharingOptions: allowedSharingOptions ) case .prepare: return .prepareShare( container: container, allowedSharingOptions: allowedSharingOptions ) { [prepareCollaboration] in try await prepareCollaboration().shareForPresentation(title: title) } } } In general this works fine except Messages. When I trying to start Collaboration in Messages, it show an error "Collaboration Not Available" and it is trying to send a file instead of Collaboration link I setup my CKShare like this func shareForPresentation(title: String) -> CKShare { share[CKShare.SystemFieldKey.title] = title if let thumbnailImageData = Self.thumbnailImageData { share[CKShare.SystemFieldKey.thumbnailImageData] = thumbnailImageData } return share } private static let thumbnailImageData: Data? = { #if canImport(UIKit) UIImage(named: "SharePreviewIcon", in: .main, compatibleWith: nil)? .pngData() #else nil #endif }() I have tried to use UIActivityController with NSItemProvider where I use registerCKShare and registerFileRepresentation on the same provider. It works also just fine, except Messages, where it always trying to send Collaboration no matter what I choose Collaboration or Send Copy on share sheet selector. I have tried to use two NSItemProvider's for CKShare and file, this works as I wanted but it messed-up metadata which is I'm not able to setup in the way I want. Please help me to understand how I can setup share where Collaboration and Send Copy work correctly with Messages?
0
0
321
4w
All Production RecordSaves rejected (BAD_REQUEST, _pcs_data) for every user of my container; Development works — FB24378074
My SwiftData app (NSPersistentCloudKitContainer mirroring, private database only) cannot save any record to its CloudKit Production environment, for any user. Development works flawlessly for the same devices, accounts, and code. Signature, from CloudKit Console Production logs: every RecordSave to zone com.apple.coredata.cloudkit.zone fails with overallStatus USER_ERROR, error BAD_REQUEST, returnedRecordTypes "_pcs_data". Reads and zone setup succeed in the same sessions (ZoneSave, SubscriptionCreate, DatabaseChanges, ZoneChanges). Zero successful RecordSaves have ever occurred in this container's Production environment. Facts established so far: 4 of 4 users fail identically (my account + 3 TestFlight testers on unrelated iCloud accounts, iPhone and iPad, iOS 26.6/26.6.x) — so this is not one account's Advanced Data Protection key state. Schema was deployed Dev to Production via Console; the Deploy sheet now reports zero pending changes, and Export Schema from BOTH environments yields identical record type sets. _pcs_data appears in neither export — it is a server-managed system type, so there is no developer action (Console or cktool) that can add it to Production. The model declares no encrypted attributes (allowsCloudEncryption appears nowhere). Entitlements verified with codesign on the shipped TestFlight binary: icloud-container-identifiers, icloud-services=CloudKit, production environment — all correct. Client-side the failure is silent: CKAccountStatus is .available, the container initializes, no error surfaces; the mirroring delegate just stops exporting. Tried without effect: reboots, reinstalls, force-quits, per-app iCloud toggles; storage has ample headroom. This matches the signature in thread 838743 (FB23731287, FB24150787), where multiple developers report the same behavior, unresolved. Filed as FB24378074, which now carries: a CloudKit-profile sysdiagnose captured during a timestamped reproduction, the matching server-side requestId/operationId for that exact save (9265D1CA-86BF-4CEB-A432-43F3F39C891E / A2A2B0F98B389DF8), schema exports from both environments, and a full fault-elimination audit. Question for DTS: what makes a Production environment reject _pcs_data record saves that Development accepts, and what is the supported path to repair this container's Production PCS handling? A live TestFlight beta (a family app; device-to-device sync fully down for all users) is waiting on this. Happy to run further diagnostics on request — a minimal repro project against a fresh container is prepared. Case-ID: 21696635
2
0
652
Aug ’26
NSPersistentCloudKitContainer export blocked account-wide by failing _pcs_data RecordDelete (BAD_REQUEST)
Since ~July 10, NSPersistentCloudKitContainer export has failed on every device on my iCloud account; import still works. In CloudKit Console → Logs (Production), the only failing operations are RecordDelete/RecordSave of record type pcs_data (error BAD_REQUEST) in the private com.apple.coredata.cloudkit.zone. No CD* app-record failures; the app schema is fully deployed to Production. Advanced Data Protection is enabled on the account, so PCS keys are managed end-to-end on-device. This looks like a wedged PCS key state rather than an app/schema problem. Tried with no effect: toggling ADP off/on, toggling iCloud Keychain, multiple reboots, app reinstall, extended foreground on Wi-Fi. Still failing after updating from iOS 27 Seed 3 to beta 4. Is there a way to get the account's Protected Cloud Storage key state reset so export can resume? Happy to share the Feedback number and sysdiagnoses privately with an Apple engineer.
3
0
817
Aug ’26
Sandbox denies mach-lookup com.apple.cloudd only when app is launched outside Xcode (CKError 6)
macOS 26.6.1 on an M4 Mac mini, Xcode 26.6 (building against the macOS 26.5 SDK). Sandboxed SwiftUI app using NSPersistentCloudKitContainer. App: com.klausmack-software.NoteManagerPro Container: iCloud.com.klausmack-software.NoteManagerPro When I launch NoteManagerPro from Xcode, CloudKit sync works. When I launch the exact same build by double-clicking it — from /Applications or straight from the build products folder — CloudKit setup fails with CKError 6 ("Error connecting to CloudKit daemon"), and the kernel logs: Sandbox: NoteManagerPro(4338) deny(1) mach-lookup com.apple.cloudd launchd: denied lookup: name = com.apple.cloudd, requestor = NoteManagerPro[4338], error = 159: Sandbox restriction Sandbox: NoteManagerPro(4338) deny(1) mach-lookup com.apple.duetactivityscheduler Immediately before those lines: secinitd: NoteManagerPro[4338]: AppSandbox request successful kernel: (Sandbox) Sandbox apply: NoteManagerPro[4338] CloudKit additionally logs that the process may need (allow user-preference-read (preference-domain "com.apple.CloudKit")) in its sandbox profile. So the sandbox profile is built, but seemingly without the grants the iCloud entitlements should provide. Everything below is measured, not assumed: codesign -dv --verbose=4: signed with "Apple Development: Klaus Mack", valid on disk, satisfies its designated requirement, hardened runtime, flags=0x10000(runtime) codesign -d --entitlements: app-sandbox, network.client, files.user-selected.read-write, com.apple.developer.icloud-services (CloudKit), com.apple.developer.icloud-container-identifiers, com.apple.developer.ubiquity-kvstore-identifier, com.apple.developer.aps-environment (development), get-task-allow launchctl procinfo on the running process reports the same set as granted, plus "entitlements validated" Contents/embedded.provisionprofile present; platform OSX; contains this Mac's hardware UUID; entitlements include the iCloud container and both container environments Same failure for Debug and Release builds No effect from: deleting the app container (Terminal and Finder with authorisation), restarting the Mac, removing and re-adding the iCloud capability in Xcode, clearing Xcode's provisioning profiles A second app of mine on the same machine, same team, same development certificate, with an almost identical entitlement set, launches from /Applications and syncs without any problem — zero sandbox denials: App: com.klausmack-software.LicenseManager Container: iCloud.com.klausmack-software.LicenseManagerPro The only structural difference I can find is that in the working app the bundle identifier and the container name differ, while in the failing app the container is exactly iCloud. plus the bundle identifier. One more data point. If I change only the bundle identifier of the failing app to com.klausmack-software.NoteManagerPro2 and leave everything else alone, the sandbox denials disappear completely (zero), and CloudKit then reaches the server, which replies: CKError "Partial Failure" (2/1011); "Failed to modify some record zones" com.apple.coredata.cloudkit.zone:defaultOwner = CKError "Permission Failure" (10/2007); server message = "Invalid bundle ID for container" That error is expected, since the container is registered to the original identifier. Changing the identifier back reproduces the original CKError 6 and the sandbox denials exactly. That makes it look as though something is bound to the original bundle identifier rather than to the container directory, the signature, or the launch path. My questions: Where does the sandbox profile get its iCloud-related grants from, given that the entitlements are present and validated at process level? What persistent state could cause those grants to be omitted for one bundle identifier but not another on the same machine, with the same certificate and team? Is there a supported way to inspect or reset that state?
4
0
440
Aug ’26
SwiftData with CloudKit Error: Error updating background task request
Hi, Overview I have a SwiftData project which automatically syncs with CloudKit. When I run the app, I see the following error in Xcode logs. Error updating background task request: Error Domain=BGSystemTaskSchedulerErrorDomain Code=3 "(null)" My attempt I can enable Background processing (under Signing & Capabilities > Background modes), but I don't know the BGTaskSchedulerPermittedIdentifiers to add in the Info.plist Questions How can I resolve this? If I should enable background processing, what are the BGTaskSchedulerPermittedIdentifiers to add in Info.plist?
Replies
19
Boosts
0
Views
2.3k
Activity
16h
CKError 10/2007 "Invalid bundle ID for container" although the container is assigned to the App ID
Every CloudKit request from my app fails with CKError "Permission Failure" (10/2007), server message "Invalid bundle ID for container". Setup: SwiftData / NSPersistentCloudKitContainer, private database, Development environment, explicit container identifier (not the default container). What I verified, following TN3164: The App ID has iCloud with CloudKit enabled and exactly this container assigned. The container is visible in CloudKit Console under the same team. The Xcode-managed provisioning profiles contain the container in both the production and the development container identifier lists. The signed entitlements of the app match: application-identifier, team identifier, container identifiers, environment Development, CloudKit service, get-task-allow. The error occurs on two different devices and in two independent code paths: initializeCloudKitSchema and the normal SwiftData store. It fails while setting up the record zone com.apple.coredata.cloudkit.zone. Per TN3164 this means the association is not synchronized to the CloudKit server. The app is already on the App Store (the current version does not use CloudKit yet) and the next version must keep this container identifier, so switching to a new container is not an option. I have reported this through Feedback Assistant and to Developer Support. I can provide the App ID, container identifier and the failing request IDs privately to anyone from Apple who needs them. Is there anything else I can check on my side, or does this need a manual fix on the CloudKit server?
Replies
0
Boosts
0
Views
32
Activity
1d
CKShare invitation acceptance fails after moving to Unlisted App Distribution — "required version not found in App Store"
We recently moved our app to Unlisted App Distribution (Apple ID 6810578300) after a Guideline 3.2 (Business) rejection under Public distribution. Apple's Unlisted App Request support team approved the transition and confirmed by email that "Unlisted app distribution shouldn't impact the usage of CloudKit sharing, because unlisted app distribution only removes your app from App Store search" — but in practice, CKShare invitation acceptance is now broken. Setup: The app uses CloudKit Sharing (CKShare, generated via UICloudSharingController on macOS) to grant team members access to a shared database. An admin generates an invitation link from the Mac app and sends it to iOS users. Problem: Since the move to Unlisted distribution, tapping/opening a CKShare invitation link fails, even on devices where the app is already installed and fully up to date — including our own development devices. The failure shows one of two behaviors: "[AppName] cannot be opened because it requires a newer version of [AppName], which could not be found in the App Store." The link redirects to the app's App Store page, which itself shows "Open" (already installed/up to date), creating a loop with no way to actually accept the share. We've ruled out: stale installs, device-specific issues, reinstalling the app (Mac and iOS), and network/region issues — this reproduces consistently across multiple devices and Apple IDs. Hypothesis: CKShare's acceptance flow appears to perform a version-compatibility check against the public App Store catalog/search index. Since Unlisted apps are deliberately excluded from that index, this check seems to fail even when the installed app is current, producing a false "no compatible version found" error. Question: Is this a known interaction between CloudKit Sharing and Unlisted App Distribution? Is there a supported workaround — an entitlement, Info.plist key, or CKShare configuration — that allows share-link acceptance to succeed for an app that is intentionally excluded from App Store search? Any guidance from the CloudKit engineering team would be greatly appreciated, as this currently blocks our team from using the app's core sharing feature entirely.
Replies
0
Boosts
0
Views
29
Activity
2d
All records in CloudKit database gone...
I have just lost all records of all record types in a cloud kit database. All schema for all record types are still present. There are no mentions of record deletion or zone deletion in the console. The logging for the App has no mention of any deletion operations... Any idea how this could happen?
Replies
1
Boosts
0
Views
63
Activity
2d
iCloud OAuth2 interest form: What should an unreleased app enter for the required App Store URL?
Hello, I am an individual developer enrolled in the paid Apple Developer Program, developing a native iOS calendar app that has not yet been released on the App Store. I would like to apply for iCloud Calendar access through Apple Account authorization, without requiring users to generate app-specific passwords. In this forum thread, an Apple DTS engineer recommended the iCloud OAuth2 interest form. I can access the form, but both “App Name” and “App Store URL” are required. Could someone clarify the correct process for an unreleased app? Can an individual developer submit an application before the app is published on the App Store? For “App Name,” may I enter the app’s current working name, or must it match an existing App Store Connect record? For “App Store URL,” what should I enter when no public App Store page exists? Would a URL based on an unpublished App Store Connect record’s numeric Apple ID be accepted, or is there an alternative submission process? I contacted Apple Developer Program Support, but they explained that their team handles developer account matters and referred me to technical support and the forums. If another team handles these application requirements, could you please direct me to the appropriate contact? Thank you for your guidance.
Replies
1
Boosts
0
Views
263
Activity
4d
Apple Account authorization instead of app-specific-password
Apple's app-specific password support article says: "For supported third-party apps that access your iCloud Mail, Calendar, and Contacts, you can authorize the app using your Apple Account instead of using an app-specific password." I can't find any documentation about (1) what makes an app "supported," (2) how to apply or qualify, or (3) the technical mechanics — Sign in with Apple, OAuth scopes, MDM, etc. I'm building an iOS app (already approved for Gmail with the gmail.modify scope and CASA-assessed) that monitors a user's mailbox for scam emails with their explicit consent. I'd love to offer the same to iCloud Mail users without requiring the manual app-specific password flow, if there's a Sign in with Apple-style alternative available. Has anyone had success applying for this, or can an Apple engineer point to additional documentation? Thanks!
Replies
4
Boosts
0
Views
501
Activity
4d
CloudKit Production RecordSave fails on _pcs_data (BAD_REQUEST) — reproducible across 2 Apple IDs, works fine in Development
Summary of my issue: CloudKit sync works perfectly in the Development environment, but every single record save to Production fails identically — every build, two different Macs, two different networks, and now under two different, unrelated Apple IDs. The failure isn't in my own record types; it fails on Apple's internal _pcs_data system record, which blocks the entire save (my app's real records included) from ever completing. Because it reproduces under a second, unrelated Apple ID, this doesn't look like account-specific corruption — it looks like broken server-side state on this container's Production environment itself. Exact error I'm seeing: Console.app (identical every occurrence): CoreData+CloudKit: -[NSCloudKitMirroringDelegate _requestAbortedNotInitialized:] (2192): – Never successfully initialized and cannot execute request '' due to error: Error Domain=CKErrorDomain Code=2 UserInfo={ContainerID=, NSDebugDescription=, CKPartialErrors=, RequestUUID=, NSLocalizedDescription=, CKErrorDescription=, NSUnderlyingError=0xa0b048810 {Error Domain=CKInternalErrorDomain Code=1011 UserInfo={CKErrorDescription=, NSLocalizedDescription=, CKPartialErrors=}}} CloudKit Dashboard → Production → Monitor → Logs (5+ RecordSave attempts across days/machines/accounts): Apple ID #1: json { "database": "PRIVATE", "zone": "com.apple.coredata.cloudkit.zone", "userId": "_e7c2879989e20df06db9ddb272805ea7", "operationType": "RecordSave", "platform": "Mac", "overallStatus": "USER_ERROR", "error": "BAD_REQUEST", "interfaceType": "NATIVE", "returnedRecordTypes": "_pcs_data" } Apple ID #2 (unrelated account, tested later): json { "database": "PRIVATE", "zone": "com.apple.coredata.cloudkit.zone", "userId": "_5b6b9a3c5c508babc44894d9f9d324e7", "operationType": "RecordSave", "platform": "Mac", "clientOS": "OSX;26.5.x", "overallStatus": "USER_ERROR", "error": "BAD_REQUEST", "interfaceType": "NATIVE", "returnedRecordTypes": "_pcs_data" } Every other operation type in the same sessions succeeds normally: ZoneFetch, ZoneSave, RecordFetch, SubscriptionCreate, AssetUploadTokenFetch, ZoneChanges, and DatabaseChanges all return overallStatus: SUCCESS. Only RecordSave fails, always on _pcs_data, for both accounts. My best guess...: _pcs_data is Apple's internal Protected Cloud Storage record, used to wrap the encryption keys NSPersistentCloudKitContainer needs before it can write anything to a zone (automatic for any CoreData/SwiftData + CloudKit app, independent of whether any schema field is manually marked "Encrypted"). If that record fails to save, the zone can never finish initializing, which produces exactly the "never successfully initialized" error above. Since Development works fine and Production fails identically for two completely unrelated Apple IDs on the same container, the broken PCS/key-wrapping state appears to live on this container's Production environment itself, not on any one account. What I've tried so far: Entitlements verified correct via codesign -d --entitlements :-, 4 separate times across different signing/provisioning states (Production icloud-container-environment, correct container/team, CloudKit + CloudDocuments services) Push Notifications / aps-environment: added, enabled on the App ID, provisioning profile regenerated — no effect, and confirmed not required for the core mirroring path anyway Schema deployment: CloudKit Dashboard "Deploy Schema Changes to Production" shows an empty diff (0 record types/indexes/security roles) — Production already matches Development exactly No fields marked "Encrypted" in any record type iCloud app permission for this app confirmed ON in System Settings iCloud Keychain "Sync this Mac" toggled off then back on — no effect Exactly 1 iCloud container assigned to the App ID, no duplicates Tested on 2 Macs, 2 networks, 2 unrelated Apple IDs — identical failure every time Development environment works perfectly on every test, including a 31.5MB audio asset upload Advanced Data Protection toggled on then off — no effect CloudKit Dashboard "Reset Environment" — not offered for Production (Apple restricts this to Development only) How to Reproduce: I built a minimal (~150 line) SwiftData + CloudKit project using the same bundle ID, team, and container as my real app: a single @Model class with one field, ModelConfiguration(cloudKitDatabase: .automatic), and a button that inserts and saves a record, observing NSPersistentCloudKitContainer.eventChangedNotification and displaying any error in its own UI. Archived and exported with Production entitlements (not a Debug run), it reproduces the same failure family while working perfectly in Development. Happy to share it if useful. What I'm asking for: This is 100% reproducible, isolated to Production for this specific container, and reproduces under two unrelated Apple IDs with every client-side configuration verified correct. Has anyone else seen _pcs_data RecordSave fail with BAD_REQUEST in Production only? Is there a known fix, or does this need Apple to inspect/reset the server-side PCS state for this container's Production environment? Related threads: I found a couple of related threads while searching before posting this. In Handling CKError.partialFailure with pcs_data errors, an Apple DTS engineer (Ziqiao Chen) explained that _pcs_data/BAD_REQUEST is normally transient and that NSPersistentCloudKitContainer retries automatically, so it usually isn't worth worrying about. That matches what I'd expect for an occasional blip — but in my case it's 100% reproducible, permanent, and blocks every save, which seems like a real deviation from that expected behavior rather than routine noise. I also found a CKShare thread with the exact same signature (RecordSave / BAD_REQUEST / returnedRecordTypes: _pcs_data in a Production private database) that appears to be unresolved, so I don't think I'm the only one hitting this.
Replies
2
Boosts
0
Views
158
Activity
1w
NSPersistentCloudKitContainer Production sharing stuck with partial export, CKError partialFailure and _pcs_data BAD_REQUEST
I have a macOS app using NSPersistentCloudKitContainer with separate private and shared persistent stores and zone-wide CloudKit Sharing. The same Core Data model and sharing implementation work correctly in Development: the complete object graph is shared and bidirectional owner/participant synchronization works. In Production, however, sharing is stuck in a partially exported state. The owner has a complete and internally consistent Core Data object graph. fetchShares(matching:) reports the expected managed objects as belonging to the Production share. However, inspection of the Production shared CloudKit zone shows that many of the corresponding CKRecords were never exported. For example, the participant successfully imports records that actually exist in the shared zone, but entire expected record types such as CD_Missionary and CD_Area are absent from that zone. The Production owner's private persistent store repeatedly reports failed setup/export events. The relevant Core Data + CloudKit log pattern is: Never successfully initialized and cannot execute request due to error: CKErrorDomain Code=2 with an underlying: CKInternalErrorDomain Code=1011 I also correlated multiple failed Core Data export events with CloudKit server logs. Within seconds of the failed exports, CloudKit reports: Database: PRIVATE Operation: RecordDelete Overall Status: USER_ERROR Error: BAD_REQUEST Returned Record Type: _pcs_data The failure is reproducible across multiple export attempts. The Production shared zone itself exists and has zone-wide sharing enabled. The expected cloudkit.share record type is present in Production. I compared the visible Production and Development schemas, including cloudkit.share, and found no obvious record-type/field discrepancy. The important comparison is that Development sharing with the same model/implementation works correctly, while the existing Production mirroring/share state repeatedly fails. I have filed Feedback Assistant report FB24739413, including a sysdiagnose captured while the failure was active, Core Data/CloudKit event diagnostics, CloudKit server-log request IDs, store identifiers, zone information, and reproduction details. My main question is about recovery rather than diagnosis: What is the supported way to recover an existing Production NSPersistentCloudKitContainer share/mirroring state like this and cause the missing managed objects to be exported, without deleting or purging the owner's managed objects? I have deliberately not reset the Production environment, deleted/recreated the share, purged the shared zone, reset the owner's persistent store, or mass-modified the managed objects to try to force re-export. In particular, I understand that purgeObjectsAndRecordsInZone can delete the corresponding managed objects, so I do not want to use destructive recovery techniques without guidance. Is there a supported mechanism for rebuilding/reinitializing the Production mirroring/share state while preserving the owner's existing Core Data object graph, or is this a situation that requires intervention/instructions from Apple? Environment macOS 26.6.2 Core Data + NSPersistentCloudKitContainer CloudKit private + shared persistent stores zone-wide sharing Production failure only Development sharing works correctly Feedback: FB24739413
Replies
1
Boosts
0
Views
501
Activity
1w
iCloud CardDAV returns 401 with fresh app-specific password — also reproducible with vdirsyncer
Hi, I’m trying to access my own iCloud Contacts via CardDAV from a self-hosted web application. Apple’s documentation still states that app-specific passwords can be used for third-party access to iCloud Contacts when the app does not support Apple’s newer authorization flow. However, authentication currently fails consistently with HTTP 401 at the very first CardDAV request. Setup: Apple Account with 2FA enabled correct Apple Account ID / iCloud address freshly generated app-specific password CardDAV endpoint: https://contacts.icloud.com/ HTTP Basic Auth read-only PROPFIND requesting current-user-principal I have reproduced the same result with three independent clients: my own PHP/libcurl implementation a minimal direct cURL/libcurl reference request vdirsyncer 0.21.0 vdirsyncer fails during discovery with: 401 Unauthorized https://contacts.icloud.com/.well-known/carddav In my direct request, Basic Authorization is definitely sent and the server responds 401 before any redirect or personal CardDAV shard discovery occurs. I have also verified: no username mismatch no redirect/auth-header loss no HTTP/1.1 vs HTTP/2 issue no password transformation by the application a fresh app-specific password was copied directly from Apple and tested immediately Interestingly, direct CardDAV access for this same project/account worked previously, so CardDAV itself has worked for this account before. Has anything changed recently regarding authentication to iCloud Contacts/CardDAV? Specifically: Are app-specific passwords still expected to authenticate directly against contacts.icloud.com? Is there any additional account setting or authorization required now? Is .well-known/carddav still the supported discovery route? Is Apple’s newer “Account Data Sharing” authorization available to independent/self-hosted applications for iCloud Contacts, and if so, is there developer documentation for that flow? I’m deliberately not asking about writing contacts yet — this is only a read-only CardDAV authentication/discovery test. Thanks for any pointers. Cheers, Vince
Replies
0
Boosts
0
Views
152
Activity
2w
Sandboxed Mac app denied mach-lookup com.apple.cloudd when signed with Mac Team Store Provisioning Profile on macOS 26
A sandboxed Mac app with correct CloudKit entitlements fails to connect to com.apple.cloudd (the CloudKit daemon) when distributed via TestFlight (Mac Team Store Provisioning Profile). The identical binary works correctly when launched from Xcode (Mac Team Provisioning Profile also present). All entitlements are correctly embedded and the App ID is properly configured in Apple Developer Portal. Environment macOS 26.5.1 (25F80) Xcode 26.5 (17F42) SwiftData with NSPersistentCloudKitContainer / ModelConfiguration(cloudKitDatabase: .private(...)) Steps to Reproduce Create a sandboxed Mac app using SwiftData with CloudKit sync Enable iCloud + CloudKit in Signing & Capabilities Archive and distribute to TestFlight (Mac Team Store Provisioning Profile) Install via TestFlight on macOS 26 and launch Check Console for kernel sandbox messages Expected Result CloudKit connects to com.apple.cloudd and syncs data, matching behavior of the iOS version using the same container. Actual Result Console shows repeated kernel sandbox denials followed by CloudKit setup failure: kernel Sandbox: CheatSheet Mac(82347) deny(1) mach-lookup com.apple.cloudd kernel Sandbox: CheatSheet Mac(82347) deny(1) mach-lookup com.apple.duetactivityscheduler CheatSheet Mac CoreData+CloudKit: Failed to set up CloudKit integration for store Error Domain=CKErrorDomain Code=6 "Error connecting to CloudKit daemon." Key Diagnostic Finding When launched from Xcode, taskgated-helper validates both the Mac Team Store Provisioning Profile AND the Mac Team Provisioning Profile, and CloudKit succeeds: cloudd: TCC approved access for container containerID=iCloud.com.michaelendres.CheatSheet:Production When launched from TestFlight, only the Mac Team Store Provisioning Profile is present, and the sandbox denies com.apple.cloudd despite identical entitlements in the binary: codesign -d --entitlements shows: com.apple.developer.icloud-services: [CloudKit] com.apple.developer.icloud-container-identifiers: [iCloud.com.michaelendres.CheatSheet] com.apple.developer.icloud-container-environment: Production com.apple.security.app-sandbox: true Conclusion The Mac Team Store Provisioning Profile on macOS 26 does not appear to grant the sandbox exception for mach-lookup com.apple.cloudd, while the Mac Team Provisioning Profile (development) does. This prevents any Mac App Store / TestFlight app using CloudKit from syncing on macOS 26.
Replies
17
Boosts
0
Views
2.1k
Activity
2w
CKQuery returns zero records while CKFetchRecordZoneChangesOperation returns 2275 in the same zone — container index corruption?
We have a production CloudKit container where every CKQuery against one specific user's private database returns zero records with no error. The records are present and readable by other means. In a single app launch, against the same private custom zone on that account: CKQuery, NSPredicate(value: true) 0 records, no error CKFetchRecordZoneChangesOperation 2275 records (231 Inspection, 2040 InspectionPhoto, 2 Job, 2 cloudkit.share) Queries return zero for every record type, in both the default zone and the custom zone, and with both NSPredicate(value: true) and a field predicate on an indexed queryable field. Account status is .available and userRecordID resolves normally. No client change preceded this. Other users on the same container and the same binary are unaffected. The user did not delete anything; the trigger appears to have been an unexpected iCloud sign-out mid-session. The same account's private default zone additionally cannot be enumerated at all: CKError.serverRejectedRequest (15) "AppDefaultZone does not support getChanges call" CKInternalErrorDomain code 2027 We understand getChanges is not supported on the default zone. Noting it because our Company record type lives there, so its state cannot be verified by any index-free path, and an empty query result there is uninterpretable. This looks like the container index loss described by DTS in thread 775063 ("I ever saw some CloudKit containers losing their indices, and so a query to the container may not return the right result set"). Filed as FB24641992 with a full diagnostic log attached, including the container identifier, team identifier and the affected user record ID. We have shipped a client-side workaround that falls back to zone enumeration whenever a query returns zero, so the user is unblocked, but the index is still broken and that account now runs entirely on fallback paths. Question: is there a way to get a container re-indexed for a specific account, and is there anything we can do client-side to detect or avoid this state? We could not produce a focused sample project for a code-level support request because the fault is server-side account state, not client code — the same calls on a healthy account in the same container from the same binary return matching results.
Replies
0
Boosts
0
Views
177
Activity
3w
NSCocoaErrorDomain Code=513 after user delete's
I work on an app that saves data to the Documents folder in the users iCloud Drive. This uses the iCloud -> iCloud Documents capability with a standard container. We've noticed an issue where a user will delete the apps data by doing to Settings > {Name} > iCloud > Storage > App Name > select "delete data from iCloud", and then our app can no longer write to or create the Documents folder. Once that happens, we get this error: Error Domain=NSCocoaErrorDomain Code=513 "You don't have permission to save the file "Documents" in the folder "iCloud~your~bundle~identifier"." UserInfo={NSFilePath=/private/var/mobile/Library/Mobile Documents/iCloud~your~bundle~identifier/Documents, NSURL=file:///private/var/mobile/Library/Mobile%20Documents/iCloud~your~bundle~identifier/Documents, NSUnderlyingError=0x1102c7ea0 {Error Domain=NSPOSIXErrorDomain Code=13 "Permission denied"}} This is reproducible using the sample project here https://developer.apple.com/documentation/uikit/synchronizing-documents-in-the-icloud-environment. Steps to reproduce in that project: Tap the plus sign in the top right corner to create a new document Add a document name and tap "Save to Documents" Go to Settings > {Name} > iCloud > Storage > SimpleiCloudDocument App Name > select "delete data from iCloud" Reopen the app and repeat steps 1-2 Observe error on MainViewController+Document.swift:59 Deleting and reinstalling the app doesn't seem to help.
Replies
6
Boosts
0
Views
619
Activity
3w
CloudKit won't sign in for Private Database
I'm trying to review whether my database files are actually populating to the CloudKit private database. For Private and Shared databases, I get a message that I need to sign in again. I do sign in again, but this message never goes away. I have also tried acting as iCloud User. When I enter my iCloud user id and password, I get an authentication error.
Replies
1
Boosts
0
Views
233
Activity
3w
NSPersistentCloudKitContainer never exports changes from the .shared store (participant side)
Hello, I am building an iOS app that uses NSPersistentCloudKitContainer with a two-store configuration (.private + .shared), following the "Sharing Core Data objects between iCloud users" sample. Sharing works in one direction only: the owner's records reach the participant, but nothing the participant writes is ever exported. I have spent a full day isolating this and have ruled out every cause I can think of. I would appreciate guidance on what else to check, or confirmation that this is a limitation I have misunderstood. I have deliberately kept the details below complete, because the interesting part of this report is not the failure itself but everything that has already been eliminated. Environment Xcode 26.6 (17F113) Owner device: iPhone 15 Pro, iOS 26.5.2 Participant device: iPhone 13 mini, iOS 26.0.1 Two devices, two different iCloud accounts CloudKit container: iCloud.com.onton.quipuledger, Development environment NSPersistentCloudKitContainer with two stores: private.sqlite — databaseScope = .private shared.sqlite — databaseScope = .shared Both created exactly as in the sample (the shared description is a copy() of the private one, with a new NSPersistentCloudKitContainerOptions whose scope is .shared) Both stores have NSPersistentHistoryTrackingKey and NSPersistentStoreRemoteChangeNotificationPostOptionKey set viewContext has transactionAuthor, mergePolicy (NSMergeByPropertyObjectTrumpMergePolicy) and automaticallyMergesChangesFromParent = true What works The owner calls share(_:to:) with a set of objects and gets a CKShare. The owner sets publicPermission = .readWrite, saves the share via CKDatabase.modifyRecords, then calls persistUpdatedShare(_:in:). The participant accepts the invitation link. All shared records arrive correctly in the participant's shared.sqlite (164 objects), and subsequent owner-side changes continue to arrive. Import events succeed. What fails Every export from the participant's .shared store fails, regardless of what is written. On the participant device: New object assigned to the shared store via context.assign(_:to:) → never exported Update to an existing record that arrived from the owner → never exported Both are saved successfully to the local store (verified by reading the sqlite file) and appear in the persistent history The corresponding NSPersistentCloudKitContainer.Event reports: type: .export succeeded: false error: NSCocoaErrorDomain Code=134060 userInfo: [:] // completely empty — no underlying error countAffectedObjects: 0 Reading the store's internal metadata tables shows the export never begins: ANSCKEXPORTMETADATA — empty (no history token was ever recorded) ANSCKEXPORTEDOBJECT — 0 rows ANSCKEXPORTOPERATION — 0 rows Meanwhile the same device's .private store exports successfully, and the owner device's .private store (which holds the shared zone) exports successfully as well. What I have ruled out Permissions. On the participant, share.currentUserParticipant reports permission == .readWrite, role == .publicUser, acceptanceStatus == .accepted. Record types. All types exist in the Development schema (verified in CloudKit Console). I also ran initializeCloudKitSchema() to be certain. Server-side rejection. The CloudKit Console Logs show no errors at all — the request never reaches the server. The records themselves. Failure is independent of content: a single entity with no relationships fails exactly like a multi-object graph. Association with the share. fetchShares(matching:) on the participant returns the correct share for the record, with the correct zone name and owner name. Core Data does know the object belongs to the shared zone. Corrupted mirroring metadata. Deleting and reinstalling the app on the participant device reproduces the problem from a clean state. CloudKit itself refusing participant writes. Using the raw CloudKit API on the same device, I saved a CKRecord directly into the same shared zone — this succeeded, and the owner device received a push notification for it. So the account, the zone, the permissions and the record type are all fine; only the Core Data mirroring path fails. Question Given that Core Data correctly associates the object with the share, and that the same device can write to the same zone through the raw CloudKit API, why would the mirroring delegate never schedule an export for the .shared store? Specifically: Is exporting participant-side changes from a .shared store supported by NSPersistentCloudKitContainer? The sample project demonstrates share management and owner-side writes, but I could not find an example of a participant creating or modifying objects in the shared store. If it is supported, what would cause NSCocoaErrorDomain 134060 with an empty userInfo and zero affected objects? Is there a way to obtain the underlying reason? (-com.apple.CoreData.CloudKitDebug 1 produced no additional output for me when the app was launched via devicectl.) Is there any additional setup required on the participant side beyond accepting the share — for example, does a newly created object need to be related to an object that is already part of the share in order to be exported? Thank you very much for your help.
Replies
0
Boosts
0
Views
239
Activity
4w
CloudKit private database: all writes fail with HTTP 500 (empty body), CKErrorDomain 15 / CKInternalErrorDomain 2001, account-scoped, reads unaffected. Began immediately after Apple Account legal name change
Since approximately 03:11 UTC on 2026-08-28, every CloudKit private-database write from my iCloud account fails. The app had been syncing normally for weeks before this moment. Failure signature: Every record save returns HTTP 500 with an empty response body (Server: AppleHttpServer, via icloud-xrail). Client-side error: CKErrorDomain 15 (Server Rejected Request) with underlying CKInternalErrorDomain: 2001. Reads succeed. CKContainer.accountStatus reports available. Authentication is fine. Only writes fail. Reproduces identically via NSPersistentCloudKitContainer mirroring and via a raw CKModifyRecordsOperation probe. Device: iPhone 15 Pro Max, iOS 17.2.1. Development environment, private database. Evidence this is account-scoped server state, not app configuration: It reproduces identically in two containers: the original production container and a freshly created container set up after the failures began. A brand-new container failing the same way rules out container-specific corruption or schema issues. Entitlements, embedded provisioning profile, and App ID iCloud capability have all been verified correct (codesign inspection and App Store Connect API). No code or configuration change coincided with the onset. The failure follows my Apple ID across probes over many hours. Every write 500s, without exception. Correlating event: the legal name on my Apple Account was changed at account.apple.com the same morning, shortly before the failures began. I cannot prove causation, but the timing is exact, and the account-scoped, writes-only signature is consistent with a wedge in the account's server-side state (PCS / user-record layer) introduced by the identity change. I request a check of this account's CloudKit/PCS state. Sample failing request UUIDs (x-apple-request-uuid) for locating these in server logs: 244DA811-E4AA-4771-88F0-7C092EFD8DEF, 2026-08-28 ~09:57 UTC 1FD544D6-6ED2-4181-8976-B4F4C35830D9 E55EFF8F-FC32-48BD-9165-F4EA263F130A Many more available on request. The app logs every attempt. Related reports: this appears closely related to thread 843819 (same week, same signature: private-db writes CKError 15 / HTTP 500, fresh container also affected, Console works), and possibly to the recent cluster of private-database reports in threads 838743, 840248, and 839650. Please correlate rather than triage in isolation. Impact: this blocks shipping a family-sharing feature built on CKShare, the purchase-deciding feature of the app. All development on sync is stopped. I can supply on request: a CloudKit sysdiagnose captured during a failing save (per TN3163), additional request UUIDs with timestamps, and the exact local timeline of the account name change.
Replies
0
Boosts
0
Views
214
Activity
4w
CloudKit Private Database requests fail with CKError 15 / HTTP 500, while Console works
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.
Replies
1
Boosts
0
Views
480
Activity
4w
Collaboration and Send Copy while sharing. How to make it right in Messages?
Hi! I'm working on the app where users can share their content via collaboration or just send copy as a json file. The problem I'm facing is that I cannot make it work correctly in Messages. Having only one option like Collaboration or Send Copy work just fine but with active selector between those two options on share sheet is confuse me a lot. I use ShareLink along with Transferable protocol @ViewBuilder private var control: some View { if let presentation { ShareLink( item: shareItem(for: presentation), preview: preview(for: presentation) ) { label } } else { Button {} label: { label } .disabled(true) } } public static var transferRepresentation: some TransferRepresentation { CKShareTransferRepresentation { item in return item.exportedShare(for: plan) } .exportingCondition { $0.collaborationPlan != nil } FileRepresentation(exportedContentType: .customDocumentType) { item in SentTransferredFile(item.copyFileURL) } } private func exportedShare( for plan: ShareCollaborationPlan ) -> CKShareTransferRepresentation<Self>.ExportedShare { let container = CKContainer(identifier: plan.containerIdentifier) let allowedSharingOptions = LiveCollaborationPermissionPolicy .makeAllowedSharingOptions() switch plan { case let .existing(handle): return .existing( handle.shareForPresentation(title: title), container: container, allowedSharingOptions: allowedSharingOptions ) case .prepare: return .prepareShare( container: container, allowedSharingOptions: allowedSharingOptions ) { [prepareCollaboration] in try await prepareCollaboration().shareForPresentation(title: title) } } } In general this works fine except Messages. When I trying to start Collaboration in Messages, it show an error "Collaboration Not Available" and it is trying to send a file instead of Collaboration link I setup my CKShare like this func shareForPresentation(title: String) -> CKShare { share[CKShare.SystemFieldKey.title] = title if let thumbnailImageData = Self.thumbnailImageData { share[CKShare.SystemFieldKey.thumbnailImageData] = thumbnailImageData } return share } private static let thumbnailImageData: Data? = { #if canImport(UIKit) UIImage(named: "SharePreviewIcon", in: .main, compatibleWith: nil)? .pngData() #else nil #endif }() I have tried to use UIActivityController with NSItemProvider where I use registerCKShare and registerFileRepresentation on the same provider. It works also just fine, except Messages, where it always trying to send Collaboration no matter what I choose Collaboration or Send Copy on share sheet selector. I have tried to use two NSItemProvider's for CKShare and file, this works as I wanted but it messed-up metadata which is I'm not able to setup in the way I want. Please help me to understand how I can setup share where Collaboration and Send Copy work correctly with Messages?
Replies
0
Boosts
0
Views
321
Activity
4w
All Production RecordSaves rejected (BAD_REQUEST, _pcs_data) for every user of my container; Development works — FB24378074
My SwiftData app (NSPersistentCloudKitContainer mirroring, private database only) cannot save any record to its CloudKit Production environment, for any user. Development works flawlessly for the same devices, accounts, and code. Signature, from CloudKit Console Production logs: every RecordSave to zone com.apple.coredata.cloudkit.zone fails with overallStatus USER_ERROR, error BAD_REQUEST, returnedRecordTypes "_pcs_data". Reads and zone setup succeed in the same sessions (ZoneSave, SubscriptionCreate, DatabaseChanges, ZoneChanges). Zero successful RecordSaves have ever occurred in this container's Production environment. Facts established so far: 4 of 4 users fail identically (my account + 3 TestFlight testers on unrelated iCloud accounts, iPhone and iPad, iOS 26.6/26.6.x) — so this is not one account's Advanced Data Protection key state. Schema was deployed Dev to Production via Console; the Deploy sheet now reports zero pending changes, and Export Schema from BOTH environments yields identical record type sets. _pcs_data appears in neither export — it is a server-managed system type, so there is no developer action (Console or cktool) that can add it to Production. The model declares no encrypted attributes (allowsCloudEncryption appears nowhere). Entitlements verified with codesign on the shipped TestFlight binary: icloud-container-identifiers, icloud-services=CloudKit, production environment — all correct. Client-side the failure is silent: CKAccountStatus is .available, the container initializes, no error surfaces; the mirroring delegate just stops exporting. Tried without effect: reboots, reinstalls, force-quits, per-app iCloud toggles; storage has ample headroom. This matches the signature in thread 838743 (FB23731287, FB24150787), where multiple developers report the same behavior, unresolved. Filed as FB24378074, which now carries: a CloudKit-profile sysdiagnose captured during a timestamped reproduction, the matching server-side requestId/operationId for that exact save (9265D1CA-86BF-4CEB-A432-43F3F39C891E / A2A2B0F98B389DF8), schema exports from both environments, and a full fault-elimination audit. Question for DTS: what makes a Production environment reject _pcs_data record saves that Development accepts, and what is the supported path to repair this container's Production PCS handling? A live TestFlight beta (a family app; device-to-device sync fully down for all users) is waiting on this. Happy to run further diagnostics on request — a minimal repro project against a fresh container is prepared. Case-ID: 21696635
Replies
2
Boosts
0
Views
652
Activity
Aug ’26
NSPersistentCloudKitContainer export blocked account-wide by failing _pcs_data RecordDelete (BAD_REQUEST)
Since ~July 10, NSPersistentCloudKitContainer export has failed on every device on my iCloud account; import still works. In CloudKit Console → Logs (Production), the only failing operations are RecordDelete/RecordSave of record type pcs_data (error BAD_REQUEST) in the private com.apple.coredata.cloudkit.zone. No CD* app-record failures; the app schema is fully deployed to Production. Advanced Data Protection is enabled on the account, so PCS keys are managed end-to-end on-device. This looks like a wedged PCS key state rather than an app/schema problem. Tried with no effect: toggling ADP off/on, toggling iCloud Keychain, multiple reboots, app reinstall, extended foreground on Wi-Fi. Still failing after updating from iOS 27 Seed 3 to beta 4. Is there a way to get the account's Protected Cloud Storage key state reset so export can resume? Happy to share the Feedback number and sysdiagnoses privately with an Apple engineer.
Replies
3
Boosts
0
Views
817
Activity
Aug ’26
Sandbox denies mach-lookup com.apple.cloudd only when app is launched outside Xcode (CKError 6)
macOS 26.6.1 on an M4 Mac mini, Xcode 26.6 (building against the macOS 26.5 SDK). Sandboxed SwiftUI app using NSPersistentCloudKitContainer. App: com.klausmack-software.NoteManagerPro Container: iCloud.com.klausmack-software.NoteManagerPro When I launch NoteManagerPro from Xcode, CloudKit sync works. When I launch the exact same build by double-clicking it — from /Applications or straight from the build products folder — CloudKit setup fails with CKError 6 ("Error connecting to CloudKit daemon"), and the kernel logs: Sandbox: NoteManagerPro(4338) deny(1) mach-lookup com.apple.cloudd launchd: denied lookup: name = com.apple.cloudd, requestor = NoteManagerPro[4338], error = 159: Sandbox restriction Sandbox: NoteManagerPro(4338) deny(1) mach-lookup com.apple.duetactivityscheduler Immediately before those lines: secinitd: NoteManagerPro[4338]: AppSandbox request successful kernel: (Sandbox) Sandbox apply: NoteManagerPro[4338] CloudKit additionally logs that the process may need (allow user-preference-read (preference-domain "com.apple.CloudKit")) in its sandbox profile. So the sandbox profile is built, but seemingly without the grants the iCloud entitlements should provide. Everything below is measured, not assumed: codesign -dv --verbose=4: signed with "Apple Development: Klaus Mack", valid on disk, satisfies its designated requirement, hardened runtime, flags=0x10000(runtime) codesign -d --entitlements: app-sandbox, network.client, files.user-selected.read-write, com.apple.developer.icloud-services (CloudKit), com.apple.developer.icloud-container-identifiers, com.apple.developer.ubiquity-kvstore-identifier, com.apple.developer.aps-environment (development), get-task-allow launchctl procinfo on the running process reports the same set as granted, plus "entitlements validated" Contents/embedded.provisionprofile present; platform OSX; contains this Mac's hardware UUID; entitlements include the iCloud container and both container environments Same failure for Debug and Release builds No effect from: deleting the app container (Terminal and Finder with authorisation), restarting the Mac, removing and re-adding the iCloud capability in Xcode, clearing Xcode's provisioning profiles A second app of mine on the same machine, same team, same development certificate, with an almost identical entitlement set, launches from /Applications and syncs without any problem — zero sandbox denials: App: com.klausmack-software.LicenseManager Container: iCloud.com.klausmack-software.LicenseManagerPro The only structural difference I can find is that in the working app the bundle identifier and the container name differ, while in the failing app the container is exactly iCloud. plus the bundle identifier. One more data point. If I change only the bundle identifier of the failing app to com.klausmack-software.NoteManagerPro2 and leave everything else alone, the sandbox denials disappear completely (zero), and CloudKit then reaches the server, which replies: CKError "Partial Failure" (2/1011); "Failed to modify some record zones" com.apple.coredata.cloudkit.zone:defaultOwner = CKError "Permission Failure" (10/2007); server message = "Invalid bundle ID for container" That error is expected, since the container is registered to the original identifier. Changing the identifier back reproduces the original CKError 6 and the sandbox denials exactly. That makes it look as though something is bound to the original bundle identifier rather than to the container directory, the signature, or the launch path. My questions: Where does the sandbox profile get its iCloud-related grants from, given that the entitlements are present and validated at process level? What persistent state could cause those grants to be omitted for one bundle identifier but not another on the same machine, with the same certificate and team? Is there a supported way to inspect or reset that state?
Replies
4
Boosts
0
Views
440
Activity
Aug ’26