question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

403 error with version 1.6.3 of boto3

See original GitHub issue

django version: 2.0.2 django-s3-storage version: 0.12.4 boto3 version: 1.6.3

Uploading a file then accessing the url results in a 403 error with the message:

The request signature we calculated does not match the signature you provided. Check your key and signing method.

Last version of boto3 I used that made django-s3-storage work was 1.5.2. This time version 1.6.3 autoinstalled as a dep and it threw the above error.

As always, thank you for such a wonderful module.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:13 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
wesleykendallcommented, Aug 19, 2020

@etianen and others, I had this error until I found this https://github.com/boto/boto3/issues/1644#issuecomment-434566036

To get rid of this error, set the following settings:

AWS_S3_ADDRESSING_STYLE = 'path'

Now I successfully can view objects with boto3=1.14.45 and django-s3-storage=“0.13.3”

@etianen do you think this should be changed to the default setting? I’m happy to open a PR. A better solution might be adjusting this based on the boto3 version, but I’m not sure if I will have time to make that PR

0reactions
tomwojcikcommented, Jul 22, 2021

I struggled with lots of errors but finally managed to make it work (for generate_presigned_post).

I get my client from (if you need it)

client = S3Boto3Storage().bucket.meta.client

And those are the settings you need to experiment with

AWS_S3_SIGNATURE_VERSION = "s3v4"  # required for some regions
AWS_S3_ADDRESSING_STYLE = 'path'  # needed only in some cases, depending on your boto3 version
AWS_S3_REGION_NAME = ...  # might be necessary if your region is non-default
boto3==1.18.4
django-storages==1.11.1
Read more comments on GitHub >

github_iconTop Results From Across the Web

Downloading files from AWS S3 Bucket with boto3 results in ...
This should download the file to the location and file given by FILE_NAME, but instead invokes the 403 Forbidden error. AWS Collective. python ......
Read more >
generate_presigned_url no longer works, gives ... - GitHub
import boto3,requests,os def get_session(): access_key ... 403 error with version 1.6.3 of boto3 etianen/django-s3-storage#74.
Read more >
403 Forbidden error for Intune objects in Graph Explorer
Troubleshoot and resolve a 403 Forbidden error when running queries in Graph Explorer to inspect or modify Microsoft Intune objects.
Read more >
boto3 - PyPI
Boto3 is the Amazon Web Services (AWS) Software Development Kit (SDK) for Python, which allows Python developers to write software that makes use...
Read more >
S3 — Boto3 Docs 1.26.35 documentation - AWS
If the bucket is owned by a different account, the request fails with the HTTP status code 403 Forbidden (access denied).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found