Resolving OneDrive “A file with this name already exists” Sync Error

The “A file with this name already exists” sync error occurs when Microsoft OneDrive detects two conflicting items attempting to occupy the exact same path and namespace. When this conflict strikes, OneDrive pauses syncing for the affected file, places a red badge or warning icon on the taskbar client, and stops syncing downstream modifications until the name or metadata collision is cleared.

Fast Fix:

Check your local OneDrive folder and OneDrive on the web to identify the duplicated item. Rename the local version (e.g., add _backup to the filename) or move it outside the OneDrive directory. OneDrive will immediately complete the cloud synchronization pass. You can then review both versions and merge any differing content.

Diagnostic Snapshot

  • Direct Cause: Colliding local and cloud namespaces, hidden system/temporary files, or casing differences on case-sensitive file systems.
  • Impact Level: Isolated to the conflicting file or folder; unaffected files in other directories continue syncing normally.
  • Cloud Integrity: Safe. The version stored on OneDrive for Web is preserved and accessible.

Why the Error Occurs

OneDrive maps your local file system to SharePoint Online/OneDrive cloud storage. The sync engine encounters an unresolvable collision under three specific conditions:

  1. Simultaneous Creation or Cross-Device Collisions: A file with the identical name was created or uploaded in the cloud while an unsynced local version was generated offline. Because both lack a shared version history root, the sync client refuses to overwrite either file silently.
  2. Case Sensitivity Discrepancies: Windows NTFS is case-preserving but case-insensitive (Document.docx and document.docx are the same file), whereas Linux, macOS APFS, or the underlying cloud storage engine can treat case variations differently. If two files differ only by capitalization, OneDrive on Windows halts with a name collision error.
  3. Ghost or Hidden Duplicates: Hidden temporary Office files (such as ~$Document.docx) or files stuck in the local OneDrive cache index may linger after an abrupt system reboot or application crash.

Step-by-Step Resolution

Follow these actions in order, starting from standard file-level checks to local cache resets.

1. Isolate and Rename the Local File

The fastest way to unblock the sync engine without risking data loss is to rename the colliding item.

  1. Open File Explorer and browse to the directory containing the flagged file.
  2. Locate the file marked with the red error badge or sync warning.
  3. Right-click the file, select Rename, and append a unique identifier (for example, change QuarterlyReport.xlsx to QuarterlyReport_LocalCopy.xlsx).
  4. Wait 10 to 15 seconds. OneDrive will detect the name change, sync the cloud version down as QuarterlyReport.xlsx, and upload your local copy as a separate file.
  5. Open both files, verify which version contains the latest edits, and delete the unwanted copy.

If you are dealing with concurrent collaborative edits rather than an outright naming collision, follow How to Resolve OneDrive “Merge Conflict” without Losing Data to reconcile mismatched sections.

2. Check for Casing and Trailing Space Inconsistencies

If File Explorer shows only one visible file but OneDrive reports an existing duplicate:

  1. Log in to OneDrive for Web in your browser.
  2. Navigate to the identical folder location.
  3. Look for:
    • A file with the same name but different letter casing (e.g., Budget.xlsx vs. BUDGET.xlsx).
    • A file containing leading or trailing whitespace (e.g., "Budget .xlsx").
  4. Rename the cloud file via the web interface to remove trailing spaces or make the capitalization distinct.
  5. OneDrive desktop will reconcile the change automatically. If the file contains unsupported characters, see Resolving SharePoint “Invalid File Name” Character Errors (2025).

3. Clear Hidden Temporary Lock Files

Orphaned lock files from Microsoft Office apps can mimic existing file names in the sync queue.

  1. Open File Explorer, click the View menu at the top, select Show, and check Hidden items.
  2. Look in the target folder for grayed-out files beginning with ~$ or ending in .tmp.
  3. If the main Office application is closed but the ~$ file remains, delete it manually.
  4. If OneDrive repeatedly locks on temp files, follow the troubleshooting steps in OneDrive Syncing “Temporary Files” (.tmp) by Mistake.

4. Clear the Local Sync Cache Engine

If the error remains after verifying that no duplicate or hidden file exists locally or in the cloud, the internal sync database (SyncEngine.odc) is holding an orphaned record.

  1. Press Windows Key + R to launch the Run dialog.
  2. Enter the following command and click OK: %localappdata%\Microsoft\OneDrive\onedrive.exe /reset
  3. The OneDrive icon in your taskbar will disappear.
  4. If it does not re-appear after 2 minutes, open Run again and execute: %localappdata%\Microsoft\OneDrive\onedrive.exe
  5. For a complete list of command switches and cache purge routines, reference How to Reset the OneDrive Sync Client (The Complete Command List).

Common Misdiagnoses & Branching Conditions

Escalation & Hard Stops

If renaming local files consistently fails to clear the collision warning, or if the cloud portal displays identical file names within the exact same folder (a rare SharePoint database indexing fault), do not repeatedly delete and re-upload files. Unlink the client via OneDrive Settings > Account > Unlink this PC, purge the local staging folder, and sign back in to establish a fresh sync relationship.