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
Checksum Mismatch on Download Must be Handled Gracefully #4638
If the client detects a mismatch of checksum after download of a file, it must not completely drop the file but only display a warning that the checksums did not match and the file might be corrupted.
Actual behaviour
Because of owncloud/core#23783 we must not handle the checksum mismatch as a hard error. Because the server potentially delivers wrong checksums for files, there will be files where the checksums will not match even for not corrupted download.
Steps to reproduce
Have a wrong checksum stored in servers file cache
Have it synced to the client
Client will complain about broken checksum and try again.
Lets disable checksumming completely then. Displaying warnings will do more harm than good, i.e. lead to more bug reports that will wonder why there are warnings, and if they should worry.
What use is for such a warning?
Checksums are expected to be correct all along. This is the very reason they exists.
I suggest closing this report as invalig. There must be no wrong checksum in the server storage in first place. If it happened at the server side, the bug is in the server.
As discussed today once again. We just pass around checksums and do no actual checksum verification on the server. Which makes them not very useful. As such it is also somewhat dangerous for the client to rely on them.
I would second the above comment: if this checksumming feature is enabled on the client then you should assume that checksums are reliable and re-download automatically. If the checksum problem persists for several retries then this is another problem and should be reported to a user (most likely a bug in the stack somewhere). This would be useful to report to the user.
Disable hard checksum validation for servers that don't have a fix for occ files:scan does not invalidate checksums if file changed on disk. core#23783. It looks like there might be a patch in 9.0.2, but it's not certain yet. This is easy because we already have OWNCLOUD_DISABLE_CHECKSUM_DOWNLOAD and downloadChecksumEnabled().
Allow manual enabling of hard checksum validation for servers that support it (e.g. @moscicki). Would a new configuration flag be ok? I could make it a side effect of setting transmissionChecksum but that's not particularly tidy.
Improve handling of repeated checksum validation failure. While important, I don't think this is critical for 2.2.0 and I'll move it to its own ticket.
If I understand it right, transmissionChecksum is designed to ensure integrity of message payload.
In that case, it is a parallel feature to storage validation checksumming.
So I think it is good: if you drop the transmissionChecksum in config file in favour of capability call on the server then:
existing clients who set transmissionChecksum will not send any checksum if capability is not enabled on the server
broken server does not advertise the capability so the sync client will not send checksum on upload so the server will not return it
good server will return the capability so it will automatically enable the checksum handling in the client as expected
In this way you leave it in hands of the server to sort out correct checksum handling before advertising the capability to you. From a point of view of a client it is not a problem anymore and no need to maintain extra flags such as validateDownloads.
Ok, lets agree on this change: With 2.2.0, we remove the theming option transmissionChecksum from the client. Instead, our code checks for an entry in the server capabilities IF the server does checksumming. No current server does, which in fact disables the entire checksumming for now. Once we have a solution to provide reliable checksums, the server will set a checksum entry in the capabilities.
The only change is required on @moscicki s side: If 2.2.0 is released, you will have to add the entry in your capabilities to continue doing the validation on your site. Also some testing in your setup with a beta would be very appreciated.
c> @AnrDaemon your feedback is appreciated, but I ask you to work on tone of
c> voice. Currently I read you as unnecessarily forceful and confrontational.
c>
c> You say things like "Broken server, can't be helped client side.", "The
c> server needs fixes, not apologies." and that's now how we work together.
It would help if you read not only my last message, but previous ones too.
c> If there's an important bug in a released server version that can be worked
c> around without too much upfront and maintenance cost, we will do it. The
c> focus is not on whose bug it is but on whether we can improve the
c> experience for users.
It wasn't an attempt to push things around, it was an explanation to the
previous suggestion.
moscicki already explained it better than me, so I leave it at that.
Copy a txt file to shared folder on desktop client
Wait till sync
Pause Sync at Desktop Client
Modify txt file at Web server browser
Acces to Server DB and modify cksum stored for txt file
Wait till sync
Results
At Activity > Not Synced tab a new warning appears with "The downloaded file does not match the checksum. An a retry is launched at any sync, so this part seems to work fine, but there is no overlay icon update that warns this situation as is described at 3735#
Activity
danimo commentedon Apr 5, 2016
Lets disable checksumming completely then. Displaying warnings will do more harm than good, i.e. lead to more bug reports that will wonder why there are warnings, and if they should worry.
dragotin commentedon Apr 5, 2016
Hm. Yes. Probably true.
guruz commentedon Apr 6, 2016
Linking owncloud/core#23783
AnrDaemon commentedon Apr 6, 2016
What use is for such a warning?
Checksums are expected to be correct all along. This is the very reason they exists.
I suggest closing this report as invalig. There must be no wrong checksum in the server storage in first place. If it happened at the server side, the bug is in the server.
rullzer commentedon Apr 6, 2016
As discussed today once again. We just pass around checksums and do no actual checksum verification on the server. Which makes them not very useful. As such it is also somewhat dangerous for the client to rely on them.
AnrDaemon commentedon Apr 6, 2016
If you don't do checksum verification, then don't pass them around. Period.
As stated, the problem is in the server, not client.
moscicki commentedon Apr 7, 2016
Hello,
I would second the above comment: if this checksumming feature is enabled on the client then you should assume that checksums are reliable and re-download automatically. If the checksum problem persists for several retries then this is another problem and should be reported to a user (most likely a bug in the stack somewhere). This would be useful to report to the user.
ckamm commentedon Apr 12, 2016
It sounds like we need to do something like this:
OWNCLOUD_DISABLE_CHECKSUM_DOWNLOADanddownloadChecksumEnabled().transmissionChecksumbut that's not particularly tidy.AnrDaemon commentedon Apr 12, 2016
If I understand it right, transmissionChecksum is designed to ensure integrity of message payload.
In that case, it is a parallel feature to storage validation checksumming.
ckamm commentedon Apr 12, 2016
@AnrDaemon "Transmission checksums" are the checksums the client sends and receives from the server, "content checksums" are the checksums the client uses to detect changes in local data (never communicated to the server atm), see the doc comment in https://github.com/owncloud/client/blob/master/src/libsync/checksums.cpp for details.
AnrDaemon commentedon Apr 12, 2016
Ah, k. I confused them with a similarly named feature of HTTP protocol.
37 remaining items
rullzer commentedon Apr 15, 2016
Server 9.0 does it. If you send it a checksum it will return that cheksum (not always the right one as we have seen).
moscicki commentedon Apr 15, 2016
So I think it is good: if you drop the transmissionChecksum in config file in favour of capability call on the server then:
In this way you leave it in hands of the server to sort out correct checksum handling before advertising the capability to you. From a point of view of a client it is not a problem anymore and no need to maintain extra flags such as validateDownloads.
dragotin commentedon Apr 15, 2016
@moscicki You are right.
Ok, lets agree on this change: With 2.2.0, we remove the theming option
transmissionChecksumfrom the client. Instead, our code checks for an entry in the server capabilities IF the server does checksumming. No current server does, which in fact disables the entire checksumming for now. Once we have a solution to provide reliable checksums, the server will set a checksum entry in the capabilities.The only change is required on @moscicki s side: If 2.2.0 is released, you will have to add the entry in your capabilities to continue doing the validation on your site. Also some testing in your setup with a beta would be very appreciated.
@DeepDiver1975 @karlitschek @MTRichards do you agree?
Add server capabilities for checksums owncloud#4638
AnrDaemon commentedon Apr 15, 2016
c> @AnrDaemon your feedback is appreciated, but I ask you to work on tone of
c> voice. Currently I read you as unnecessarily forceful and confrontational.
c>
c> You say things like "Broken server, can't be helped client side.", "The
c> server needs fixes, not apologies." and that's now how we work together.
It would help if you read not only my last message, but previous ones too.
c> If there's an important bug in a released server version that can be worked
c> around without too much upfront and maintenance cost, we will do it. The
c> focus is not on whose bug it is but on whether we can improve the
c> experience for users.
It wasn't an attempt to push things around, it was an explanation to the
previous suggestion.
moscicki already explained it better than me, so I leave it at that.
karlitschek commentedon Apr 15, 2016
@dragotin makes total sense. Thanks!
ckamm commentedon Apr 21, 2016
This will be ready-to-test once the pull request #4663 is merged.
mcastroSG commentedon Apr 26, 2016
Hi hi:
Steps Executed
Results
At Activity > Not Synced tab a new warning appears with "The downloaded file does not match the checksum. An a retry is launched at any sync, so this part seems to work fine, but there is no overlay icon update that warns this situation as is described at 3735#
moscicki commentedon Oct 5, 2016
Please note that I have updated the protocol description accordingly:
https://github.com/cernbox/smashbox/blob/master/protocol/checksum.md
I would appreciate if someone could have a look and cross-check.
FYI: @michaelstingl
dragotin commentedon Oct 5, 2016
doublechecked, looks very reasonable. Thanks @moscicki