Mac cannot connect to iCloud
This question was posted in June 2018 and none of the suggestions work for me. This problem started when I updated MacOS to 10.14.6.
A window keeps popping up which says "This Mac can't connect to iCloud because of a problem with <apple id>. Open iCloud preference to fix this problem". I open iCloud preference and enter the password to proceed and this message appears "An unknown error occurred" and the there is no end to the loop starting from the beginning! In the process, my mail boxes and iCloud drive files have disappeared.
I have gone through at least 30 discussions in various forums about the exact issue as mine. I have tried almost all the solutions suggested except probably formatting the Mac. I have tried the following:
1. Changed password
2. Signing out of iCloud on this mac does not happen as the same error shows after entering the password
3. Restarting and shutting down the Mac several times