Messages brings macOS to its knees with soagent and callservicesd

When I launch Messages on macOS and attempt to do anything at all with it (or even, it seems, if I just wait a while until a message is received) the two processes soagent and callservicesd start maxing out CPU and don't stop until Messages and they are all force quit.

Messages is in effect now unusable on my Mac. My iCloud account is the only one that syncs contacts and the only one used in Messages (the use of multiple accounts in either case is suggested as a trigger of the bug).

What can I do to fix this? Deleting and readding all of my Internet accounts is not an option.


Update: The trigger for this behavior seems to be Apple's (terrible) spell check. I can use Messages without soagent taking over my machine until I mistype. But one mistyping, and Messages hangs for a while, and then soagent takes off and can't be stopped except by force quitting.


Searching for errors containing "contacts" I get:

error   08:33:58.523010 -0500   accountsd   "Cannot check access to a private account type: <private>"
error   08:33:58.526106 -0500   accountsd   "Cannot check access to a private account type: <private>"
error   08:33:58.561595 -0500   accountsd   "Cannot check access to a private account type: com.apple.account.AppleAccount"

and

default 08:38:32.371678 -0500   AppleSpell  Rebroadcasting external notification ABDistributedDatabaseChangedNotification from process accountsd (<private>)
default 08:38:32.405900 -0500   suggestd    Rebroadcasting external notification ABDistributedDatabaseChangedNotification from process accountsd (<private>)
default 08:39:33.801123 -0500   ContactsAccountsService There was an error while trying to load accounts. We'll return an empty array. Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service named com.apple.AddressBook.ContactsAccountsService was invalidated." UserInfo={NSDebugDescription=The connection to service named com.apple.AddressBook.ContactsAccountsService was invalidated.}

Solution 1:

As the issue is related to the spell checking feature I would suggest you to reset text replacement.

You can erase (or save, if learnt spelling matters for you) all files in:

~/Library/Spelling

Do not forget to kill the spell process (something like AppleSpell) but remember to quit Message.app before doing so.

Also try to delete all the entries (if you ever added one) by hitting minus sign in Settings.app > Keyboard > Text Replacement

Note that your problem seems to be closely related to this one (as pointed out in some answers). To sum up the solutions discussed:

  • Navigate to ~/Library/Containers/com.apple.soagent/Data/Library/Preferences and delete (Drag to Trash) the com.apple.soagent.plist and then Restart the computer.
  • The second solution was pointed out by Everett.

Solution 2:

This has been happening periodically since Mac OS X Yosemite & Handoff / Continuity was implemented... and I now I treat everything that comes through Messages as expendable (copy it off immediately or commit to losing it in the future).

Today it happened in Mojave. So like many other times... soagent starts to chew up the processor, bird, callserviced, and a couple others seem to be impacted as well.

Tired of fooling with it, I do the following.

1 - Delete everything in the folder :

~/Library/Messages

2 - Delete the entire folder:

~/Library/Containers/com.apple.iChat

3 - Roll over to preferences folder here (don't delete this):

~/Library/Preferences

and do a find for 'chat' which lists many more preferences files than should exist (lots of leftover garbage from Messages). I delete all the files that appear in the find with the word 'chat' in them in the Preferences folder.

Then, I relaunched Messages and get: messages dialog indicating Messages data was rebuilding

Then I reboot. Messages rebuilds and soagent stops eating my MacBook battery.

Solution 3:

Tentative diagnosis: There is a corrupt record (or structure) in the Contacts database. Downloading the database completely from the iCloud version ensures that the local version is clean.

Solution: See https://appuals.com/fix-mac-running-slow-due-addressbooksourcesync/

A simplified version of the above seems to have done the trick for me:

0) Quit Contacts

1) Delete (after making a copy) all the contents of ~/Library/Application Support/Address Book/. Reboot (don't know if that is really necessary).

2) Uncheck Contacts in the iCloud settings.

3) Open Contacts (the contents will be empty)

4) Check Contacts in the iCloud settings. Sync starts (incl. the grouping of contacts into labeled groups)

That calmed everything down, including the soagent, callservicesd etc.