BlueByte
path too longFixed

OneDrive: Path is too long to sync

By Haneul SeoUpdated September 11, 20264 min

Hi, it's BlueByte. A file in your OneDrive folder shows a red X instead of the green sync check, and OneDrive tells you Path is too long to sync. Your file is fine and nothing is lost — OneDrive refuses to sync a file whose full path is longer than the limit it enforces. We'll walk through what that message means, the character limits that decide it, how to find which files are over, shorten them safely, and keep your folders under the line.

What "Path is too long to sync" means

OneDrive reports this as a per-item sync error: the file gets a red X in File Explorer and appears in the OneDrive Activity Center with a note like Path is 32 characters too long. The message tells you the overage, not a fixed threshold, and once you shorten enough it flips to Path is short enough to sync with a green check. The file itself is untouched — OneDrive is declining to upload it, not damaging it. That's why you can fix this without deleting anything.

The numbers that decide whether a path syncs — 400, 120, 520

Three limits from Microsoft's documentation govern this:

  • The entire decoded file path, including the file name, can't exceed 400 characters for OneDrive (home and work or school) and SharePoint.
  • The full local path is the local path (up to 400 characters) plus the OneDrive root folder (up to 120 characters).
  • Paths that exceed 520 characters show a sync error, and OneDrive won't sync the item until you bring it back under the limit.

"Decoded" matters here: characters like a space can expand when encoded, and each one counts toward the total. A deeply nested folder with long, descriptive names is the usual way a single file quietly crosses 400 without anyone noticing.

Confirm which files are over the limit

Don't hunt by hand — let PowerShell list the offenders. Open PowerShell, move into your OneDrive folder, and print every path longer than 400 characters:

cd "$env:OneDrive"
Get-ChildItem -Recurse -Force | Where-Object { $_.FullName.Length -gt 400 } |
  Select-Object @{ n = 'Length'; e = { $_.FullName.Length } }, FullName
Length FullName
------ --------
   431 C:\Users\you\OneDrive\Projects\2026\Q3\ClientDeliverables\Draft\final_v3_reviewed.xlsx

Each row is a file whose full path is the problem. Sorting by Length shows how far over you are, which tells you how much to trim.

Shorten the path by renaming or moving

Microsoft gives two fixes, and both keep your content. Rename the file, or a folder above it, to something shorter — the OneDrive notification updates live and reads Path is short enough to sync once you drop under the limit. Or move the item closer to the top of your OneDrive, into a folder that's fewer levels deep:

Move-Item "$env:OneDrive\Projects\2026\Q3\ClientDeliverables\Draft\final_v3_reviewed.xlsx" "$env:OneDrive\Projects\final_v3.xlsx"

Moving an item up even one or two folder levels is often enough to bring the path under 400. You don't need to delete anything, and you won't lose any content — you're only changing where the file sits, not the file itself.

A real case: a deep export from a colleague

A teammate shares a project archive and you drop the whole tree into OneDrive\Projects. One spreadsheet won't sync — red X, Path is too long to sync. You run the scan above and it prints a single path at 431 characters, buried five folders deep with long auto-generated names. Renaming the file alone isn't enough, so you move its parent folder from Projects\2026\Q3\ClientDeliverables\Draft\ up to Projects\Q3-draft\. The scan now returns nothing, the red X turns to a green check, and the spreadsheet uploads.

Verify the file syncs and the client catches up

Watch the file's icon in File Explorer: a green check (or the "available in the cloud" icon) means it synced. Re-run the scan to confirm no path is still over 400:

(Get-ChildItem "$env:OneDrive" -Recurse -Force | Where-Object { $_.FullName.Length -gt 400 }).Count
0

A count of 0, and the OneDrive icon back to a steady "Up to date" rather than "Sync pending," means every path is under the limit and the client has caught up.

Keep paths under the limit

Keep folder trees shallow and names short, especially near the top, where the OneDrive root already spends part of the budget. Sync a specific subfolder rather than a whole deep archive when you only need part of it. When you bring in exports or downloads with long machine-generated names, flatten them into a shorter folder before they land in OneDrive. If you routinely work with long paths, keep the deepest projects nearer the root so a couple of extra subfolders don't push you past 400.

How this differs from invalid-character and storage-full errors

A path-length block is only about total length. It's different from an invalid-character sync error, where a name contains one of " * : < > ? / \ |, a reserved name such as CON or NUL, or a leading or trailing space — there you fix the character, not the depth. And it isn't a storage-full error: if OneDrive says you're out of space, no amount of shortening helps — you free space or add storage. Read the exact message: "too long" means trim the path, "invalid characters" means fix the name, "full" means make room.

Related questions

Why does one file fail when the rest of the folder syncs fine?

Its full path crossed 400 characters while its neighbors stayed under — usually a longer file name at the same depth. Shorten that file's name or move it up a level.

What counts toward the 400 characters — just the file name?

The entire decoded path: every folder plus the file name, on top of the OneDrive root folder (up to 120 characters). A short file name deep in a long folder tree can still be over.

Will renaming or moving the file lose my data or version history?

No. You're changing where the file lives or what it's called, not its contents. OneDrive keeps the file and syncs it once the path is short enough.

Can I raise the 400-character limit?

No — it's a fixed OneDrive and SharePoint limit. The fix is always to shorten the path by renaming or moving, never to change the limit.

I shortened the name but it still won't sync.

Re-run the PowerShell scan — a folder above the file may still push the total path over 400, or the block may be a different error such as invalid characters or storage full. Match the exact OneDrive message.

References

Haneul Seo

Infrastructure engineer · 10+ years running Linux fleets

More in this category

5.7.26Fixed

Gmail rejects your mail with 550-5.7.26: unauthenticated email is not accepted due to the domain's DMARC policy

Gmail enforced the DMARC policy your own domain publishes: the message failed both SPF and DKIM alignment against the header From: domain, so a p=quarantine or p=reject policy turned it into a hard bounce. The Authentication-Results header names the failing check, and three dig queries against your SPF, DMARC and DKIM records name the cause. A near-identical bounce about authenticating with SPF or DKIM is a different problem — Gmail's baseline sender requirements, not your policy.

Gmail / Google Workspace
AADSTS50011Fixed

Microsoft Entra ID: AADSTS50011, the redirect URI specified in the request does not match the redirect URIs configured for the application

Sign-in completes and then Entra ID refuses the last hop, because the redirect_uri your app sent is not a byte-for-byte match for any URI registered on the app. The match is case-sensitive, counts the trailing slash, requires https outside localhost, and treats the port as significant everywhere except localhost. It also splits by platform: web, spa and publicClient are three separate lists, and URIs added to the service principal instead of the application object can disappear. Read the URI and the app ID out of the error, compare them with az ad app show, add the exact string with az ad app update or a Graph PATCH, then wait three to five minutes.

Microsoft Entra ID
535 5.7.139Workaround

Exchange Online: 535 5.7.139 Authentication unsuccessful, SmtpClientAuthentication is disabled

A scanner, script or app that sends through smtp.office365.com gets 535 5.7.139 because the SMTP AUTH protocol is switched off for the tenant, for that mailbox, or by an authentication policy or security defaults that block Basic authentication. Read the wording (Tenant, Mailbox, or 'did not meet the criteria'), confirm with Get-TransportConfig, Get-CASMailbox and Get-AuthenticationPolicy, then open SMTP AUTH on the one mailbox that needs it rather than tenant-wide. Treat Basic SMTP AUTH as a bridge: Microsoft disables it by default for existing tenants at the end of December 2026, so move the sender to OAuth, High Volume Email or a relay connector.

Exchange Online (Microsoft 365)
Error code: 5003Fixed

Zoom: "Unable to connect" error code 5003 — the desktop app can't reach Zoom while the browser can

Error 5003 is the Zoom desktop app failing to complete its connection to Zoom's servers while the web client on the same machine joins fine. The app needs more than a browser does: Zoom's firewall article lists TCP 443/8801/8802 and UDP 3478/3479/8801–8810 for meetings, a set of CA hosts for certificate validation, and it asks that zoom.us and *.zoom.us be exempted from proxy or SSL inspection. A port test, a curl issuer check, and the app's built-in Network Connectivity Tool (Ctrl+Alt+Shift+D / Cmd+Option+Shift+D) show which of those is cut; fix that layer, and reinstall only when a single machine fails while its neighbours join.

Zoom
Slack cannot connect. / Last updated less than a minute ago…Fixed

Slack: "Slack cannot connect" and the grey "Last updated…" banner behind a corporate proxy

Slack loads channels over ordinary HTTPS but delivers new messages over a persistent WebSocket on port 443 to the three wss-*.slack.com hosts Slack names (primary, backup, mobile). When a proxy or firewall passes the HTTP side and blocks the upgrade — most often because SSL decryption is on for the wss hosts, or the allowlist stops at slack.com — the app shows the grey "Last updated…" banner or "Slack cannot connect." while the browser seems fine. Two curl probes from the affected machine show which layer is blocked; exempt the three wss hosts from decryption, allow every domain on my.slack.com/help/urls, and confirm with my.slack.com/help/test.

Slack
locked for editingFixed

Word: "The document is locked for editing by another user"

Word found a lock — an owner file — for the document and assumed someone else has it open, so it offers only a read-only copy. Usually no one does: a crash left the lock behind, or a hidden Word process is still holding the file. Confirm which, close every Word instance, delete the stale ~$ owner file, and the document opens for editing again.

Microsoft Word