iOS 15 beta 4 CloudKit Auth Error

I'm seeing auth failures when attempting CloudKit operations:

"Account Temporarily Unavailable" (36/1028); "Account temporarily unavailable due to bad or missing auth token"

I see this for Modify zone operations, Modify records, and zone changes too. Everything. Only started happening after updating to iOS 15 beta 4 and Xcode 13 beta 4.

Account status is "available".

Answered by iturrajoel in 684303022

iOS 15 Beta 5 fixed the problem that my ad-hoc app was having on the devices with beta 4.

Hopefully, there will be an Xcode beta 5 today, too.

CKErrorDescription=Account temporarily unavailable due to bad or missing auth token

CoreData: CloudKit: CoreData+CloudKit: -[NSCloudKitMirroringDelegate _scheduleAutomatedImportWithLabel:activity:completionHandler:]_block_invoke(2775): <NSCloudKitMirroringDelegate: 0x28326c0c0> - Finished automatic import - SandboxImport - with result: <NSCloudKitMirroringResult: 0x280722dc0> success: 0 madeChanges: 0 error: Error Domain=NSCocoaErrorDomain Code=134410 "(null)" UserInfo={NSUnderlyingError=0x280987db0 {Error Domain=CKErrorDomain Code=36 "CKInternalErrorDomain: 1028" UserInfo={NSUnderlyingError=0x2809a7900 {Error Domain=CKInternalErrorDomain Code=1028 "Account temporarily unavailable due to bad or missing auth token" UserInfo={CKErrorDescription=Account temporarily unavailable due to bad or missing auth token, NSLocalizedDescription=Account temporarily unavailable due to bad or missing auth token, NSUnderlyingError=0x2809a69d0 {Error Domain=CKInternalErrorDomain Code=2011 "Couldn't get an authentication token" UserInfo=0x2812a2200 (not displayed)}}}, CKErrorDescription=Account temporarily unavailable due to bad or missing auth token, NSDebugDescription=CKInternalErrorDomain: 1028, NSLocalizedDescription=Account temporarily unavailable due to bad or missing auth token}}}

I’ll also add that I see this across two different applications that I use CloudKit in

I'm seeing this as well, on my iPhone 12, and on the iPhone 12, 12 Pro and iPad 11inch simulators.

In my testing this is affecting apps on iOS 15b4 and macOS 12b4 using CloudKit, but only TestFlight/Beta builds done with Xcode 13 (doesn't have to be b4, b3 builds seem to have the problem, too). App Store releases of my app seem not to exhibit the issue when running on iOS 15b4 or macOS 12b4 - is this what others are seeing as well?

Same here - I have a CoreData with CloudKit integration, everything worked on previous version and after installing XCode 13.0 beta 4 yesterday - not working anymore and failing with error:

error: CoreData+CloudKit: -[PFCloudKitSetupAssistant _checkUserIdentity:](1217): <PFCloudKitSetupAssistant: 0x60000217db00>: Identity fetch failed with unknown error: <CKError 0x600000bcd2f0: "Account Temporarily Unavailable" (1028/2011); "Account temporarily unavailable due to bad or missing auth token">

Resetting (clear) simulator etc does not seem to help.

I'm currently seeing similar errors "Account Temporarily Unavailable" (1028/2011); "Account temporarily unavailable due to bad or missing auth token" in Xcode 13 when running a macOS CloudKit app. This happens on two different Macs with macOS 12 beta 4.

CloudKit account is 'available', but all syncing operations fails with this error.

The same app downloaded from the Mac App Store runs and syncs without errors.

Update: I'm also sometimes seeing this error: "Not Authenticated" (2011); "User rejected a prompt to enter their iCloud account password".

I have a small, private, personal app that only uses the Development DB for CloudKit-CoreData.

Using Xcode 13 beta 4:

  • The Mac version of the app (running in Big Sur 11.5 (Intel)) seems to work fine. I don't see the above error message in the Xcode spew-log.

  • When I run the iOS version of the app (shared core data context) on an iPhone 12 running iOS 15 beta 4, I get the Account temporarily unavailable error message, as have others.

  • When I run the app on any of the simulators, I get the same error message.

For whatever that's worth. Compiling with Xcode 13b4 doesn't wreck the app for macOS 11.x.

Please don't forget to create a new feedback. Apple needs to prioritize this bug.

I started seeing this issue in Xcode 13 beta 1 on the sim, however it did not occur when running on an actual device with iOS 15 beta, so I had assumed it was a beta sim problem. As of beta 4 it has now started happening on the device as well. Worth adding that the app breaks even though it’s a TF and built with Xcode beta 3, which ran fine (on device, as mentioned) before updating to beta 4, so I think it’s safe to assume this is an OS issue and not a toolchain issue.

I started seeing this error as well ever since updating to iOS 15 beta 4 and Xcode 13 beta 4. It appears to me that CKErrorAccountTemporarilyUnavailable is new in iOS 15 and macOS 12.

According to the available online documentation:

You receive this error when the user’s iCloud account is available, but isn’t ready to support CloudKit operations. Don’t delete any cached data and don’t enqueue any additional CloudKit operations.  Checking the account status after the operation fails, assuming there are no other changes to the account’s status, returns CKAccountStatusTemporarilyUnavailable. Use the CKAccountChangedNotification notification to listen for future account status changes, and retry the operation after the status becomes CKAccountStatusAvailable.

On the other hand, the comment next to this error code in CKError.h (header file) reads:

The current account is in a state that may need user intervention to recover from. The user should be directed to check the Settings app. Listen for CKAccountChangedNotifications to know when to re-check account status and retry. 

I wonder if there is something we might be missing here? What exactly is the user supposed to do in the Settings app?

Working on one demo, it does not work with Xcode beta4 on iOS 15 device, giving error "Account Temporarily Unavailable". Run same code using Xcode 12.5 on iOS 15 device, it works. So its Xcode issue may be?

Tried signing out of iCloud and signing back in, syncing, but it still fails. This is something else.

Seeing this as well, "Account temporarily unavailable due to bad or missing auth token" filed a feedback.

More info added to the issue.

I added a do catch around modify subscription method, and see the error returned by CloudKit: "User rejected a prompt to enter their iCloud account password"

Obviously, I'm not seeing any prompts.

Error is:

`do {

            _ = try await database.modifySubscriptions(saving: [subscription], deleting:nil

            self.setSubscriptionState(recordType: recordType)

        } catch(let error) {

            logger.debug("(error.localizedDescription)")

        } `

iOS 15 beta 4 CloudKit Auth Error
 
 
Q