Trying to access a s3 bucket using boto3, but getting 403

Question:

I wrote a python script to download some files from an s3 bucket. The script works just fine on one machine, but breaks on another.
Here is the exception I get: botocore.exceptions.ClientError: An error occurred (403) when calling the HeadObject operation: Forbidden.

I am pretty sure it’s related to some system configurations, or something related to the registry, but don’t know what exactly. Both machines are running Windows 7 and python 3.5.
Any suggestions.

Answer:

The issue was actually being caused by the system time being incorrect. I fixed the system time and the problem is fixed.

Leave a Reply