-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Seems cli does not verify the checksum when downloading an object #6710
Comments
Hi @buptwxd2, Thanks for your post. Can you provide more details as to how you corrupted the object in step 3? |
Hi @kdaily , i am using the open-souce Ceph project for testing which is compatible with AWS S3. Here i want to double check if aws cli could check the data integrity as claimed in the FAQ. It would be great if aws cli could support this behavior. |
Hi @kdaily,any update on this thread? Thanks |
The documentation you referred to is for the high level If you are using I hope this answers your questions! |
|
Thanks @kdaily . |
Hi @buptwxd2, Can you please provide debug logs (add Edit: I'm also reviewing the documentation to confirm it's valid. |
Hi @kdaily Please see the attached file for the detailed logs. root@sds5 ~/x/test# aws s3api head-object --bucket xd-bk-2 --key 4M |
Hi @kdaily , any update on this thread? Thanks. |
Hi @buptwxd2, Still looking into this. Thanks for your patience. |
Hi @buptwxd2, Thanks for your patience. It seems that this functionality was not migrated when the AWS CLI started using the |
HI @kdaily , Do we hava a conclusion on this issue? Thanks a lot. |
Yes, aws cli doesn't do checksum validation in case of download. I have Verified with High level Api and Low Level Api of aws cli by enabling debug mode but I can't see any where it doing checksum validation. High Level Api : aws s3 cp /path/to/file s3://bucket/object-key Low Level Api : aws s3api get-object --bucket bucket-name --key object-key /path/to/file |
Confirm by changing [ ] to [x] below:
Issue is about usage on:
Platform/OS/Hardware/Device
What are you running the cli on?
Describe the question
According to "AWS S3 CLI FAQ"(https://docs.aws.amazon.com/cli/latest/topic/s3-faq.html#cli-aws-help-s3-faq), the aws cli tool will try to erify the checksum of downloads when possible.
However, i tried to corrupt an object and used the aws cli to download the corrupted object, it succeeded without detecting the mismatch.
Steps
preapre a local file, size:4MB witih all zero
upload the fille to s3 using aws cli
aws s3api put-object --bucket xd-bk-1 --key test --body 4M_zero
root@vm102 ~/x/test# aws s3api head-object --bucket xd-bk-1 --key test
{
"AcceptRanges": "bytes",
"LastModified": "2022-02-11T07:14:36+00:00",
"ContentLength": 4194304,
"ETag": ""b5cfa9d6c8febd618f91ac2843d50a1c"",
"ContentType": "binary/octet-stream",
"Metadata": {},
"StorageClass": "STANDARD"
}
corrupt the object
Download the object
root@vm102 ~/x/test# aws s3api get-object --bucket xd-bk-1 --key test d_test
{
"AcceptRanges": "bytes",
"LastModified": "2022-02-11T07:14:36+00:00",
"ContentLength": 4194304,
"ETag": ""b5cfa9d6c8febd618f91ac2843d50a1c"",
"ContentType": "binary/octet-stream",
"Metadata": {},
"StorageClass": "STANDARD"
}
root@vm102 ~/x/test# md5sum d_test
6c8b11cda139dbb04a83190975220d98 d_test
As a comparison, the s3cmd tool detected the mistach as below
root@vm102 ~/x/test [64]# s3cmd get s3://xd-bk-1/test dtest
download: 's3://xd-bk-1/test' -> 'dtest' [1 of 1]
4194304 of 4194304 100% in 0s 168.38 MB/s done
WARNING: MD5 signatures do not match: computed=6c8b11cda139dbb04a83190975220d98, received=b5cfa9d6c8febd618f91ac2843d50a1c
Logs/output
Get full traceback and error logs by adding
--debug
to the command.The text was updated successfully, but these errors were encountered: