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.}
Best Answer
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:
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:
~/Library/Containers/com.apple.soagent/Data/Library/Preferences
and delete (Drag to Trash) thecom.apple.soagent.plist
and then Restart the computer.