Outlook for Mac 2016 Calendar and Email Sync Issues

In my last post, I covered an error message I received randomly on mac os. After fixing the issue, I noticed that Outlook was behaving oddly including:

  • Calendar was not updating
  • All Calendar invites/updates/removals arrived as empty messages
  • Any time I deleted an email it would shortly reappear in the same folder
  • If I selected a message that had reappeared, it would magically disappear shortly thereafter

What was going on? Read on to learn more!

This time I could easily check the logs so I did, but unfortunately they did not report any issues. I, of course, ensured I was running the latest version of Office and then did what Microsoft typically recommends — manually uninstall and manually reinstall Office for Mac 2016. Unfortunately, this process is not as user friendly as I hoped (see here for more details) and requires you to manually delete the following:

  • All Office applications in the Applications folder
  • The following Library containers: ~/Library/Containers/com.microsoft.*
  • The following Library group containers: ~/Library/Group Containers/UB*

Finally you need to restart the computer. After completing this, I reinstalled Office, but the problem persisted. Next up, I enabled troubleshooting logging. To do this, you go to Tools > Sync Errors > Gear Icon > Turn on logging for troubleshooting. Then you need to close Outlook and open it again — wish it would state that. Then you reproduce the issue and check the logs — the big question is where are the logs? Unfortunately, Outlook does not tell you this either, but you can find it in: ~/Library/Containers/com.microsoft.outlook/Data/Library/Logs. Tailing this log while reproducing the issue will result in a lot of output. What I eventually realized is that you need to look for messages that contain the word “Unexpected” — Microsoft would it kill you to adhere to syslog RFC standards is use something like “error”? — note using grep on the file did not work for me so I used vim and its search capabilities to look for Unexpected messages.. The first set of Unexpected messages I received looked like the following:

A quick Google search did not turn up much on the error or the errorCode so I decided to keep looking. The next one looked promising:

A bit further down I saw:

OK, I see a file IO error, an error code and a message about failing to create a temporary directory. What critical piece of information am I missing? Yup, the filename and/or filepath. Remember kids, log messages are only as good as the information that they contain!

Well, I know I had permission problems with my home directory given my previous blog post, but I also know that I fixed them. mac os Sierra does not allow repairing permissions because the system files and directories cannot be modified. Even if they had been modified, reinstalling mac os would have resolved this issue as well. So, where is the permission problem? After digging around the filesystem for a bit and turning up nothing, I decided to create a new user account, install Outlook and see if I could reproduce the issue there — wouldn’t you know it worked without issue. This was a strong indication that the problem was with my profile, but I had confirmed — multiple times now — that the permissions on my profile were correct. Then I remembered TMPDIR.

You may remember my note in my previous blog post where I stated that I checked /etc/passwd to double-check my User ID, but could not find the entry. Just like mac os uses a non-Linux standard directory service utility, mac os uses TMPDIR which provides a user specific private temporary directory space in /var/private. You can echo the variable to see the location:

Wouldn’t you know this space has an Outlook directory:

and look at that, it is owned by root. I changed the permissions recursively on this directory:

and all my Outlook problems went away! (Note: Remember to turn off troubleshooting logging in Outlook)

I still do not know what was responsible for changing the permissions on my files and directories, but I do know I wasted a bunch of time because:

  • Default error logging was not sufficient
  • Debug error logging was hard to turn on and the log file was hard to find
  • The log file did not use standard terminology for reporting errors, used codes that were not defined, did not support normal CLI commands such as grep, and did not contain critical pieces of information such as filepath

The morale of this story? Logging is important; make logging easy, follow common standards and include relevant pieces of information.

© 2017, Steve Flanders. All rights reserved.

One thought on “Outlook for Mac 2016 Calendar and Email Sync Issues

  1. Rick says:

    Thank you for this! I had been suffering with this problem for weeks until I found this post. Your description, examples, and resolution are all so valuable. Thanks!

Leave a Reply