Skip to content

Checksum Mismatch on Download Must be Handled Gracefully #4638

Closed

Description

@dragotin

Expected behaviour

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

  1. Have a wrong checksum stored in servers file cache
  2. Have it synced to the client
  3. Client will complain about broken checksum and try again.

Client version 2.2.0 git.

Activity

  1. added
    p2-high
    on Apr 5, 2016
  2. added this to the milestone on Apr 5, 2016
  3. danimo commented on Apr 5, 2016

    @danimo
    Contributor

    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.

  4. dragotin commented on Apr 5, 2016

    @dragotin
    ContributorAuthor

    Hm. Yes. Probably true.

  5. guruz commented on Apr 6, 2016

    @guruz
    Contributor
  6. AnrDaemon commented on Apr 6, 2016

    @AnrDaemon

    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.

  7. rullzer commented on Apr 6, 2016

    @rullzer
    Contributor

    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.

  8. AnrDaemon commented on Apr 6, 2016

    @AnrDaemon

    If you don't do checksum verification, then don't pass them around. Period.
    As stated, the problem is in the server, not client.

  9. moscicki commented on Apr 7, 2016

    @moscicki
    Contributor

    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.

  10. ckamm commented on Apr 12, 2016

    @ckamm
    Contributor

    It sounds like we need to do something like this:

    • 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.
  11. AnrDaemon commented on Apr 12, 2016

    @AnrDaemon

    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.

  12. ckamm commented on Apr 12, 2016

    @ckamm
    Contributor

    @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.

  13. AnrDaemon commented on Apr 12, 2016

    @AnrDaemon

    Ah, k. I confused them with a similarly named feature of HTTP protocol.

  14. 37 remaining items

  15. rullzer commented on Apr 15, 2016

    @rullzer
    Contributor

    @DeepDiver1975 is there any server release out there that returns checksums at all?

    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).

  16. moscicki commented on Apr 15, 2016

    @moscicki
    Contributor

    So I think it is good: if you drop the transmissionChecksum in config file in favour of capability call on the server then:

    1. existing clients who set transmissionChecksum will not send any checksum if capability is not enabled on the server
    2. broken server does not advertise the capability so the sync client will not send checksum on upload so the server will not return it
    3. 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.

  17. dragotin commented on Apr 15, 2016

    @dragotin
    ContributorAuthor

    @moscicki You are right.

    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.

    @DeepDiver1975 @karlitschek @MTRichards do you agree?

  18. AnrDaemon commented on Apr 15, 2016

    @AnrDaemon

    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.

  19. karlitschek commented on Apr 15, 2016

    @karlitschek

    @dragotin makes total sense. Thanks!

  20. added
    ReadyToTest
    and removed
    ReadyToTest
    on Apr 20, 2016
  21. ckamm commented on Apr 21, 2016

    @ckamm
    Contributor

    This will be ready-to-test once the pull request #4663 is merged.

  22. added
    ReadyToTest
    on Apr 21, 2016
  23. mcastroSG commented on Apr 26, 2016

    @mcastroSG

    Hi hi:

    Steps Executed

    1. Copy a txt file to shared folder on desktop client
    2. Wait till sync
    3. Pause Sync at Desktop Client
    4. Modify txt file at Web server browser
    5. Acces to Server DB and modify cksum stored for txt file
    6. 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#

  24. moscicki commented on Oct 5, 2016

    @moscicki
    Contributor

    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

  25. dragotin commented on Oct 5, 2016

    @dragotin
    ContributorAuthor

    doublechecked, looks very reasonable. Thanks @moscicki

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

ReadyToTestp2-highsev1-criticaltype:bug

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions