What to do if OneDrive for Business keeps restarting

After a recent company-wide update to our work computers, OneDrive for Business started behaving stragely.

It just wouldn’t leave me alone! Every time I started my computer, it would repeatedly pop up an explorer window showing my local copy of my files in OneDrive for Business. All the files were showing a sync error.

The OneDrive for Business folder would repeatedly pop up whnever I started my computer. All the items show a sync failure.

Hot cross buns of death

Not only did the sync break, but the system tray broke as well. Hundreds of copies of the OneDrive for Business icon and the Office Sync Center icon were being left behind in the system tray.

The system tray contains 95 icons, 56 of them are OneDrive for Business. 30 of them are Office Sync Center.

The tray is eating my screen

And I literally mean hundreds, if you leave it long enough.

There is not enough room to show all of the items in your system tray. Please uninstall some programs, or try a higher screen resolution.

That many arrows reminds me of Kye http://games.moria.org.uk/kye/

The icons in the tray would disappear when I moused over them. It looks like that was a fatal combination of a system tray bug and an OneDrive for Business bug.

The tray problem was more annoying than the sync because it would hide all the real tray icons from me. If I didn’t “farm” the tray icons every twenty minutes or so, the icons would effectively be completely hidden from me.

In the Task Manager I saw that there were several instances of MSOSYNC.EXE (Office Sync Center) and GROOVE.EXE (OneDrive for Business). The instance seems to be short-lived, because when I tried to kill them through the GUI, sometimes it would say that they were already gone.

While I waited for help from Corporate IT Services, I hacked this PowerShell script together, and left it running in a minimized shell to keep the tray in a usable state.

while ($true) {
  gps msosync, groove -ea silentlycontinue | spps;
  sleep -milli 500

Every 500 milliseconds, it stops any instances of OneDrive for Business and the Office Sync Center.

I observed that new instances were starting about every second or so. Killing the instances more frequently than that ensured that there was no build up of dead icons in the tray.

Of course, this was only hiding the tray problem, and didn’t address the sync problem.

A colleague scoured the Office 365 forums and eventually found the answer. You may have guessed already, but it was an issue with cache.

Deleting the cache and resyncing all the files fixed the issue.

These instructions are due to Maggie Li on the Office 365 community forum.

1. Backup all the local documents & files in your document libraries to another place.

2. After the backup work is done, remove the original documents & files in your local OneDrive for Business folder.

3. Clear cache for OneDrive for Business. Delete the OneDrive for Business Spw and 15.0 folders. To do this, follow these steps:

1). Open Task Manager (you can open Task Manager by pressing Ctrl+Shift+Esc). Make sure none of the following process is running. If not, end them one-by-one.


2). Give yourself a Windows administrator role as follows:

Click the Start button and type cmd in the search bar. When cmd.exe appears in the results, right-click it and select Run as Administrator.

3). At the command prompt, delete the Office file cache and Spw and 15.0 folders by issuing four commands as follows:

Type “cd %USERPROFILE%\AppData\Local\Microsoft\Office\15.0\” and then press the Enter key.
Type “rmdir OfficeFileCache /s” and then press the Enter key.
Type “cd %USERPROFILE%\AppData\Local\Microsoft\Office\” and then press the Enter key.
Type “rmdir Spw /s” and then press the Enter key.

4) If you get an error when executing either rmdir command, one of the .exe processes is probably still running. Correct the problem by returning to the Task Manager (step 3-1), stopping the processes, and then removing the directories as described previously.

4. Sync the library again.

The instructions worked, and my files are in sync again!

For reference, here’s exactly what worked for me.

I followed steps 1 and 2 exactly as Maggie described.

Before starting step 3, I restarted Windows in safe mode. I had to do this because csisyncclient.exe, msosync, and groove.exe would keep restarting even if I stopped them. In safe mode they do not start automatically.

One file in the OfficeFileCache folder caught my eye. It was an access database called CentralTable.accdb, and it had swelled to over 2GB. As I write this, now the problem is fixed, it is around 200MB in size.

After completing step 3, I restarted Windows in normal mode.

When I logged in, the Office Upload Center appeared with an error message.

OneDrive for Business found a problem while accessing the Microsoft Office Document Cache and needs to repair it before it can continue.

As part of the repair a copy of the cache will be saved as a backup and a new cache will be created.

When I clicked Repair, I got another error message.

The action cannot be completed because another application is using the Microsoft Office Document Cache.

Please close all Microsoft Office applications of restart your computer and try again.

I clicked Try Again, but the same message appeared.

I clicked cancel.

I noticed OneNote was running in the tray, so I closed it to be sure.

I started the Upload Center again. It started normally with this message:

No files are pending upload

I checked in the Task Manager. There was only one instance each of CSISYNCCLIENT.EXE, GROOVE.EXE, and MSOSYNC.EXE. They were all running normally.

My OneDrive for Business folder was still empty, and the version on Sharepoint was still populated.

On Sharepoint in Internet Explorer I clicked “Sync” to start the sync process.

It took a while, but eventually all my files appeared locally and were synced with the server version.

The only problem is that OneDrive for Business has created a new folder to sync to.

The new folder is called

C:\Users\iain\OneDrive – Company Ltd 1

The old folder, which is still empty, is called

C:\Users\iain\OneDrive – Company Ltd

I think I can live with that for now.

Thanks for your help, Maggie!