sodcalculator

10 Tech How-To

Fix OneDrive Error Codes on Windows 11

Guide 10-48313 · Updated · Step by step

OneDrive error codes on Windows 11 usually stem from sync conflicts, corrupted cache files, or sign-in token issues, and most can be resolved by resetting the app or clearing its cache. This guide walks you through the most common error codes, what they mean, and step-by-step fixes that work for the current version of Windows 11.

What Causes OneDrive Error Codes?

OneDrive is deeply integrated into Windows 11, so errors often appear when the sync engine gets out of sync with the cloud. Common triggers include:

  • Network interruptions – a dropped Wi-Fi connection mid-upload can leave files in a stuck state.
  • File name or path issues – Windows 11 forbids certain characters (like " : * ? < > |) and path lengths over 260 characters.
  • Corrupted OneDrive cache – the local database that tracks file states can become damaged after a crash or forced shutdown.
  • Sign-in token expiration – after a password change or Microsoft account security event, the cached token may no longer be valid.
  • Conflicts with other sync tools – if you also use Google Drive or Dropbox on the same folders, file locks can cause errors.

Most error codes you see (like 0x8007016A, 0x8004de40, or 0x80070005) are generic Windows error codes that OneDrive wraps with its own context. The fix is often the same regardless of the exact number.

Before You Start: Basic Checks

Try these quick checks first – they resolve a surprising number of errors without any deeper troubleshooting.

  1. Make sure Windows 11 is fully updated (Settings > Windows Update > Check for updates).
  2. Check that your system date, time, and time zone are correct – an incorrect clock breaks the TLS certificates OneDrive uses.
  3. Pause and resume syncing from the OneDrive icon in the system tray (right-click the cloud icon > Pause syncing > resume after a minute).
  4. Restart the OneDrive process: press Ctrl+Shift+Esc to open Task Manager, find “Microsoft OneDrive”, right-click it, and choose “End task”. Then relaunch OneDrive from the Start menu.

If the error persists after these steps, move on to the specific fixes below.

Reset OneDrive (The Most Effective Fix)

Resetting OneDrive clears the cache and re-establishes the sync relationship without deleting your files. This fixes most error codes, including 0x8004de40 (sync engine failure) and 0x8007016A (file not found).

  1. Press Win+R to open the Run dialog.
  2. Type %localappdata%\Microsoft\OneDrive\onedrive.exe /reset and press Enter.
  3. A command prompt window may flash – wait for it to close.
  4. OneDrive should restart automatically. If it doesn’t, launch it from the Start menu.

If the reset command fails, try the full unlink method instead:

  1. Right-click the OneDrive cloud icon in the system tray and select “Settings”.
  2. Go to the “Account” tab and click “Unlink this PC”.
  3. Follow the prompts to sign out, then sign back in with your Microsoft account.

This forces a full re-sync of your file list but does not delete any cloud files.

Clear the OneDrive Cache Manually

If the reset command doesn’t work (some Windows 11 builds have issues with it), you can clear the cache folder manually. This is safe – it only removes temporary files, not your actual documents.

  1. Exit OneDrive completely (right-click the tray icon > Exit).
  2. Press Win+R, type %localappdata%\Microsoft\OneDrive\cache, and press Enter.
  3. Delete all files and folders inside this folder.
  4. Relaunch OneDrive – it will rebuild the cache.

If you see error 0x80070005 (access denied) when trying to delete, you may need to take ownership of the folder. Right-click the cache folder > Properties > Security > Advanced > Change owner to your username, then try again.

Fix File-Specific Sync Errors

Some errors point to a single file or folder that won’t sync. Common ones include:

  • Error 0x8007016A – the file name is invalid or the path is too long. Rename the file to something shorter, removing special characters.
  • Error 0x80070005 – permission issue. Right-click the file > Properties > Security > Edit > give your user account Full Control.
  • Error 0x8004de40 – often fixed by the reset above, but if it persists, check if the file is open in another program (like Word or Excel) and close it.

To find the exact file causing the problem, click the OneDrive icon in the tray and look at the “Sync activity” or “View sync problems” link. It will list the specific file and the error code.

Reinstall OneDrive

If nothing else works, a full reinstall gives you a clean slate. This is more thorough than a reset and also updates the app to the latest version.

  1. Press Win+I to open Settings > Apps > Installed apps.
  2. Search for “OneDrive”, click the three-dot menu, and select “Uninstall”.
  3. Restart your PC.
  4. Download the latest OneDrive from the official Microsoft website and install it.
  5. Sign in with your account and let it sync.

Your files are safe – they remain in the cloud and on any other synced devices. After reinstalling, OneDrive will re-download file placeholders as needed.

Frequently Asked Questions

Why does OneDrive keep showing “We’re syncing” but never finishes?

This usually indicates a stuck file or a large number of files. Check the sync problems list for specific errors. If there are none, try pausing sync for 30 minutes, then resuming – this often clears a backlog. Also check that you have enough free disk space on the drive where OneDrive is installed.

Can I fix OneDrive errors without losing my files?

Yes. All the fixes above – reset, cache clear, unlink, reinstall – preserve your actual files. They only reset the local sync state. Your cloud files remain untouched. If you’re extra cautious, back up your OneDrive folder to an external drive before attempting a reinstall.

What does error code 0x8007016A mean?

This is a Windows error that means “The cloud file provider is not running.” It often appears when OneDrive’s background process has crashed or been disabled. The reset command (onedrive.exe /reset) is the most direct fix. If that fails, ensure OneDrive is set to start automatically: right-click the tray icon > Settings > Settings > “Start OneDrive automatically when I sign in to Windows”.

Why does OneDrive error 0x8004de40 appear after a Windows update?

Windows updates can sometimes corrupt the OneDrive app’s database or change permissions. The reset command usually resolves it. If not, uninstall and reinstall OneDrive as described above. Also make sure your Microsoft account is in good standing – check account.microsoft.com for any security alerts that might block sync.

Is it safe to delete the OneDrive cache folder?

Yes. The cache folder contains temporary thumbnail and sync metadata, not your actual files. Deleting it forces OneDrive to rebuild the cache from the cloud. Your files will re-download as needed. Just make sure OneDrive is fully closed before deleting to avoid file locks.

How do I stop OneDrive from syncing a problem folder entirely?

Right-click the OneDrive tray icon > Settings > Account > Choose folders. Uncheck the folder that’s causing issues. This stops syncing that folder without deleting its cloud copy. You can re-enable it later after fixing the underlying issue (like renaming a file).

Related

General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.

More in this bed

The whole Tech How-To bed →