Fix OneDrive's "The cloud operation is invalid" (0x8007017C) for Long Paths

Cloud with an exclamation mark

Summary

This post shows you how to fix OneDrive's The cloud operation is invalid error (0x8007017C) by shortening parent folders or opening the file in SharePoint in your browser.

When you double-click a cloud-only file in File Explorer, OneDrive downloads the file before your desktop app opens it. If the full file path on your PC is too long, Windows stops the download with Error 0x8007017C: The cloud operation is invalid, even when the file's SharePoint path is under SharePoint's 400-character limit:

Windows interrupted-action dialog showing Error 0x8007017C and The cloud operation is invalid for a cloud-only workbook

Choose one approach to open the file:

Why "The cloud operation is invalid" (0x8007017C) happens

OneDrive's Backed up and synced status means your folder structure is up to date, not that every file is downloaded to your PC. Files with a cloud icon in File Explorer's Status column remain online-only until you open them.

When you double-click a cloud-only file whose local PC path exceeds Windows' 259-character limit (such as 330 characters in the example above), Windows blocks the on-demand download with Error 0x8007017C: The cloud operation is invalid. At some path lengths (such as 270 characters on your PC), double-clicking a cloud-only file shows no error and opens no app.

This happens because OneDrive prepends your Windows user profile and company folder name to every synced file on your PC:

Diagram comparing the 95-character SharePoint cloud path and the 219-character Windows PC path for the same synced spreadsheet

To check the full path length on your PC:

  1. Reveal the folder path in File Explorer
    • Open the folder containing the file that failed to open and click the address bar to display the folder path as text.
  2. Count the full path and filename
    • Count the folder path (including the drive letter and backslashes), plus one backslash and the filename with its extension. If File Explorer displays a shortened folder name containing ~1, count the complete folder name instead. See SharePoint and OneDrive path length limits to compare your local PC path with your SharePoint path.

Option A: Shorten parent folders

Shortening long parent folders in SharePoint reduces the path for every file inside them so OneDrive can download and open the files on your PC:

  1. Rename long parent folders in SharePoint
    • Open the document library in SharePoint, select a long parent folder's checkbox, click Rename on the toolbar, enter a shorter name, and click Update.
    • Repeat for a deeper folder if needed. In the example below, renaming the top folder to Q3 removes 30 characters and renaming a deeper folder to Energy removes another 51 characters:
Two SharePoint Rename dialogs shortening the top parent folder to Q3 and a deeper folder to Energy
  1. Wait for OneDrive to sync and open the file
    • Once OneDrive syncs the shorter folder names to your PC, double-click the file in File Explorer to download and open it:
The original Excel workbook open after its full path on the PC was reduced to 249 characters

After those two renames, the longest local path on the PC drops from 330 to 249 characters (and a second branch drops from 270 to 240 characters), so Excel, Word, PDF, and PNG files inside both branches download and open normally from File Explorer.

Option B: Open the file in the browser

If you cannot rename shared folders right away, open the file directly in SharePoint without downloading it to the long path on your PC:

  1. Select the file in SharePoint
    • Open the document library in your web browser, browse to the folder containing the file, and click the filename:
SharePoint source folder with Research summary.xlsx highlighted to open in the browser
  1. View or edit the file in the web app
    • Excel and Word files open in Excel for the web and Word for the web, while PDF and PNG files open in SharePoint's built-in viewer:
The workbook open in Excel for the web even though the long synced path failed on the PC

Because browser access uses the SharePoint path (296 and 356 characters in these folders) rather than the local Windows path, all four file types open in the browser even while the local path on your PC remains unchanged. For a full breakdown of how SharePoint and Windows calculate path lengths differently, see SharePoint and OneDrive path length limits.