MacOS High Sierra – SafariBookmarksSyncAgent CPU problem (updated 20180321)

Edit – 20180321

Late yesterday afternoon this problem came back. Turning off Safari sync in the iCloud cdev treats the symptom but its not the cure.

Root cause found. Information below updated to reflect the final fix.

Fault Description

For an unknown reason the SafariBooksmarksSyncAgent process is consuming large amounts of CPU and memory on my 2012 MacBook Pro 15”.

Observed Behaviour

The process can be killed using Activity Monitor but will restart when Safari is open. If Safari is closed then the sync process doesn’t restart.

Console.app showed the following warnings and errors:

XX BAChangeCopyChangedItem: BAChange object created with UUID that does not correspond to a known bookmark.
Move change <BAChange 0x7fc580b014b0 (0x7fc580cb0450 85087F40-FD87-4FDB-B101-713F9FCD1AA3) Modify> was provided without a corresponding changed item.
Batch record save operation completed but failed to save records due to unrecoverable error: Error Domain=CKErrorDomain Code=12 "Request UUID: (null)"
Did fail to save record batch with error: Error Domain=CKErrorDomain Code=12 "Request UUID: (null)"
Sync coordinator failed to sync bookmarks with error: Error Domain=CKErrorDomain Code=12 "Request UUID: (null)"
*** CloudKit bookmark sync failed with result <3>: Error Domain=CKErrorDomain Code=12 "Request UUID: (null)"

So obviously the sync agent has some problems.

Getting Close

Some Googlephoo turned up a few items that were close but nothing that really seemed to me like a root cause fix. Eventually I found an article that led me to this Apple support article: Resolve issues caused by changing the permissions of items in your home folder

That seemed like a worthy fix to try since I had just rebuilt my Mac from scratch and started with a fresh and new user profile. It was highly likely that some home directory permissions got clobbered during my various file restores, especially related to the hidden ‘~/Library’ folder.

I performed the steps as described however it didn’t seem to fix it. The sync process was still chewing high CPU.

The Fix Part 1

I closed Safari and reran the Apple support fix steps.
When I started Safari again the sync process was perfectly behaved. For a short while. Read on.

The Fix Part 2

So, soon after posting this article the problem came screaming back. Same fault as originally described.

This time I nuked the site from orbit.

  • In Safari on my Mac I exported my bookmarks. File -> Export Bookmarks.
  • I turned off Safari iCloud Sync on the Mac and my devices.
  • I deleted all Bookmarks from all devices and then properly closed Safari on all devices.
  • Waited five minutes.
  • Opened the console.app and watched the logs for any process with the word safari in it.
  • Turned on Safari in the iCloud cdev on the mac and my devices. Watched a bunch of stuff scroll by in the console.app. None of it appeared to be warnings or errors.
  • Waited five minutes.
  • Imported my bookmarks from the backup file.

Root cause? Unknown. Problem fixed? Yes.

A side effect

Immediately following the fix a bunch of ‘mds’ related processes started churning. These are processes related to the Spotlight app and are part of Spotlight’s discovery and search of data on the computer. Obviously the permissions fix also fixed a bunch of access issues for Spotlight. I left it alone to chug along and it settled down to more normal levels after a short while.

5 Responses to MacOS High Sierra – SafariBookmarksSyncAgent CPU problem (updated 20180321)

  1. Mark Miro says:

    I just tried this and it worked! Thanks for sharing this.

    I thought I might have to also delete my reading list, but I guess I didn’t have to do that.

  2. Apple sucks! Thanks for solving this INSANE bug. I have never seen anything like it on Windows. SafariBookmarksSyncAgent wrote 400+ Gigabytes to my iMac hard disk, used up 100% of CPU and 20GB out of 20 GB of RAM. I can’t believe Apple hasn’t fixed this. Thank you again, your fix seemed to have worked.

    • Andrew Best says:

      Hi Mike. Glad you found the instructions useful. Took me AGES to get to the bottom of it.

      • Strange thing… the SafariBookmarksSyncAgent is no longer hogging up 100% of CPU, nor eating up 20GB out of 20GB of RAM, but it is still writing huge amounts of data to the SSD according to Activity Monitor — around 50 GB per day! So nuts this bug.

        Wish I could delete Safari from the macOS. I never have problems with Chrome sync or Firefox sync with a massive bookmark list. I only have 30 or so bookmarks in Safari. Got a love-hate relationship with macOS High Sierra. iOS is way less buggy.

        Thanks for your hard work on this weird bug.

        Buddha with you,
        Cloud Monk Mike

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: