MacOs Catalina: There was an error in internet accounts preferences

Just a quick little post which I hope might help some folks out there.
Over the last few days I had the need to totally re-blow my workhorse iMac. I have had various versions of MacOs on my bad boy since 2015 and it was getting to the point where logging in was taking about 15 mins each day – which was, to say the least somewhat irritating!
To cut a long story short I ended up with a nice, new, clean Image of MacOs Catalina (10.15.4) and very cool it is to on the machine and the general speed issues have thankfully been fixed by a complete refresh of the O/S (who says Macs aren’t like Windows?).
However, last night a little niggle crept in. Nothing earth shattering – just every 15 mins or so I would be prompted for my O365 password to sync my Exchange online calendar to the Apple calendar locally. I would click on the prompt to enter the password and would get the following error message:
There was an error in internet accounts preferences.
I also found that I could not remove the Exchange account from Internet Accounts in System Information, so there I was stuck with the recurring message every 15 minutes.
It was very odd, as when I had setup all of my accounts the Exchange calendar was working perfectly – it just decided randomly it didn’t want to play ball.
From a quick swiz around on the old Internet this seems to be a problem that a few people are having with Catalina – but, I couldn’t find any solutions to the problem … so “bugger” I thought.
I pondered the situation for a bit and then had the idea that it might be a good idea to try and figure out how the Internet Accounts preferences are stored on a Mac as the issue struck me as potentially this could be some form of corruption in a file somewhere. My idea was drawn from my old Windows days where things like that could usually be tracked to a registry entry or configuration file.
After some research I discovered that the Internet Accounts information is stored in the following location:
/Users/<your logon>/Library/Accounts
Looking at the files I could see that they appeared to belong to a sqllite database: (of course, why would Apple use something as simple as an XML file – nope, a SQL instance is needed – clearly)!
This then helped me develop a hunch that if I could have a sneaky look into the database I might be able to see what was corrupted – or – delete the entry for my Exchange Online Calendar that the operating system interface wasn’t allowing me to.
So, to the rescue was a little tool that I’ve been aware of called DB Browser for SQLLite for a number of years so I downloaded it and fired it up.
I clicked on the “Open Database” button (highlighted in Red) and navigated to my user profile.
As a point of note the “Library” folder in the user profile is hidden by default, so to see it in the open dialogue you need to press down “Command->Shift->.” (full stop).
Once in the folder. I then found the “Accounts4.sqllite” database in /Users/<Your account>/Library/Accounts and opened it.
I selected the ZACCOUNT (makes sense right …. ) table by right clicking and from the popup menu that appeared I selected the “Browse Table” option (highlighted in Red).
I found a value for Exchange in the ZACCOUNTDESCRIPTION column – selected the Row by right clicking and chose the “Delete Record” option.
I then closed the application making sure that I clicked on the “Save” button.
After I had made the changes to the database I went back into “System Preferences -> Internet Accounts” and found that the Exchange online entry was now gone. I was able to set the account up again which then correctly started syncing my calendar entries again and no more password prompts!
I hope that helps someone along the way – next up I need to figure out why I have so many duplicate public holiday entries in my calendar that don’t appear consistently elsewhere!
John Wheeler
Fantastic detective work to find this solution – well done! This completely fixed my problem.
Interestingly this fixed the problem without me having to complete adding the Exchange account again. I think I had tried to add the account again after it didn’t connect after installing MacOS 10.15.4, and the new account was “queued” somewhere, but getting confused with the existing one in my iCloud account settings.
As SQLLite is used by quite a few Apple products (& others I’m sure), the DB client will prove useful in the future.
Many thanks!
Andy Grogan
More than welcome John; glad that it helped. It may have had something to do with the iCloud – with me I had to recreate it 🙂
Cheers
A
Alessandra Twomey
This absolutely worked for me- thank you!
Ben
Andy,
You have no idea how much time and frustration this has saved me. I had this happen on my iMac a couple weeks before your post. I could find no workable solutions after exhaustive internet searches and so I ended up completely blowing it away and loading from scratch. As soon as my Time Machine backup was done, 20 hours later, I did not start Mail. I went into System Preferences and quickly deleted the Exchange mail and all has been good. Just this afternoon, I got onto my MBAir and MPPro and much to my frustration, the same error came up.I had visions of having to do the same on two computers. So I did another internet search and there you were. I made the changes and it worked like a charm. Thank you soooooo much.
Ben
Andy Grogan
Hi Ben, you are very welcome. Apologies that I did not post it in time to help you avoid having to blowing away your iMac but am glad that it saved you the same fate with your other machines.
Cheers
A
Bin Liu
Andy, Hi!
I have tried it. It worked. The solution is very elegant.
Besides, I have learned something about the internet accounts organization in Catalina.
Thanks a lot!👍
Bin
Ben H
Hi Andy,
I had the same issue but this fixed it and only took a couple of minutes. Thanks!!
Ben
Ben
Thanks Andy
I followed your instructions up until the point I found, instead of “Exchange” under the ZAACCOUNTDESCRIPTION I found my exchange email address. I deleted the record as you did anyway.
But then the same problem persists! Was this due to the set up of my email account prior to Mac OS update?
Andy Grogan
Hi Ben, for your original account account; when you set it up change the Default name which is Exchange to your email address? It is also possible (I can’t remember) that through the evolution of MacOs that this field may at some point of been the email address (I don’t know how many times that you’ve upgraded).
Anyhow, it’s possible that there a duplicate in there – have a look in the table at the
ZOWNINGBUNDLED
field and find the entry that has your email address in theZUSERNAME
for your Exchange account with a value of:com.apple.preferences.internetaccounts.remoteservice
– then delete those. Hope that helps.Jamie
Worked perfectly. Thanks so much for investigating and sharing the solution.
Jeff
Dude- this is amazing. Fixed it- and I’m very much an amatuer.
Julian
Thank you so much for posting this, saved me so much time and hassle!
Martin
Just saved me hours Andy, thanks.
Kain
Andy – this is fantastic and saved me a lot of stress. Thank you so much.
DOUG
AWESOME! Andy – you’re a life saver!!
Charles
Wow, Would like to thank you so much for taking the time to showing us how to sort this little but most definitely annoying problem! Thank you!!
Kerstin
Thanks a lot for sharing. It helped me synchronize my mails.
LUKA
a true troubleshooting! nice work. it helped me also!
Erin
Thank you! This has been driving me crazy and your instructions were really straightforward. Thanks so much.
John Rabbitt
Hi Andy,
Really nice of you to post this solution.
It was easy to follow. You are my new internet hero. Thank you very much. John
Simeon
Great post thanks
Guy Cortesi
Wow – thanks. That one had me stumped!
Rbar
BTW, this works for corrupted iCloud accounts as well. In my case, there were two rows associated with the email address I was trying to use for iCloud. I deleted both, saved the DB, and the re-opened the Internet Accounts and now I could login to iCloud using that email address.
Thanks for figuring this out. It was driving me crazy!