You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
onedrive (SharePoint): file integrity check fails because SharePoint modifies specific files #2599
There have been multiple reports that SharePoint modifies files uploaded (mostly Office files), so this issue is opened to track the problem. Currently there seems to be no way to disable this behaviour, but a possible workaround is to set the length of the affected files to -1 and their hash to an empty string so they can be ignored.
It doesn't appear that microsoft views this as a problem. I seem to be able to sync (without any verification, of course) using 1.48.0 if I pass --ignore-checksum --ignore-size. Is there a better way to get past this?
sorry for resurrecting this old issue but we have done alot of testing with this and find that if --vfs-cache-mode is set to off it works fine every time uploading files, if its set to full or writes it needs --ignore-checksum --ignore-size xlsx files are corrupted, if it was just sharepoint then it would happen all the time I would have thought
I find some thing to do about this issue.
This is a bug of SharePoint.
After uploading, some files with certain extensions will be modified, 11-12 bytes longer than the original file.
I try to upload the same file with a extension .xxx, this bug is not triggered.
So maybe we can add a mode flag, uploading files with two steps, upload to a strange name and rename it to the correct name.
I find out what SharePoint Backend is doing with one of my JPEG images.
This JPEG seems to have a bad header information.
The density in JPEG header is 96 x 96.
The density in EXIF(which is JPEG APP1 Part) is 72 x 72.
SharePoint modified the density in JPEG header to 72 x 72, and add 12bytes to EXIF part.
All bytes in EXIF after the EXIF size-bytes is not modified, only 12 bytes appended.
I don't know why, maybe a bug of Microsoft?
It seems there is a filter program in the process of upload API, which is correcting the information of some files.
But if you upload the file with a different extension and rename it to JPEG after uploading, this filter program does not work.
I think this is a bug of SharePoint/OneDrive Business.
It should not write back the corrected information to the uploaded file.
The problem is that Sharepoint modifies some of the uploaded files by itself as soon as they are uploaded. Adding properties. Changing DPI etc. so they have different size and of course checksum.
The solution is to set ParserDisable property of the destination Sharepoint list to True. Not in powershell, not in admin panel, not in Graph API.
You can do it via Sharepoint REST api available at https://contoso.sharepoint.com/sites/abcd/_api/
or use wrapper like the "CLI for Microsoft 365" tool.
In my opinion there should be an option when creating new Sharepoint remote in rclone. And check of this attribute in sync and copy command with warning if not set. That would give users best experience.
And imagine all of that time humanity will save on googling "Failed to copy: corrupted on transfer: QuickXorHash crypted hash differ."
@hjastr thank you for that. Do you think that is something we should put in the docs, or is that something rclone should do itself?
I find a way to solve this problem.
update with a safe filename and then rename it.
this problem only happens in a small set of file extensions.
for example,
abc.jpg may be modified but abc.jpg.xxx never modified and no file will be modified after renaming.
Activity
Cnly commentedon Nov 8, 2018
Update: There is an issue on OneDrive's side about this: OneDrive/onedrive-api-docs#935. Will keep tracking.
jasontibbitts commentedon Sep 10, 2019
It doesn't appear that microsoft views this as a problem. I seem to be able to sync (without any verification, of course) using 1.48.0 if I pass
--ignore-checksum --ignore-size. Is there a better way to get past this?WarpedPixel commentedon Aug 8, 2020
There is a workaround that worked for me described in issue #2036
dinger1986 commentedon May 22, 2023
sorry for resurrecting this old issue but we have done alot of testing with this and find that if
--vfs-cache-modeis set tooffit works fine every time uploading files, if its set tofullorwritesit needs--ignore-checksum --ignore-sizexlsx files are corrupted, if it was just sharepoint then it would happen all the time I would have thoughtlandall commentedon Jul 4, 2023
I find some thing to do about this issue.
This is a bug of SharePoint.
After uploading, some files with certain extensions will be modified, 11-12 bytes longer than the original file.
I try to upload the same file with a extension .xxx, this bug is not triggered.
So maybe we can add a mode flag, uploading files with two steps, upload to a strange name and rename it to the correct name.
dinger1986 commentedon Jul 4, 2023
A mode that would only cache for downloading but not uploading would probably work as well
landall commentedon Jul 5, 2023
I find out what SharePoint Backend is doing with one of my JPEG images.
This JPEG seems to have a bad header information.
The density in JPEG header is 96 x 96.
The density in EXIF(which is JPEG APP1 Part) is 72 x 72.
SharePoint modified the density in JPEG header to 72 x 72, and add 12bytes to EXIF part.
All bytes in EXIF after the EXIF size-bytes is not modified, only 12 bytes appended.
I don't know why, maybe a bug of Microsoft?
It seems there is a filter program in the process of upload API, which is correcting the information of some files.
But if you upload the file with a different extension and rename it to JPEG after uploading, this filter program does not work.
I think this is a bug of SharePoint/OneDrive Business.
It should not write back the corrected information to the uploaded file.
dinger1986 commentedon Jul 5, 2023
Is vfs cache enabled?
landall commentedon Jul 5, 2023
I checked this without rclone.
I just call the Microsoft Graph File API to upload large file directly.
landall commentedon Jul 6, 2023
I post this bug in Microsoft Graph Feedback. Can anyone help to vote it ?
https://feedbackportal.microsoft.com/feedback/idea/34e3c738-291c-ee11-a81c-000d3a7a48db
dinger1986 commentedon Jul 6, 2023
Done
hgrbk commentedon Oct 17, 2024
The problem is that Sharepoint modifies some of the uploaded files by itself as soon as they are uploaded. Adding properties. Changing DPI etc. so they have different size and of course checksum.
The solution is to set ParserDisable property of the destination Sharepoint list to True. Not in powershell, not in admin panel, not in Graph API.
You can do it via Sharepoint REST api available at https://contoso.sharepoint.com/sites/abcd/_api/
or use wrapper like the "CLI for Microsoft 365" tool.
ncw commentedon Oct 17, 2024
@hjastr thank you for that. Do you think that is something we should put in the docs, or is that something rclone should do itself?
hgrbk commentedon Oct 18, 2024
In my opinion there should be an option when creating new Sharepoint remote in rclone. And check of this attribute in sync and copy command with warning if not set. That would give users best experience.
And imagine all of that time humanity will save on googling "Failed to copy: corrupted on transfer: QuickXorHash crypted hash differ."
landall commentedon Oct 19, 2024
I find a way to solve this problem.
update with a safe filename and then rename it.
this problem only happens in a small set of file extensions.
for example,
abc.jpg may be modified but abc.jpg.xxx never modified and no file will be modified after renaming.
emombiela commentedon Aug 4, 2026
I can confirm this is still happening with:
rclone v1.74.4
Ubuntu 24.04
I reproduced the issue on multiple SharePoint document libraries and a newly created library.
The same XLSX uploads correctly to OneDrive Business but not to SharePoint document libraries.
After uploading the file through SharePoint Web UI and downloading it again, the file is physically modified by SharePoint.
A diff between the original and downloaded XLSX shows:
The uploaded XLSX grows from 8811 bytes to approximately 14-15 KB.
rclone then reports:
corrupted on transfer: sizes differ
and removes the uploaded file.
This does not affect DOCX, ODS, CSV or TXT files.
Only XLS/XLSX seem affected.