If you use OneDrive for Business on a Mac and a shared library keeps restarting its sync cycle every time you reboot your computer, you are seeing a sync loop. This happens because the OneDrive app on macOS can lose its cached authentication token for a shared library after a system restart. This guide explains why the loop occurs and provides the exact steps to break the cycle and restore stable syncing.
Key Takeaways: Fixing the Shared Library Sync Loop on Mac
- OneDrive > Preferences > Account > Unlink this Mac: Completely removes all cached credentials and stops the sync loop for all libraries.
- OneDrive > Preferences > Account > Add a shared library: Re-adds the looping library with a fresh authentication token after unlinking.
- Terminal command: killall OneDrive: Forces the OneDrive process to stop immediately when the app is stuck in a loop and will not quit normally.
Why the Sync Loop Occurs After Restart
When you restart your Mac, the OneDrive app launches automatically and tries to verify the authentication token for each synced library. For a shared library, the token can become stale or corrupted during the shutdown process. The app detects the invalid token, attempts to refresh it, fails, and then repeats the verification cycle. This creates a loop where the library constantly shows “Syncing” or “Processing changes” but never completes.
The root cause is that the macOS keychain stores the token for the shared library, but the token’s refresh endpoint may time out or return an error after a restart. OneDrive does not gracefully fall back to a full re-authentication; it simply retries the same failed refresh. This behavior is specific to shared libraries because they require a separate permission context from your personal OneDrive folder.
A secondary factor is the OneDrive launch agent. The agent starts OneDrive at login, and if the network is not fully available yet, the token refresh can fail. The app then queues retries, which pile up and appear as a sync loop.
Steps to Break the Sync Loop and Restore Normal Syncing
- Quit OneDrive completely
Click the OneDrive cloud icon in the menu bar. Select Quit OneDrive. If the app does not respond, open Terminal and runkillall OneDriveto force stop the process. - Clear the cached credentials in the keychain
Open the Keychain Access app from Applications > Utilities. In the search box, typeOneDrive. Delete all entries that contain “OneDrive” or “Microsoft_OneDrive”. Do not delete entries for other Microsoft apps. This removes the stale token for the shared library. - Unlink your Mac from OneDrive
Open OneDrive. Go to OneDrive > Preferences > Account. Click Unlink this Mac. Confirm the action. This resets the entire sync relationship and clears all local cached data for all libraries. - Restart your Mac
Restart your computer to ensure the keychain changes take effect and the OneDrive launch agent starts fresh. - Sign in to OneDrive again
After restart, open OneDrive from the Applications folder. Sign in with your work or school account. Choose your personal OneDrive folder location. Let the initial sync complete for your personal folder. - Re-add the shared library
Click the OneDrive cloud icon in the menu bar. Select Preferences > Account. Under Shared libraries, click Add a shared library. Browse or search for the library that was looping. Select it and click Add. The library will now sync with a fresh authentication token. - Test the fix
Restart your Mac again. After login, open OneDrive and observe the shared library. It should sync once and then show a green check mark. If the loop returns, repeat steps 1 through 6 but also check the network connection before re-adding the library.
If the Sync Loop Still Continues
OneDrive shows “Processing changes” indefinitely after re-adding the library
This indicates that the library has a large number of files or a corrupted file structure. Pause syncing by right-clicking the OneDrive icon in the menu bar and selecting Pause syncing > 2 hours. Wait 10 minutes, then resume. If the problem persists, ask the library owner to check for file names that exceed 255 characters or contain forbidden characters like : or ".
The library syncs but shows a red X on some files
A red X means the file is blocked by a sync rule. Right-click the file and select View sync issues. Common causes include file size over 250 GB, file path length over 400 characters, or file type blocked by your organization. Contact your IT admin to adjust the SharePoint library settings.
OneDrive crashes immediately after signing in
This is often caused by a corrupted OneDrive installation. Uninstall OneDrive using the Uninstall OneDrive option in the Finder > Applications folder. Download the latest version from the Microsoft 365 portal and reinstall. Then follow steps 1 through 7 again.
Unlink and Re-add vs Full Reset: Key Differences
| Item | Unlink and Re-add | Full Reset (Uninstall + Keychain Delete) |
|---|---|---|
| What it does | Removes sync relationship but keeps local files | Removes all app data, local cache, and keychain entries |
| Time required | 10–15 minutes | 30–45 minutes including re-download |
| Preserves local files | Yes, files remain on disk | No, files are removed — must re-download |
| Fixes token corruption | Yes, removes token from keychain | Yes, removes all traces of token |
| Fixes app corruption | No | Yes, reinstalls the app |
The unlink and re-add method is the fastest fix for a sync loop caused by a stale token. Only use the full reset if the loop persists after trying the first method twice.
You can now stop the shared library sync loop on your Mac by unlinking your account, clearing the keychain, and re-adding the library. If the issue returns, use the full reset method. To prevent future loops, ensure OneDrive is fully closed before shutting down your Mac by right-clicking the cloud icon and selecting Quit OneDrive before restart.