boto / S3 errors

Published by in Boto, S3, Aws, Python at https://rmoff.net/2016/10/14/boto-/-s3-errors/

Presented without comment, warranty, or context - other than these might help a wandering code hacker.

When using SigV4, you must specify a ‘host’ parameter ðŸ”—

boto.s3.connection.HostRequiredError: BotoClientError: When using SigV4, you must specify a 'host' parameter.

To fix, switch

conn_s3 = boto.connect_s3()

for

conn_s3 = boto.connect_s3(host='s3.amazonaws.com')

You can see a list of endpoints here.

boto.exception.S3ResponseError: S3ResponseError: 400 Bad Request ðŸ”—

Make sure you’re specifying the correct hostname (see above) for the bucket’s region. Determine the bucket’s region from the S3 control panel, and then use the endpoint listed here.