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
File Transport Checksums Between Server and Desktop #3735
As an ownCloud admin, I want ownCloud to ensure that files transported from the desktop client to the server are not corrupted in transit so that we can catch bugs and avoid corrupting customer data
Acceptance Criteria:
Desktop sync client takes a checksum of files on the desktop when they are discovered and stores the checksum in the database
When the file is transmitted to the ownCloud server, the checksum is also transmitted
The server checksums the file when it arrives at the server, compares it to the checksum transmitted by the client previously
If the checksums match, a success return code is sent
If the chechsums fail to match, the file has been corrupted and the desktop skips that file. The file will be retransmitted on the next upload.
If the file is corrupted in transit, the file transfer log on the desktop reflects that this file was corrupted in transit, and that it will be retried on the next sync run
Note: this links to server issue XXX
We also need to make sure getting an empty checksum header from the server during downloads isn't considered a validation failure - currently that seems to be the case. I wonder why b05ca52 did that -- @dragotin?
@ckamm the patch you're pointing to checks the expected checksum type as in Adler32 or SHA or so. If that is empty, we do not have checksumming and assume validated() - which means all is ok.
@dragotin Yes, but why would the checksum type configured in the config file matter when one validates a checksum the server sends?
And shouldn't an empty checksum header still yield validated? It sounds like only files that were uploaded by new clients will have checksums when using the owncloud server.
@moscicki I'm touching the checksumming code and wonder: Do you use Adler32 or ADLER32? What does the server accept and what does it send? I'd prefer to just use one spelling and there's a small chance you're requiring one for uploads and the other for downloads...
See owncloud/core#21997 for a WIP PR... it can store provided checksums from the OC-Checksum Header. Will return the OC-Checksum header if there is a checksum. And on propfind the checksums will be returned as well <oc:checksums>
The format for the header field is basically: <TYPE>:<CHECKSUM>(, <TYPE>:<CHECKSUM>)*
The acceptance criteria of this issue is not met as the server in the current implementation (9.0) does not validate the checksum that comes with the client's file upload, but only stores it.
In fact, with that we only have file transport verification only on downloads. Also the server stores checksums without verifying them against the uploaded file first.
The server checksums the file when it arrives at the server, compares it to the checksum transmitted by the client previously
If the checksums match, a success return code is sent
If the chechsums fail to match, the file has been corrupted and the desktop skips that file. The file will be retransmitted on the next upload.
these criteria above should have been added to the corresponding server ticket owncloud/core#18716
@MTRichards@karlitschek @cmonteroluque this somehow got lost while coordinating client and server requirements - hopefully we can avoid this in the future
for the sake of completeness, here is the current state with 9.0.
With not having the server verifying the uploaded checksum, this can happen:
1. UserA uploads a file to the server with checksumA.
2. FIle gets corrupted during transport
3. Server stores corrupted file and checksumA.
4. UserB downloads the file and checksum and they don't match.
5. UserB will invalidate the file, redownload.
At the same time UserA thinks his file is properly upload to the server. Which is not the case.
1.- Connect desktop client to a server that has cksum capabilities enabled
2.- Copy a big file (at least 50Mb) to Shared sync folder
3.- While syncing connect to server and modify any chunk adding some characters to be sure that final cksum and initial cksum does not match
Results
Right now as could be expected server does not validate cksum at uploads so in this case we could have a corrupted file updated to the server what is described right above could happend.
Test 2
Steps Executed
1.- Connect desktop client to a server that has cksum capabilities enabled
2.- Add a file1 to Shared sync folder
3.- Wait till sync is done
4.- Connect to server DB and update checksum value at filecache table for the file we have uploaded at step 3
5.- Remove connection and add a new connection to the same server
Results
An error is raised to let us know that the file1 does not match expected cksum and sync for that file ir retried at next sync.
Test 3
Steps executed
1.- Connect desktop client to a server that has cksum capabilities enabled
2.- Add a file2.eml to Shared Sync folder
3.- Wait till sync ends
4.- touch file2.eml
5.- Wait till sync ends again
Results
File2 is not synced again.
Test 4
Steps executed
1.- Connect desktop client to a server that has cksum capabilities enabled
2.- Add a file2.txt to Shared Sync folder
3.- Wait till sync ends
4.- touch file2.txt
5.- Wait till sync ends again
Results
File2.txt is uploaded again.
Test 5
Steps executed
1.- Connect desktop client to a server that has cksum capabilities enabled
2.- Add several files to Shared sync folder
3.- Wait till sync ends
4.- Check at DB that checksum stored matches with local checksum, i.e. md5
Results
It works fine, checksum matches.
@dragotin what do you think we can do with this issue ¿?
ServerOS: Ubuntu
Server Version: 9.1.0 Alpha modified to add cksum capabilities
Client OS: OS X El capitán 10.11.4
Client Version: Version 2.2.0rc1 (build 3346)
Activity
ckamm commentedon Oct 1, 2015
What needs to be done in the client?
Checksums: Prepare 'supported checksums' capability #3735
ckamm commentedon Oct 14, 2015
We also need to make sure getting an empty checksum header from the server during downloads isn't considered a validation failure - currently that seems to be the case. I wonder why b05ca52 did that -- @dragotin?
dragotin commentedon Oct 14, 2015
@ckamm the patch you're pointing to checks the expected checksum type as in Adler32 or SHA or so. If that is empty, we do not have checksumming and assume validated() - which means all is ok.
ckamm commentedon Oct 14, 2015
@dragotin Yes, but why would the checksum type configured in the config file matter when one validates a checksum the server sends?
And shouldn't an empty checksum header still yield
validated? It sounds like only files that were uploaded by new clients will have checksums when using the owncloud server.ckamm commentedon Oct 15, 2015
@moscicki I'm touching the checksumming code and wonder: Do you use
Adler32orADLER32? What does the server accept and what does it send? I'd prefer to just use one spelling and there's a small chance you're requiring one for uploads and the other for downloads...64 remaining items
ckamm commentedon Jan 19, 2016
@bboule Are you saying you're currently working on this? Should I assign this to you?
MorrisJobke commentedon Jan 19, 2016
I don't think so. This is just a label of the tool he is using 🙈
ckamm commentedon Jan 19, 2016
@MorrisJobke Thanks, that explains it. As far as I know, testing this can only start when owncloud/core#18716 is done.
rullzer commentedon Jan 29, 2016
See owncloud/core#21997 for a WIP PR... it can store provided checksums from the OC-Checksum Header. Will return the OC-Checksum header if there is a checksum. And on propfind the checksums will be returned as well
<oc:checksums>The format for the header field is basically:
<TYPE>:<CHECKSUM>(, <TYPE>:<CHECKSUM>)*rullzer commentedon Feb 3, 2016
owncloud/core#21997 is in. However slimmed down. So right now only 1 checksum can be send.
But all should work for 9.0
dragotin commentedon Feb 19, 2016
The acceptance criteria of this issue is not met as the server in the current implementation (9.0) does not validate the checksum that comes with the client's file upload, but only stores it.
In fact, with that we only have file transport verification only on downloads. Also the server stores checksums without verifying them against the uploaded file first.
DeepDiver1975 commentedon Feb 23, 2016
these criteria above should have been added to the corresponding server ticket owncloud/core#18716
@MTRichards @karlitschek @cmonteroluque this somehow got lost while coordinating client and server requirements - hopefully we can avoid this in the future
dragotin commentedon Feb 29, 2016
for the sake of completeness, here is the current state with 9.0.
With not having the server verifying the uploaded checksum, this can happen:
At the same time UserA thinks his file is properly upload to the server. Which is not the case.
mcastroSG commentedon May 11, 2016
Hi hi:
Test 1
Steps Executed
1.- Connect desktop client to a server that has cksum capabilities enabled
2.- Copy a big file (at least 50Mb) to Shared sync folder
3.- While syncing connect to server and modify any chunk adding some characters to be sure that final cksum and initial cksum does not match
Results
Right now as could be expected server does not validate cksum at uploads so in this case we could have a corrupted file updated to the server what is described right above could happend.
Test 2
Steps Executed
1.- Connect desktop client to a server that has cksum capabilities enabled
2.- Add a file1 to Shared sync folder
3.- Wait till sync is done
4.- Connect to server DB and update checksum value at filecache table for the file we have uploaded at step 3
5.- Remove connection and add a new connection to the same server
Results
An error is raised to let us know that the file1 does not match expected cksum and sync for that file ir retried at next sync.
Test 3
Steps executed
1.- Connect desktop client to a server that has cksum capabilities enabled
2.- Add a file2.eml to Shared Sync folder
3.- Wait till sync ends
4.-
touch file2.eml5.- Wait till sync ends again
Results
File2 is not synced again.
Test 4
Steps executed
1.- Connect desktop client to a server that has cksum capabilities enabled
2.- Add a file2.txt to Shared Sync folder
3.- Wait till sync ends
4.-
touch file2.txt5.- Wait till sync ends again
Results
File2.txt is uploaded again.
Test 5
Steps executed
1.- Connect desktop client to a server that has cksum capabilities enabled
2.- Add several files to Shared sync folder
3.- Wait till sync ends
4.- Check at DB that checksum stored matches with local checksum, i.e.
md5Results
It works fine, checksum matches.
@dragotin what do you think we can do with this issue ¿?
ServerOS: Ubuntu
Server Version: 9.1.0 Alpha modified to add cksum capabilities
Client OS: OS X El capitán 10.11.4
Client Version: Version 2.2.0rc1 (build 3346)
dragotin commentedon May 11, 2016
@mcastroSG very good work, all tests make sense and succeed. Thanks. I think you can close this.
mcastroSG commentedon May 11, 2016
Thanks a lot !! 😃
meekjt commentedon May 15, 2016
What is the config option for enabling support of file transport checksums on the server side? It does not seem to be documented anywhere.
danimo commentedon May 15, 2016
@meekjt The option is not there yet on the server side. It will come with one of the next versions.