Error Example:Error reading from entity '<dataentityname>': Error accessing file '<filepath>: The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters. Updated Debug messages: The current item violates the target system restrictions and will be skipped: The target sub url '/<fullPathofObject>' exceeds the maximum URL-length of 260 characters! NamingEnforcer: The file path '/<filePath>' was escaped to '/<adjustedFilePath>. Cause:If the fully qualified filename is 260 characters or more, OR if the folder name is over 248 characters, the Windows file system blocks access to the file/folder until it is fixed to be under the limit. This error usually happens during the read step of the Connector's process, so it never gets the opportunity to fix the file name when uploading the SharePoint. Please note that SharePoint Online changed to support a path limit of up to 400 characters in Summer 2017 - see Invalid file names and file types in OneDrive, OneDrive for Business, and SharePoint which describes this change. However, the Windows file system limit is still lower so trying to sync longer pathed files from SPO to the file system can still lead to this error. Resolution/Workaround:You must rename elements of the path to get it under 260 characters (or 248 if a folder) so that it is compliant with the file system restrictions.
Note: If you are using a newer OS (Windows 10 / Windows Server 2016 or above) you can alternatively enable NTFS Long File Path support offered by Microsoft.
The error messages have been updated so these should be easier to find in the log. You will need to increase logging to at least Debug level to see them (and this should be mentioned in the original error). They might also get some use from Microsoft's free "Easy Fix" tool which will find the items exceeding the length to upload to SharePoint. There is a handy PowerShell Script for finding these in the file system (just update the c:\ part to point at the revelant directory):
Alternate PowerShell Script - 248 is the SP restriction limit but can be changed if it comes up blank:
|