-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Description
Confirm by changing [ ] to [x] below:
- [ x] I've gone though the User Guide and the API reference
- [ x] I've searched for previous similar issues and didn't find any solution
Issue is about usage on:
- Service API : I want to do X using Y service, what should I do?
- CLI : passing arguments or cli configurations.
- Other/Not sure.
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.