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".

  • 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

Accepted Reply

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.

  • Jinx! I can confirm that. Works for me, too.

  • Beta 5 has not resolved this for me (Just running a boiler place new project - can someone else please do a new project boiler plate build and confirm that they are seeing the same?)

  • Not working for me in beta 5 at all. This all started with beta 4 (see my post below).

Add a Comment

Replies

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?

  • I have a private app, build with the previous stable Xcode and it's also failing on my devices with beta 4.

    I was expecting an emergency update today :(

  • Yes, I have this issue in the Development Environment with my app... and in the Production Environment if I download and use my publicly available App Store version, but running on an iOS15 device. It broke with beta 4 and is still broken.

Add a Comment

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 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?

  • There is currently a confusing mismatch between the reported CloudKit account status (.available) and the error reported when executing a CloudKit operation (.accountTemporarilyUnavailable). There is also a new account status (.temporarilyUnavailable) but this is not being returned.

  • That’s where it will prompt you to re-enter your password if you never got a dialog or dismissed it. That was the first place I went when I got this error, but everything was fine in settings sooo……

  • Probably they are adding some new security measures and they were not so nice to include a warning.

Add a Comment

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)")

        } `

  • In the past, on a simulator, I rejected that prompt to test my app. The app still worked as if it were offline (exactly as I expected) until I went to settings.app and entered my password there. This time around I’m on a device, I never see a prompt, and settings says icloud is fine and dandy.

Add a Comment

I actually see the authentication prompts mentioned by cyclic, just before executing a CloudKit operation on beta 4. When I reject these prompts, I see error message "User rejected a prompt to enter their iCloud account password".

When I enter my credentials, I see the error message where this whole thread is about.

I'm not sure if it's relevant, but I only see the authentication prompt on devices without two factor authentication, every time when I start a new CloutKit operation.

It seems that Apple is experimenting in a very buggy way with new errors messages, while in the meantime we (third party app developers) can't proceed with our normal work.

Seeing the same error on both macOS 12 beta 4 and iOS 15 beta 4 simulator.

<CKError 0x600001a2dbc0: "Account Temporarily Unavailable" (1028/2011); "Account temporarily unavailable due to bad or missing auth token">

Filed FB9435854.

  • Same in beta 5. This is very, very frustrating.

  • I'm seeing an attempt to sync... but nothing happens and then this appears in the console (despite the app being in the foreground the whole time):

    CoreData: CloudKit: CoreData+CloudKit: -[NSCloudKitMirroringDelegate executeMirroringRequest:error:]: <NSCloudKitMirroringDelegate: 0x6000015515c0>: Asked to execute request: <NSCloudKitMirroringExportRequest: 0x600002ed2a30> CBE1852D-7793-46B6-8314-A681D2038B38

    2021-08-13 08:41:01.518422+1000 Somnus[11058:671570] [BackgroundTask] Background Task 68 ("CoreData: CloudKit Export"), was created over 30 seconds ago. In applications running in the background, this creates a risk of termination. Remember to call UIApplication.endBackgroundTask(_:) for your task in a timely manner to avoid this.

    2021-08-13 08:41:03.519455+1000 Somnus[11058:671570] [BackgroundTask] Background Task 154 ("CoreData: CloudKit Scheduling"), was created over 30 seconds ago. In applications running in the background, this creates a risk of termination. Remember to call UIApplication.endBackgroundTask(_:) for your task in a timely manner to avoid this.

Add a Comment

Seeing the same error - basic boiler plate code, so it's not program logic that's causing this.

Workaround (if you don't depend on iOS 15 APIs) is to use a Simulator device with a previous runtime like iOS 14.5, CloudKit works there.

Out of interest I've just confirmed that this error also occurs when I connect a physical iPad to the Mac and run the app there, so I don't believe it is a simulator error.