iOS 7: iCloud backup fails silently

Like so many other people, I have an iOS 7 device that fails to backup to iCloud. Automatic backups don't occur, and I periodically get the "your iPhone has not been backed up in n weeks" message. Manual backups fail silently.

I used Xcode to look at the iPhone's console while running a manual backup, and I saw this message:

backupd[26422] <Warning>: WARNING: MobileKeyBag: _MKBBackupCheckKey: corrupt key; blob size 100, header+key size 2964429488
backupd[26422] <Warning>: WARNING: Failed to validate encryption key (protection class changed?): /var/mobile/Applications/EDED6B41-0E2A-4705-9E20-21223266C7CF/Library/googleanalytics.sql (acdcbfc20cba94afaf0d751d3cf039d68046bed5)
backupd[26422] <Warning>: WARNING: MobileKeyBag: MKBBackupCopyKey: Failed to rewrap
backupd[26422] <Warning>: INFO: Not retrying after unrecoverable error: Missing encryption key for file (MBErrorDomain/209)
backupd[26422] <Warning>: ERROR: Backup failed: Missing encryption key for file (MBErrorDomain/209)

So there is a specific file for a specific app which makes the entire backup fail. This matches one of the folk remedies suggested in the numerous threads on this issue in support forums: disable backing up all apps, then do a binary search to find out which one causes the backup to fail.

I thought it would be better to find a simpler solution. I couldn't figure out which app corresponds to that path in the filesystem, but the "Failed to validate encryption key (protection class changed?)" made me think that perhaps deleting the existing backup (from the iOS 6 days) might make things work again.

It actually made things worse: now I get a few screens' worth of messages like these:

backupd[26468] <Warning>: WARNING: MobileKeyBag: MKBBackupCopyKey: Failed to rewrap
backupd[26468] <Warning>: INFO: Encryption key not found for protected file: /var/mobile/Applications/68655AB4-A485-47BF-9E57-CA5BA6EB08C4/Documents/Inbox/request-8.mkdirectionsrequest (5ad7be5ccbc7c8ae2f7a0fee2a5e21bb590e2568)

I tried googling the error messages, but nothing useful turned out. That surprised me: obviously lots of people are having problems with iCloud backup, judging by all the support threads, but nobody thought to look at the logs?

Hopefully this can become the place where we actually find a solution.


Solution 1:

My iPad had the same problem in November. The only way I was able to fix it was to delete the most resent iCloud backup(s) from/for the troubled device until it I could complete a manual iCloud back. As a precaution create a local back up on your computer before deleting iCloud backups(s).

Solution 2:

The error messages shows the location of apps with the 'bad file':

/var/mobile/Applications/EDED6B41-0E2A-4705-9E20-21223266C7CF/
/var/mobile/Applications/68655AB4-A485-47BF-9E57-CA5BA6EB08C4/

You could use an app such as iExplorer to browse to this location and determine which app it is.

Without jailbreaking your device, you will still have read/write access to the Media ("/var/mobile/Media/") and Apps ("/var/mobile/Applications") directories in iExplorer.

Source: Access the iPhone root ("/") directory

Once you know the app, you can delete it.