basak / glacier-cli

Command-line interface to Amazon Glacier
Other
617 stars 54 forks source link

UnexpectedHTTPResponseError when uploading #27

Open elonen opened 11 years ago

elonen commented 11 years ago

I have a 2.7G file that fails to upload every time with the following error:

Traceback (most recent call last): File "/home/jarno/bin/glacier", line 694, in App().main() File "/home/jarno/bin/glacier", line 680, in main args.func(args) File "/home/jarno/bin/glacier", line 482, in archive_upload archive_id = vault.create_archive_from_file(file_obj=args.file, description=name) File "/home/jarno/bin/glacier-cli/glacier-cli/boto/glacier/vault.py", line 141, in create_archive_from_file writer.write(data) File "/home/jarno/bin/glacier-cli/glacier-cli/boto/glacier/writer.py", line 152, in write self.send_part() File "/home/jarno/bin/glacier-cli/glacier-cli/boto/glacier/writer.py", line 141, in send_part content_range, part) File "/home/jarno/bin/glacier-cli/glacier-cli/boto/glacier/layer1.py", line 626, in upload_part response_headers=response_headers) File "/home/jarno/bin/glacier-cli/glacier-cli/boto/glacier/layer1.py", line 88, in make_request raise UnexpectedHTTPResponseError(ok_responses, response) boto.glacier.exceptions.UnexpectedHTTPResponseError: Expected (204,), got (403, {"message":"The value passed in as x-amz-content-sha256 does not match the computed payload hash. Computed digest: e5c9cf7330ec9629b5db363c84e0da85e8267ad3b4cc646135fa1450c78c7e7b expected hash: dd4e39e6d6e0dc191af09d36db834dd25026a97b066956a09e2664033142f253","code":"InvalidSignatureException","type":"Client"})

Any ideas what to try?

elonen commented 11 years ago

Turns out DynamoDB / AWS demands precise clock synchronicity. Running ntpdate finally made the error go away.

Could the error message be caught in glacier-cli and replaced with a bit more understandable one? Or are there perhaps options to make AWS less sensitive about time differences?