1

I'm getting a 403 Client Error when making an S3 connection on one of our production servers using the tinys3 python package. Any ideas? I think the credentials are right, as this script runs on my local machine without issue.

I'm getting the same issue on a test script I wrote to help debug this. Pasted below:

import tinys3 as s3

S3_ACCESS_KEY = "[redacted]"`
S3_SECRET_KEY = "[redacted]"
bucket = "test-bucket"
s3_image_prefix = "http://s3.amazonaws.com/" + bucket + "/"
conn = s3.Connection(S3_ACCESS_KEY, S3_SECRET_KEY, default_bucket=bucket)
conn.get('test_file.gif', bucket)

And the error:

requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: http://s3.amazonaws.com/test-bucket/test_file.gif
dizzyf
  • 3,263
  • 19
  • 29

1 Answers1

2

If the machine's system clock is more than 15 minutes behind, you can get this error. The time is put into the request and checked by Amazon. Check the system time with the date command.

This has been discussed by some other questions:

Community
  • 1
  • 1
thomaskeefe
  • 1,900
  • 18
  • 19