Forum Discussion
Error code 0x80070185 - When opening Sharepoint files via OneDrive for Business
Hello All. I had the same issue. After a few days of troubleshooting I developed a fix. You essentially need to open each file in the cloud and get people to restart their OneDrive client. Opening the file triggers the repair. Below is my findings. I included a fix at the bottom.
Effected Files: Only Office files that were migrated from network drives using the SharePoint migration tool (likely ''SharePoint Migration Tool Public Preview). Confirmed it affects old legacy office files (.doc, .xls, etc...) and new (docx., xlsx, etc...). Does not happen with PDFs. I can consistently reproduce the problem on multiple sites and with multiple computers/users but only on files migrated using the tool.
Troubleshooting:
-Most of the time pressing retry 1-3 times works. The file then open successfully even if it's loaded back to the cloud and re-downloaded. Noticed the file sometimes gets ~2kb's bigger as soon as you open it for the first time (right after file is downloaded before it opens in Office). Opening it a second time only fixes it for the local computer. The file is fixed on all computers as soon as it is modified and uploaded back to the cloud.
- Confirmed it was not anti-virus. Uninstalled Vipre and issue still happened. I have noticed that Vipre crashes sometimes after the OneDrive error message. Replicated issue on two computers. Uninstalling Vipre does not fix OneDrive error. Confirm Vipre crashing is a separate known issue (VPBAGENT-3652 - Microsoft OneDrive users could encounter a VIPRE service crash when attempting to access OneDrive documents. link)
- Confirm issue still occurs on other wifi networks. Confirmed it happens on wired and wireless connection.
- Confirmed it happens with small and large files (22 KB - 25+ MB).
- Confirmed issue is happening on latest OneDrive version 19.070.0410.0005.
- Confirmed issue happens on sites where all the default library settings are kept (no special columns or metadata).
- Started re-index of document library. Checked 24+ hours later and confirmed issue is still occurring.
- Confirmed previewing the file in SharePoint Online does not trigger the file size increase/fix it.
The following steps appear to fix the problem on an individual file/folder:
- Opening the file AND modifying it (desktop or Online). Problem is it updates the last modified date/author as well so solution is not feasible.
- Modifying any file properties/column on SharePoint Online. Problem is it updates the last modified date/author as well.
- Moving the folder to a different library and moving it back appears to resolve the issue. Moving also triggers the file size increase. Only problem is it is very time intensive.
Here is what I did to fix the problem on our sites without having to move any files:
- Open the document library in Internet Explorer. Use the ‘View in File Explorer’ feature. Map the site library as a network drive.
- Use PowerShell to loop through all documents in the library and read the first line (see below). This triggers the file repair in the cloud.
- Have people reboot their computers or restart OneDrive sync client.
Get-ChildItem -Path 'INSERT MAPPED DRIVE HERE' -Include "*.xls*","*.doc*","*.ppt*" -Recurse | ForEach-Object {
$_.FullName
Get-Content -Path $_.FullName -first 1 | Out-Null
}
End result is people no longer get the error message and I didn’t need to move the files. It also maintains all file properties since I am just reading the file. Also has no impact on users who have documents open so it can be run during office hours.
If you have files that are over 50 mb you may need to modify your registry so the WebClient service can open them. Otherwise you will get an 'The file size exceeds the limit allowed and cannot be saved.' message in powershell. https://www.thewindowsclub.com/file-size-exceeds-limit-allowed-cannot-saved
JustinKropp - Thanks a million for your work here.
I have been struggling with this exact problem for around 3 months, and have been working through the basic steps with MSFT Partner Support. After being able to find no fault, their position was "you need to reduce the file count in the libraries and only sync one library". Needless to say, that wasn't an acceptable solution for the customer.
After being pointed to your thread, I ran your scripts against the relevant libraries and then reset the local OneDrive cache. A week later, the team report absolutely no errors trying to open Excel files from the library!
Thanks very much for all your work here, and for sharing your analysis and the powershell scripts. Absolutely fantastic.
If you ever find yourself in northern Australia, the beers are on me.
Cheers,
Matt