This error occurs when Amazon returns an error: they seem to disconnect the socket so that you do not load the gigabytes of the request in order to get the answer “no, this failed” in the response. This is why some people get it because of a skewed clock, some people get it because of policy errors, and others face size restrictions that require the use of a multi-part download API. It's not that everyone is mistaken or even looking at different problems: these are all different symptoms of the same basic behavior in s3cmd.
Since most error conditions will be deterministic, the behavior of s3cmd to discard the error message and repeat slowly seems crazy unsuccessful :(. Then. To get the actual error message, you can go to / usr / share / s 3cmd / S3 / S3.py (remembering that you need to delete the corresponding .pyc so that the changes are used) and add print e to the send_file except Exception, e: block.
In my case, I tried to set the Content-Type of the downloaded file to "application / x-debian-package". Apparently s3cmd S3.object_put 1) does not comply with the Content-Type passed through --add-header, but 2) cannot overwrite the Content-Type added through --add-header because it stores the headers in the dictionary with case - sensitive keys. The result is that it performs a signature calculation using the value of “content type” and then ends (with at least a lot of requests, this may be based on some kind of hashing order), sending the “Content-Type” to Amazon, which leads to a signature error.
In my particular case today, it seems that -M will cause s3cmd to guess the correct Content-Type, but it seems to be done based on the file name ... I would hope that it would use a mimemagic based database on the content file. Honestly, s3cmd cannot even return a failure status when it cannot load a file, so in combination with all these other problems, it's probably best to just write your own one-time tool to do the one thing you need ... it is almost certain that in the end it will save you time when you are bitten by some corner case of this tool: (.
Jay Freeman -saurik- Jul 19. '13 at 13:31 on 2013-07-19 13:31
source share