md5 checksum fails with multipart copy
[root@server3 daily]# s3cmd --version s3cmd version 1.1.0-beta3
UPLOAD:
[root@server3 daily]# s3cmd put aapaorg.tar.gz s3://archivos-eu WARNING: Module python-magic is not available. Guessing MIME types based on file extensions. WARNING: Redirected to: archivos-eu.s3-external-3.amazonaws.com aapaorg.tar.gz -> s3://archivos-eu/aapaorg.tar.gz [part 1 of 77, 15MB] 15728640 of 15728640 100% in 2s 7.48 MB/s done aapaorg.tar.gz -> s3://archivos-eu/aapaorg.tar.gz [part 2 of 77, 15MB] 15728640 of 15728640 100% in 1s 9.04 MB/s done aapaorg.tar.gz -> s3://archivos-eu/aapaorg.tar.gz [part 3 of 77, 15MB] 15728640 of 15728640 100% in 1s 8.76 MB/s done aapaorg.tar.gz -> s3://archivos-eu/aapaorg.tar.gz [part 4 of 77, 15MB] 15728640 of 15728640 100% in 1s 9.28 MB/s done aapaorg.tar.gz -> s3://archivos-eu/aapaorg.tar.gz [part 5 of 77, 15MB] 15728640 of 15728640 100% in 1s 8.97 MB/s done aapaorg.tar.gz -> s3://archivos-eu/aapaorg.tar.gz [part 6 of 77, 15MB] 15728640 of 15728640 100% in 1s 8.19 MB/s done aapaorg.tar.gz -> s3://archivos-eu/aapaorg.tar.gz [part 7 of 77, 15MB] 15728640 of 15728640 100% in 1s 8.49 MB/s done aapaorg.tar.gz -> s3://archivos-eu/aapaorg.tar.gz [part 8 of 77, 15MB] 15728640 of 15728640 100% in 2s 6.98 MB/s done aapaorg.tar.gz -> s3://archivos-eu/aapaorg.tar.gz [part 9 of 77, 15MB] 15728640 of 15728640 100% in 2s 5.84 MB/s done aapaorg.tar.gz -> s3://archivos-eu/aapaorg.tar.gz [part 10 of 77, 15MB] 15728640 of 15728640 100% in 1s 8.75 MB/s done aapaorg.tar.gz -> s3://archivos-eu/aapaorg.tar.gz [part 11 of 77, 15MB] 15728640 of 15728640 100% in 1s 9.14 MB/s done aapaorg.tar.gz -> s3://archivos-eu/aapaorg.tar.gz [part 12 of 77, 15MB] 15728640 of 15728640 100% in 2s 5.81 MB/s done aapaorg.tar.gz -> s3://archivos-eu/aapaorg.tar.gz [part 13 of 77, 15MB] 15728640 of 15728640 100% in 2s 6.69 MB/s done aapaorg.tar.gz -> s3://archivos-eu/aapaorg.tar.gz [part 14 of 77, 15MB] 15728640 of 15728640 100% in 2s 5.30 MB/s done aapaorg.tar.gz -> s3://archivos-eu/aapaorg.tar.gz [part 15 of 77, 15MB] 15728640 of 15728640 100% in 2s 5.65 MB/s done aapaorg.tar.gz -> s3://archivos-eu/aapaorg.tar.gz [part 16 of 77, 15MB] 15728640 of 15728640 100% in 3s 4.20 MB/s done aapaorg.tar.gz -> s3://archivos-eu/aapaorg.tar.gz [part 17 of 77, 15MB] 15728640 of 15728640 100% in 5s 2.80 MB/s done aapaorg.tar.gz -> s3://archivos-eu/aapaorg.tar.gz [part 18 of 77, 15MB] 15728640 of 15728640 100% in 1s 8.01 MB/s done aapaorg.tar.gz -> s3://archivos-eu/aapaorg.tar.gz [part 19 of 77, 15MB] 15728640 of 15728640 100% in 2s 5.03 MB/s done aapaorg.tar.gz -> s3://archivos-eu/aapaorg.tar.gz [part 20 of 77, 15MB] 15728640 of 15728640 100% in 7s 2.05 MB/s done aapaorg.tar.gz -> s3://archivos-eu/aapaorg.tar.gz [part 21 of 77, 15MB] 15728640 of 15728640 100% in 2s 6.20 MB/s done aapaorg.tar.gz -> s3://archivos-eu/aapaorg.tar.gz [part 22 of 77, 15MB] 15728640 of 15728640 100% in 1s 9.05 MB/s done aapaorg.tar.gz -> s3://archivos-eu/aapaorg.tar.gz [part 23 of 77, 15MB] 15728640 of 15728640 100% in 1s 8.95 MB/s done aapaorg.tar.gz -> s3://archivos-eu/aapaorg.tar.gz [part 24 of 77, 15MB] 15728640 of 15728640 100% in 1s 9.30 MB/s done aapaorg.tar.gz -> s3://archivos-eu/aapaorg.tar.gz [part 25 of 77, 15MB] 15728640 of 15728640 100% in 7s 1951.16 kB/s done aapaorg.tar.gz -> s3://archivos-eu/aapaorg.tar.gz [part 26 of 77, 15MB] 15728640 of 15728640 100% in 2s 6.04 MB/s done aapaorg.tar.gz -> s3://archivos-eu/aapaorg.tar.gz [part 27 of 77, 15MB] 15728640 of 15728640 100% in 2s 6.35 MB/s done aapaorg.tar.gz -> s3://archivos-eu/aapaorg.tar.gz [part 28 of 77, 15MB] 15728640 of 15728640 100% in 2s 5.00 MB/s done aapaorg.tar.gz -> s3://archivos-eu/aapaorg.tar.gz [part 29 of 77, 15MB] 15728640 of 15728640 100% in 4s 3.42 MB/s done aapaorg.tar.gz -> s3://archivos-eu/aapaorg.tar.gz [part 30 of 77, 15MB] 15728640 of 15728640 100% in 1s 8.61 MB/s done aapaorg.tar.gz -> s3://archivos-eu/aapaorg.tar.gz [part 31 of 77, 15MB] 15728640 of 15728640 100% in 2s 6.34 MB/s done aapaorg.tar.gz -> s3://archivos-eu/aapaorg.tar.gz [part 32 of 77, 15MB] 15728640 of 15728640 100% in 2s 6.07 MB/s done aapaorg.tar.gz -> s3://archivos-eu/aapaorg.tar.gz [part 33 of 77, 15MB] 15728640 of 15728640 100% in 2s 6.69 MB/s done aapaorg.tar.gz -> s3://archivos-eu/aapaorg.tar.gz [part 34 of 77, 15MB] 15728640 of 15728640 100% in 4s 3.54 MB/s done aapaorg.tar.gz -> s3://archivos-eu/aapaorg.tar.gz [part 35 of 77, 15MB] 15728640 of 15728640 100% in 1s 8.23 MB/s done aapaorg.tar.gz -> s3://archivos-eu/aapaorg.tar.gz [part 36 of 77, 15MB] 15728640 of 15728640 100% in 1s 8.88 MB/s done aapaorg.tar.gz -> s3://archivos-eu/aapaorg.tar.gz [part 37 of 77, 15MB] 15728640 of 15728640 100% in 1s 7.99 MB/s done aapaorg.tar.gz -> s3://archivos-eu/aapaorg.tar.gz [part 38 of 77, 15MB] 15728640 of 15728640 100% in 6s 2.46 MB/s done aapaorg.tar.gz -> s3://archivos-eu/aapaorg.tar.gz [part 39 of 77, 15MB] 15728640 of 15728640 100% in 2s 6.24 MB/s done aapaorg.tar.gz -> s3://archivos-eu/aapaorg.tar.gz [part 40 of 77, 15MB] 15728640 of 15728640 100% in 4s 3.63 MB/s done aapaorg.tar.gz -> s3://archivos-eu/aapaorg.tar.gz [part 41 of 77, 15MB] 15728640 of 15728640 100% in 4s 3.62 MB/s done aapaorg.tar.gz -> s3://archivos-eu/aapaorg.tar.gz [part 42 of 77, 15MB] 15728640 of 15728640 100% in 4s 3.13 MB/s done aapaorg.tar.gz -> s3://archivos-eu/aapaorg.tar.gz [part 43 of 77, 15MB] 15728640 of 15728640 100% in 3s 4.72 MB/s done aapaorg.tar.gz -> s3://archivos-eu/aapaorg.tar.gz [part 44 of 77, 15MB] 15728640 of 15728640 100% in 4s 3.33 MB/s done aapaorg.tar.gz -> s3://archivos-eu/aapaorg.tar.gz [part 45 of 77, 15MB] 15728640 of 15728640 100% in 4s 3.47 MB/s done aapaorg.tar.gz -> s3://archivos-eu/aapaorg.tar.gz [part 46 of 77, 15MB] 15728640 of 15728640 100% in 2s 5.05 MB/s done aapaorg.tar.gz -> s3://archivos-eu/aapaorg.tar.gz [part 47 of 77, 15MB] 15728640 of 15728640 100% in 3s 4.74 MB/s done aapaorg.tar.gz -> s3://archivos-eu/aapaorg.tar.gz [part 48 of 77, 15MB] 15728640 of 15728640 100% in 2s 5.76 MB/s done aapaorg.tar.gz -> s3://archivos-eu/aapaorg.tar.gz [part 49 of 77, 15MB] 15728640 of 15728640 100% in 1s 8.33 MB/s done aapaorg.tar.gz -> s3://archivos-eu/aapaorg.tar.gz [part 50 of 77, 15MB] 15728640 of 15728640 100% in 3s 3.76 MB/s done aapaorg.tar.gz -> s3://archivos-eu/aapaorg.tar.gz [part 51 of 77, 15MB] 15728640 of 15728640 100% in 1s 8.73 MB/s done aapaorg.tar.gz -> s3://archivos-eu/aapaorg.tar.gz [part 52 of 77, 15MB] 15728640 of 15728640 100% in 2s 5.09 MB/s done aapaorg.tar.gz -> s3://archivos-eu/aapaorg.tar.gz [part 53 of 77, 15MB] 15728640 of 15728640 100% in 3s 4.32 MB/s done aapaorg.tar.gz -> s3://archivos-eu/aapaorg.tar.gz [part 54 of 77, 15MB] 15728640 of 15728640 100% in 3s 4.38 MB/s done aapaorg.tar.gz -> s3://archivos-eu/aapaorg.tar.gz [part 55 of 77, 15MB] 15728640 of 15728640 100% in 3s 4.74 MB/s done aapaorg.tar.gz -> s3://archivos-eu/aapaorg.tar.gz [part 56 of 77, 15MB] 15728640 of 15728640 100% in 3s 3.82 MB/s done aapaorg.tar.gz -> s3://archivos-eu/aapaorg.tar.gz [part 57 of 77, 15MB] 15728640 of 15728640 100% in 4s 3.05 MB/s done aapaorg.tar.gz -> s3://archivos-eu/aapaorg.tar.gz [part 58 of 77, 15MB] 15728640 of 15728640 100% in 5s 2.83 MB/s done aapaorg.tar.gz -> s3://archivos-eu/aapaorg.tar.gz [part 59 of 77, 15MB] 15728640 of 15728640 100% in 6s 2.27 MB/s done aapaorg.tar.gz -> s3://archivos-eu/aapaorg.tar.gz [part 60 of 77, 15MB] 15728640 of 15728640 100% in 5s 2.54 MB/s done aapaorg.tar.gz -> s3://archivos-eu/aapaorg.tar.gz [part 61 of 77, 15MB] 15728640 of 15728640 100% in 4s 3.05 MB/s done aapaorg.tar.gz -> s3://archivos-eu/aapaorg.tar.gz [part 62 of 77, 15MB] 15728640 of 15728640 100% in 3s 4.77 MB/s done aapaorg.tar.gz -> s3://archivos-eu/aapaorg.tar.gz [part 63 of 77, 15MB] 15728640 of 15728640 100% in 4s 3.69 MB/s done aapaorg.tar.gz -> s3://archivos-eu/aapaorg.tar.gz [part 64 of 77, 15MB] 15728640 of 15728640 100% in 1s 8.64 MB/s done aapaorg.tar.gz -> s3://archivos-eu/aapaorg.tar.gz [part 65 of 77, 15MB] 15728640 of 15728640 100% in 3s 4.47 MB/s done aapaorg.tar.gz -> s3://archivos-eu/aapaorg.tar.gz [part 66 of 77, 15MB] 15728640 of 15728640 100% in 1s 8.90 MB/s done aapaorg.tar.gz -> s3://archivos-eu/aapaorg.tar.gz [part 67 of 77, 15MB] 15728640 of 15728640 100% in 2s 5.99 MB/s done aapaorg.tar.gz -> s3://archivos-eu/aapaorg.tar.gz [part 68 of 77, 15MB] 15728640 of 15728640 100% in 2s 6.05 MB/s done aapaorg.tar.gz -> s3://archivos-eu/aapaorg.tar.gz [part 69 of 77, 15MB] 15728640 of 15728640 100% in 2s 6.30 MB/s done aapaorg.tar.gz -> s3://archivos-eu/aapaorg.tar.gz [part 70 of 77, 15MB] 15728640 of 15728640 100% in 3s 4.52 MB/s done aapaorg.tar.gz -> s3://archivos-eu/aapaorg.tar.gz [part 71 of 77, 15MB] 15728640 of 15728640 100% in 1s 8.83 MB/s done aapaorg.tar.gz -> s3://archivos-eu/aapaorg.tar.gz [part 72 of 77, 15MB] 15728640 of 15728640 100% in 2s 6.00 MB/s done aapaorg.tar.gz -> s3://archivos-eu/aapaorg.tar.gz [part 73 of 77, 15MB] 15728640 of 15728640 100% in 1s 8.24 MB/s done aapaorg.tar.gz -> s3://archivos-eu/aapaorg.tar.gz [part 74 of 77, 15MB] 15728640 of 15728640 100% in 1s 9.12 MB/s done aapaorg.tar.gz -> s3://archivos-eu/aapaorg.tar.gz [part 75 of 77, 15MB] 15728640 of 15728640 100% in 1s 7.77 MB/s done aapaorg.tar.gz -> s3://archivos-eu/aapaorg.tar.gz [part 76 of 77, 15MB] 15728640 of 15728640 100% in 1s 7.66 MB/s done aapaorg.tar.gz -> s3://archivos-eu/aapaorg.tar.gz [part 77 of 77, 8MB] 9401607 of 9401607 100% in 2s 3.77 MB/s done
DOWNLOAD:
[root@server3 daily]# s3cmd get s3://archivos-eu/aapaorg.tar.gz aapa2.tgz s3://archivos-eu/aapaorg.tar.gz -> aapa2.tgz [1 of 1] WARNING: Redirected to: archivos-eu.s3-external-3.amazonaws.com s3://archivos-eu/aapaorg.tar.gz -> aapa2.tgz [1 of 1] 1204778247 of 1204778247 100% in 172s 6.67 MB/s done WARNING: MD5 signatures do not match: computed=03e33830c6a709ba8a57680db5f178f0, received="16f1bd5c237e0a9a86370c9396cd7cd0-77"
MANUAL MD5 CHECK:
but "manual" md5 check match:
[root@server3 daily]# md5sum aapa2.tgz aapaorg.tar.gz 03e33830c6a709ba8a57680db5f178f0 aapa2.tgz 03e33830c6a709ba8a57680db5f178f0 aapaorg.tar.gz
regards
roberto
Right - the checksum returned by S3 is only the checksum of one of the chunks. You need a version (e.g. from my merge branch) that stores the actual file's MD5SUM in the S3 metadata, and looks at that instead.
[root@server3 daily]# s3cmd get s3://archivos-eu/aapaorg.tar.gz aapa2.tgz
s3://archivos-eu/aapaorg.tar.gz -> aapa2.tgz [1 of 1] WARNING: Redirected to: archivos-eu.s3-external-3.amazonaws.com s3://archivos-eu/aapaorg.tar.gz -> aapa2.tgz [1 of 1] 1204778247 of 1204778247 100% in 172s 6.67 MB/s done WARNING: MD5 signatures do not match: computed=03e33830c6a709ba8a57680db5f178f0, received="16f1bd5c237e0a9a86370c9396cd7cd0-77"
MANUAL MD5 CHECK:
but "manual" md5 check match:
[root@server3 daily]# md5sum aapa2.tgz aapaorg.tar.gz 03e33830c6a709ba8a57680db5f178f0 aapa2.tgz 03e33830c6a709ba8a57680db5f178f0 aapaorg.tar.gz
regards
roberto
— Reply to this email directly or view it on GitHubhttps://github.com/s3tools/s3cmd/issues/85.
Same problem.
version 1.5.0-alpha1 and newer have my md5sum tracking code. Closing.
Sorry, I'm able to reproduce this with 1.5.0-alpha3. AWS support was able to reproduce as well (with alpha1 and alpha3) :)
yes - the fix landed in the master branch after -alpha3. I had thought it was fixed earlier, but your note made me revisit the code path. Can you please try the github master branch now?
Thanks, Matt
On Wed, Jun 12, 2013 at 5:10 PM, Charlie Schluting <[email protected]
wrote:
Sorry, I'm able to reproduce this with 1.5.0-alpha3. AWS support was able to reproduce as well (with alpha1 and alpha3) :)
— Reply to this email directly or view it on GitHubhttps://github.com/s3tools/s3cmd/issues/85#issuecomment-19359138 .
Ah, I see.
Unfortunately, with the current master, I still see the issue with files uploaded using multi-part: WARNING: MD5 signatures do not match: computed=c4460ad3728d81945f0c44752df3343a, received="0d68e20936add34a68ba33956c8ed3ad-25"
Note: in my use-case, this file is uploaded to s3 via elastic map/reduce, not from s3cmd. Since s3cmd didn't upload the file -- am I understanding correctly that there is no checksum available aside from "the last chunk" in the multi-part upload?
correct - the s3cmd code only works if s3cmd uploaded the file, so that the metadata for the file has the real md5sum to compare against.
I was thinking about this. We now have a cache of { object : various metadata including md5sum } that we keep on the local file system, when the --cache-file=FILE option is given. What if we stored not just the actual md5sum, but also the S3-provided ETag value (which is either the md5sum of the whole file if under a single chunk size, or of one of the chunks if multipart upload). If we were to obtain that ETag, and use it for future comparison, we would have to trust that the file got uploaded correctly the first time, but we could then use the ETag value directly from then on out, assuming S3 won't corrupt the file either on upload or while on disk... Then when s3cmd sync goes to get the directory listing, it wouldn't have to do a HEAD call for the multipart-uploaded objects to get the actual MD5sum - we'd just compare the directory listing's multipart md5sum value to what we stored in the --cache-file and see if that has changed.
On Wed, Jun 12, 2013 at 11:25 PM, Charlie Schluting < [email protected]> wrote:
Ah, I see.
Unfortunately, with the current master, I still see the issue with files uploaded using multi-part: WARNING: MD5 signatures do not match: computed=c4460ad3728d81945f0c44752df3343a, received="0d68e20936add34a68ba33956c8ed3ad-25"
Note: in my use-case, this file is uploaded to s3 via elastic map/reduce, not from s3cmd. Since s3cmd didn't upload the file -- am I understanding correctly that there is no checksum available aside from "the last chunk" in the multi-part upload?
— Reply to this email directly or view it on GitHubhttps://github.com/s3tools/s3cmd/issues/85#issuecomment-19371416 .