Bricked com.apple.homekit.config CloudKit container

How did the issue (probably) occur?

  • The issue appeared in January 2024 after setting up a new Apple TV 4K (tvOS 16.X and updated to latest tvOS after setup) or a new Apple Watch Ultra 2 (watchOS 10.X and updated after setup). Both devices were set up using my personal iCloud and both were set up to use HomeKit. I suspect the issue is related to the creation of a new Home that was subsequently shared to a family member (see below).

How did I notice the issue?

  • From the week that followed, I noticed that my iPhone 15 Pro Max tends to get really hot in standby and that the battery drops significantly in the space of a couple standby hours. (Worst case I’ve experienced is about ~80% drop in 4 hours standby)

  • Apple Watch also has huge drops in battery life. Again, to give some perspective: I wear my AW for sleep tracking, sometimes AW will drop ~5% throughout the night, sometimes ~60% (and turn off if it was charged below 60%, making me lose my sleep tracking).

  • My iPad Pro occasionally loses ~30-50% charge over night in standby.

  • I went to the Battery section of the Settings app on my iPhone and iPad and could notice that about 50-75% of the time (over 24h that is), Home Accessories is running in the background. I could not confirm this on Apple Watch as the battery section of Settings does not show per app usage, however clear drops in battery percentage are noticeable from the graph.

What's the issue?

  • Seeing the issue arise on three of my four portable Apple devices, I decided to go check on my MacBook Pro M1 Max in Activity Monitor if the same behaviour was to be seen. I quickly realised that the Home Daemon (homed) is permanently running in background at (unusual) high usage. It is the top entry in CPU usage and Uptime.

  • Going into the Console app I can see that the homed daemon on macOS is throwing 3x-5x batches of the same 5 error messages each second. The errors are the following:

  • In the same Console app, connecting to my iPhone and my iPad, I can see the exact same errors occurring at approximately the same rate.

What is the issue in technical terms?

  • My CloudKit HomeKit config (com.apple.homekit.config) container is bricked and returns an internal server error
  • The homed/cloudd daemons do not have a backoff policy and retry fetching the CloudKit database instantly on failure. This leads to an infinite loop of network requests going out and draining my battery on all devices massively.

How did I try to solve the issue?

All these measures were unsuccessful:

  • Restarting all devices

  • All devices are on the latest version

  • Deleting the Home app where possible

  • Turning off Home, Keychain and iCloud Drive in iCloud settings

  • Signing out of iCloud and signing in again

  • Using the HomeKit Reset mobileconfig profile where possible (http://appldnld.apple.com/iOSProfiles/HomeKitReset.mobileconfig)

  • Use the previously mentioned reset profile in combination with a HomeKit Architecture downgrade (http://appldnld.apple.com/iOSProfiles/KeepLegacyHome.mobileconfig)

  • On macOS, delete ~/Library/HomeKit

  • Sending sysdiags using the Feedback Assistant (FB13529370, still open)

  • Manually revoking all (pending and accepted) home invitations and deleting all homes from the Home app

  • Removing all Apple TVs and HomePods from my iCloud account

  • Reseting and repairing Apple Watch

  • Disabled Advanced Data Protection on iCloud

  • Logging out of all my devices’ iCloud, use the reset profile, wait 20min, login to iCloud, the issue reappears in the console (while no other devices are logged in)

  • Changing Apple ID password and choose to log out all devices, log in again into a single device, use the reset profile, wait 20min, and the issue reappears in the console

  • To be absolutely sure it is an iCloud issue and not a local misconfiguration (that could be solved by resetting all my devices), I took an older iPhone 12 Pro and set it up as a new device with no apps/account/data, just a blank installation of iOS. As one would expect, the issue is not present and the Console app does not show any errors. As soon as I log into my iCloud account, the Home daemon homed throws the same 5 errors over and over and the battery draining issue magically appears.

  • This confirms my theory that it is indeed an iCloud issue on the server-side and not a client-side issue. Reseting my devices would not help fix the issue as demonstrated by a blank iOS installation on a separate iPhone 12 Pro getting the same error just by logging into my iCloud account.

  • I’ve had an Apple Support case for over five months, it has been (unsuccessfully) escalated twice to engineering. While many basic troubleshooting steps have been taken, nothing helped. Also, while the Apple Support agent is really trying their best to help me, they understand the symptoms of the problem but not the root cause which I tried explaining multiple times. Essentially we’re sticking to the Apple Support instructions they have, and doing basic diagnostics and battery troubleshooting even though I technically understand and can explain the issue to a CloudKit engineer.

  • We even proceeded to do a fresh install of macOS on a separate volume and took diagnostics before and after login in with my Apple ID. They were able to confirm that there is indeed a massive battery drain issue related to my account.

  • The case is still open but is currently leading nowhere, I'm just told to keep my devices updated...

How Apple can fix the issue:

  • Investigating the internal server error and fixing the record(s) or the CoreData entity that is throwing the problem
  • Implementing a client-side backoff policy for internal server errors coming from iCloud.
  • Quite trivially by reseting my com.apple.homekit.config container

Also worth mentioning:

  • I don’t use a VPN or any Proxy
  • I’m fine with losing all my HomeKit-related data on my iCloud account. At this point I just want the issue to disappear and to have useable battery life on all my devices. I’m giving my consent to the immediate and irrevocable deletion of all my past and present HomeKit-related data.

Using the reset profile for HomeKit on a device running iOS/iPadOS 17.5.1 (as was suggested by an Apple Engineer) does not reset the container.

Logs show that the iCloud container is (I would assume) too corrupted to purge. The following error is logged repeatedly:

[Reset Config] purgeShares CKModifyRecordsOperation failed: <CKError 0xc7b21f5d0: "Internal Error" (1/1000); "Received a didCompleteWithError without an error but no response body where one was expected">

[Reset Config] purgeShares returned error <CKError 0xc7b21f5d0: "Internal Error" (1/1000); "Received a didCompleteWithError without an error but no response body where one was expected">. Will try to continue.

[Reset Config] :Purging shares of zones on HH2 failed with error: <CKError 0xc7b21f5d0: "Internal Error" (1/1000); "Received a didCompleteWithError without an error but no response body where one was expected">

Quick update on anyone with the same issue:

I had a call with two CloudKit engineers last week and they basically confirmed my theory that something is corrupted. Essentially one of my homes is shared with an inexistant Apple ID (no clue how that happened, the other Apple ID still exists), so that's why iCloud servers are continuously responding with Not Authenticated and Internal Server Error.

In other words, there's nothing you can do client-side, you need to have a CloudKit engineer manually delete the broken home from your iCloud.

@Marco and @John, could I have a quick update on the deletion of the corrupted home? It's been a week and I don't have any other way to contact you other than this forum post. 😕

Bricked com.apple.homekit.config CloudKit container
 
 
Q