How to Fix OneDrive Sign-In Error 0x8004de40

Quick Fix

Most people fix this in under a minute by resetting the OneDrive client:

  1. Press Windows key + R to open Run.
  2. Type %localappdata%MicrosoftOneDriveonedrive.exe /reset and press Enter. The tray icon will disappear briefly.
  3. Wait 1-2 minutes, then reopen OneDrive from the Start menu and sign in again.

If it still fails, temporarily disable any VPN, proxy, or third-party antivirus/firewall and try signing in again - these are the next most common causes.

Step-by-Step Guide

What this error means

Error 0x8004de40 (sometimes paired with 0x8004de88) appears when signing in to OneDrive with the message 'There was a problem connecting to OneDrive. Check your Internet connection, and then try again.' Error Code 0x8004de40 or 0x8004de88 indicates OneDrive is having trouble connecting to the cloud. Despite the wording, it is rarely a real internet outage - it is usually caused by a proxy, VPN, antivirus/firewall interference, a stale local OneDrive cache, outdated TLS/cipher-suite settings, or (on work/school devices) a broken Microsoft Entra ID join.

Fix 1: Confirm your connection and rule out VPN/proxy

  1. Check basic connectivity. Make sure other websites and apps work normally on the same network.
  2. Disable VPN and proxy. Check if you have any VPN or Proxy settings running on your device or router, and disable them if there is.
  3. Check Internet Properties. Press Windows + R, type inetcpl.cpl, open the Connections tab, click LAN settings, enable Automatically detect settings and untick Use a proxy server for your LAN, then click OK and restart your PC.
  4. Try a different network. Connect to a mobile hotspot temporarily to see if the sign-in succeeds, which confirms a local network/firewall block rather than an account problem.

Fix 2: Temporarily disable antivirus or firewall

  1. Turn off third-party antivirus. Turn off your anti-virus software or network firewall on your PC and try signing in again.
  2. Whitelist OneDrive in your firewall. Whitelisting Microsoft OneDrive in the firewall for both Private and Public networks should fix the OneDrive error code 0x8004de40 in Windows 11.
  3. Re-enable protection afterward once you confirm this was the cause, and add an OneDrive exclusion instead of leaving antivirus off permanently.

Fix 3: Reset the OneDrive app (Windows)

  1. Close OneDrive completely. Right-click the OneDrive tray icon and choose to quit, or use Task Manager.
  2. Run the reset command. Press Windows + R, paste %localappdata%MicrosoftOneDriveonedrive.exe /reset, and press Enter. The simple command would reset the OneDrive app on your computer.
  3. Relaunch OneDrive manually if the icon does not reappear within a couple of minutes: run %localappdata%MicrosoftOneDriveonedrive.exe and sign in again.
  4. Alternatively, go to Settings > Apps > Microsoft OneDrive > Advanced options > Reset as a graphical equivalent of the command.

Fix 4: Fix outdated TLS/cipher suite settings (older Windows)

  1. Check TLS 1.2 support. This is especially relevant on Windows 8, Windows 7 Service Pack 1 (SP1), Windows Server 2012 or Windows Server 2008 R2 SP1 devices.
  2. Enable TLS protocols. Press Windows + R, type inetcpl.cpl, go to the Advanced tab, scroll down, and tick Use TLS 1.2 (and TLS 1.1 if present).
  3. Use Microsoft's Easy Fix Tool. The Easy Fix Tool can add TLS 1.1 and TLS 1.2 Secure Protocol registry keys automatically.
  4. Check cipher suite order if the error continues, since even after you upgrade to TLS 1.2, it's important to make sure that the cipher suites settings match Azure Front Door requirements.

Fix 5: Reset Winsock and flush DNS

  1. Open Command Prompt as administrator. Search for cmd, right-click it, and choose Run as administrator.
  2. Reset Winsock. Type netsh winsock reset catalog and press Enter, then restart your PC. If the above-discussed solutions do not fix the OneDrive Error Code 0x8004de40, try to reset the Windows Socket (Winsock), which manages the input and output requests of the internet on your Windows device.
  3. Flush DNS. In the same admin Command Prompt, type ipconfig /flushdns and press Enter.

Fix 6: Rejoin Microsoft Entra ID (work/school devices only)

  1. Restart while connected to your organization's network. Restart the device while it is connected to your Microsoft Entra domain.
  2. Unjoin and rejoin if that fails. Open an elevated Command Prompt, then type dsregcmd /leave, and press Enter. After the command runs, type dsregcmd /join, and press Enter.
  3. Restart and sign in again after the join command completes. Only do this while connected to your company or school network, not remotely.

Fix 7: Clear cached credentials or reinstall

  1. Remove stale sign-in tokens. Open Credential Manager in Control Panel, select Windows Credentials, and remove any entries starting with OneDrive Cached Credentials or msteams_adal, per user reports on Microsoft's own forums Please go to Credential Manager in the control panel, click on Windows Credentials, and under Generic Credentials find all the credentials starting with msteams_adal and OneDrive Cached Credentials, then remove them.
  2. Unlink and relink OneDrive. Right-click the OneDrive icon, open Settings, choose Unlink this PC, restart the device, and then sign in to OneDrive again.
  3. Reinstall OneDrive if the problem persists using the latest standalone client from Microsoft's website.

Fix 8: Mac-specific reset

  1. This step is for macOS only. Quit OneDrive from the menu bar first.
  2. Run the built-in reset script. In Finder open Applications, Control-click OneDrive, choose Show Package Contents, open Contents > Resources, double-click ResetOneDriveApp.command, then open OneDrive again from Applications and sign in.
  3. Reinstall if the script is missing. If your OneDrive app is older and does not show the reset script, drag it to Trash and install the current OneDrive for Mac, then try the reset steps again.

When to get further help

  1. Account-locked or storage-related codes. If you instead see 0x8004def7 or similar, this usually relates to storage limits or a frozen account rather than connectivity, and needs Microsoft account support.
  2. Business/Office 365 admin issues. If OneDrive works fine on other machines with the same account, but not this one, and none of the above fixes it, contact your organization's IT admin or open a Microsoft 365 support ticket, since some cases require an administrator-side fix.
  3. Persistent failures after all steps. If every method above fails, try a clean boot to rule out third-party software conflicts, or wait - some users report the error clearing on its own after a temporary Microsoft-side service issue.
Heads up: this guide was drafted with AI assistance from the real sources listed below, and structured by our team for clarity. It may not cover every possible cause — if it doesn't fix your issue, let us know and we'll take a closer look.

Was this fix helpful?