You see the error “We cannot sync this library” in OneDrive when trying to sync a SharePoint document library or a Teams channel files folder. This error occurs because the library exceeds a sync limit, has incompatible file types, or uses a blocked URL path. This article explains the specific causes behind this error and provides step-by-step methods to resolve it so you can sync the library successfully.
Key Takeaways: Fixing the OneDrive “We Cannot Sync This Library” Error
- OneDrive > Settings > Account > Stop sync: Use this to disconnect and restart syncing for a problematic library.
- SharePoint library > Library Settings > Permissions: Verify you have at least Contribute permission to sync the library.
- OneDrive > Settings > Sync and backup > Advanced settings: Check the sync limit of 300,000 items and file name character restrictions.
Why OneDrive Cannot Sync a SharePoint Library
OneDrive for Business uses the same sync engine for personal OneDrive folders and SharePoint document libraries. The “We cannot sync this library” error appears when the sync engine detects a condition it cannot handle. The most common root causes are:
Library Exceeds Sync Limits
OneDrive has a hard limit of 300,000 items across all synced libraries. A single library also has a maximum of 5,000 items per view before sync performance degrades. If your target library contains more than 300,000 files or folders, the sync engine refuses to start syncing and shows the error message.
Incompatible File Names or Characters
OneDrive cannot sync files whose names contain characters like ~ " # % & : < > ? / \ { | }. Files with names exceeding 255 characters or paths longer than 400 characters also trigger this error. The sync engine scans the library before starting and blocks the entire library if it finds any incompatible file.
Blocked File Types
Your Microsoft 365 tenant administrator can block specific file extensions from syncing. Common blocked types include executable files (.exe, .msi), script files (.ps1, .vbs), and compressed archives (.zip, .rar) in some organizations. If the library contains a blocked file type, OneDrive refuses to sync the entire library.
URL Path Length or Special Characters
SharePoint library URLs that contain spaces, non-ASCII characters, or exceed 400 characters in total path length can prevent sync. The sync engine requires a clean, short URL to establish the sync relationship.
How to Fix “We Cannot Sync This Library”
Follow these steps in order. Test after each step to avoid unnecessary changes.
Step 1: Stop and Restart Syncing the Library
- Open OneDrive settings
Right-click the OneDrive cloud icon in the system tray and select Settings. - Go to the Account tab
Click Account at the top of the settings window. - Stop syncing the library
Under the list of synced libraries, locate the library showing the error. Click Stop sync next to it. Confirm when prompted. - Restart syncing
Open the library in a web browser. Click the Sync button in the toolbar. OneDrive will attempt to sync again with a fresh connection.
Step 2: Check Library Item Count and File Names
- Open the library in SharePoint
Navigate to the library in your browser. - View the item count
Look at the status bar at the bottom of the library. It shows the total number of items. If the count exceeds 300,000, you must remove items or split the library. - Check for problematic file names
Sort files by name and look for characters listed in the Background section. Rename any files with illegal characters. Remove files with names longer than 255 characters.
Step 3: Verify Permissions
- Open library settings
In the SharePoint library, click the gear icon and select Library settings. - Check your permission level
Click Permissions for this document library. Ensure your account has at least Contribute permission. Read-only users cannot sync the library. - Request elevated permissions if needed
Contact your SharePoint administrator to grant Contribute or Edit permissions.
Step 4: Clear the OneDrive Sync Cache
- Close OneDrive
Right-click the OneDrive icon in the system tray and select Close OneDrive. - Open the cache folder
Press Win + R, type%localappdata%\Microsoft\OneDrive\, and press Enter. - Delete the settings folder
Delete the folder namedsettings(or rename it tosettings.old). Do not delete other folders. - Restart OneDrive
Open OneDrive from the Start menu. It will rebuild the cache and re-establish sync relationships.
Step 5: Check Tenant Sync Restrictions
Your Microsoft 365 admin may have disabled syncing for specific site collections. Open the SharePoint admin center, go to Policies > Sharing, and check if the library’s site URL is blocked. If you are not an admin, contact your IT department.
If OneDrive Still Cannot Sync the Library
“We Cannot Sync This Library” Appears on a Teams Channel
Teams channels use a SharePoint document library named after the channel. The same limits apply. Open the Files tab in Teams, click Open in SharePoint, and follow the steps above directly on the SharePoint library.
Error Persists After Stopping and Restarting Sync
The library may contain a file with a blocked extension. Ask your administrator to check blocked file types in the SharePoint admin center under Settings > Classic settings > Blocked file extensions. Alternatively, move or delete the blocked file from the library.
OneDrive Shows the Error on a New Library
If you recently created the library, the sync relationship may not have propagated yet. Wait 10 minutes, then click Sync again in the browser. If the error remains, sign out of OneDrive and sign back in.
OneDrive Sync Limits vs SharePoint Library Limits: Key Differences
| Item | OneDrive Sync Limit | SharePoint Library Limit |
|---|---|---|
| Total items synced | 300,000 across all synced libraries | 30 million per library |
| File name length | 255 characters | 255 characters |
| Path length | 400 characters | 400 characters |
| File size per file | 250 GB | 250 GB |
| Items per view | 5,000 (sync performance threshold) | 5,000 (list view threshold) |
OneDrive sync stops at 300,000 items even though SharePoint can host millions. If you need to sync a library with more than 300,000 items, split the content into multiple libraries and sync each one separately.
You can now identify why OneDrive shows the sync error and apply the correct fix. Start by stopping and restarting the sync for the library. If the error persists, check the item count and file names in the library. Use the SharePoint admin center to verify tenant-level sync policies. As an advanced tip, create a new view in the library that filters out files with illegal characters and use that view for syncing to avoid the error entirely.