7

After having set up my new Macbook Pro 2021 (macOS Monterey 12.1) with migrating data over from my old Macbook Pro, I started a new Time Machine backup on NAS. The backup took several hours and obviously backed up everything to NAS. Subsequent backups reported that they backed up only a few hundred MB, so it looked like everything was working.

However, checking the backup status in the Time Machine prefs, the status reports

Waiting to complete first backup 

Checking the size of the sparsebundle on the NAS, it's said to be approx. 400 GB, so definitely holding an amount of data which meets my expectations for a successful backup.

I downloaded TheTimeMachineMechanics to find out about any errors, and there I see a message

Backup failed (104: BACKUP_DELAYED_UNFINISHED_PROTECTED_FILES)

It looks like the backup has been made, but for some reason it's not fully completed. How to fix that?


Things I tried (possible solutions found in the net):

  • boot up in safe mode and backup from there
  • use Disk Utility and run a repair

but to no avail.

2 Answers 2

6

UPDATE

This issue seems to be effectively fixed in macOS 12.2 – so first try updating macOS. Implement below work-around only if the update does not fix it for you.


This can happen when Time Machine tries to backup files that it does not have access to for some reason.

To verify that this is the cause, check the log file after Time Machine has finished a backup attempt:

log show --style syslog --last 30m  --predicate 'senderImagePath contains[cd] "TimeMachine"' --info --debug

In the log, search for entries like these (search for 'access'):

localhost backupd[256]: (TimeMachine) [com.apple.TimeMachine:EventCollection] Adding event for inaccessible protected file Users/xxxx/Library/Containers/com.apple.findmy.FindMyWidgetIntentsItems/Data/Documents | EventDatabase.swift:569

Adding event for inaccessible protected file means that Time Machine wants to back these files (or files in these folders), but cannot access them because they are protected. It therefore delays the backup until they become accessible. However, that never happens.

It looks like this happens with a couple of folders that are connect to the Find My Mac functionality. I assume they are system protected so they cannot be tampered with, but the fact that Time Machine attempts to back them up, and the system won't let it, seems like a bug in macOS Monterey.

How to fix it

As a solution to work around this probable bug, all the problem folders must be excluded from the backup. This needs to be done in the terminal, because if you try to select the folders from System Preferences > Time Machine > Options, you will notice that the problem folders are not visible from the file selection dialog, which is probably due to their additional protection.

Fortunately, we can exclude files and folders from the terminal using tmutil addexclusion. In my case, the problem folders were:

sudo tmutil addexclusion -p /Users/xxx/Library/Containers/com.apple.findmy
sudo tmutil addexclusion -p /Users/xxx/Library/Containers/com.apple.findmy.FindMyNotificationsServiceExtension
sudo tmutil addexclusion -p /Users/xxx/Library/Containers/com.apple.findmy.FindMyWidgetItems
sudo tmutil addexclusion -p /Users/xxx/Library/Containers/com.apple.findmy.FindMyWidgetPeople
sudo tmutil addexclusion -p /Users/xxx/Library/Containers/com.apple.findmy.FindMyWidgetIntentsItems
sudo tmutil addexclusion -p /Users/xxx/Library/Containers/com.apple.findmy.FindMyWidgetIntentsPeople

(copy, paste and execute line by line, and of course replace xxxx)

Option -p causes the given path to be excluded, even if it does not yet exist, but when it is created in the future. If you have multiple users, remember to do this for each user.

I recommend that you check the log if there are any additional problems. In my case, only the above folders related to Find My Mac had to be excluded.

Check the excluded folders in System Preferences > Time Machine > Options - they should all show a data size on the right – otherwise check for typos.

After that, start a new backup and cross your fingers.

Credits to this post in the Apple Community by George Harker.

Important addition

I've noticed that data in ~/Library/Containers can be affected, too, and this may happen anytime again even after Time Machine had already been successfully completing backups. In my case, the Amazon Prime Video app created data here which Time Machine claimed to be inaccessible. As a preliminary work-around, I decided to exclude the whole directory /Users/xxx/Library/Containers from Time Machine.

Looking forward to Apple fixing this!

3
  • Beautiful — those findmy exclusions fixed it right away. Thanks!
    – JW.
    Jan 10, 2022 at 0:33
  • @JW You may want to upvote questions and/or answers that were helpful.
    – not2savvy
    Jan 10, 2022 at 12:51
  • 1
    Encountered this and fixed it using this method in macOS 13.4 on a specific folder of the Wired iOS app. Thanks @not2savvy. I did use the generic tilde "~" before "/Libr…" rendering any user name variations irrelevant for sharing this solution. So "~/Library/Containers/[path-to-problem-folder".
    – MiB
    May 25, 2023 at 18:44
0

Building off of not2savvy's answer above, I encountered a similar error on macOS 12.4, due to issues with container files from GoodNotes and Amazon Video.

I ran the below command to see the offending folders

$ log show --info --style compact --predicate '(subsystem == "com.apple.TimeMachine") && (eventMessage like[cd] "Failed * acquire device lock assertion*")' --last 24h
2022-05-23 19:11:42.983 E  backupd[82164:141aa7] [com.apple.TimeMachine:FileProtection] Failed to acquire device lock assertion - deferring copy of '/Volumes/com.apple.TimeMachine.localsnapshots/Backups.backupdb/jim’s MacBook Pro/2022-05-23-142425/Data/Users/jim/Library/Containers/com.amazon.aiv.AIVApp/Data/Library/Saved Application State/com.amazon.aiv.AIVApp~iosmac.savedState/data.data', error: Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted"
2022-05-23 19:12:27.433 E  backupd[82164:141aa7] [com.apple.TimeMachine:FileProtection] Failed to acquire device lock assertion - deferring copy of '/Volumes/com.apple.TimeMachine.localsnapshots/Backups.backupdb/jim’s MacBook Pro/2022-05-23-142425/Data/Users/Jim/Library/Containers/com.goodnotesapp.x/Data/Library/Saved Application State/com.goodnotesapp.x~iosmac.savedState/data.data', error: Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted"

I had deleted these two apps yesterday, and doing this during the initial backup may have led to these issues. Deleting the loose folders resolved the issue and allowed the backup to proceed. I found that simply excluding these files from my backup did not resolve the issue.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .