Open orimboolak opened 4 years ago
Could you figure out a solution?
I had this issue with a bucket in us-east-2
. Without going into the last 2 hours of archeology of boto3 issues and storages code. I solved it by setting the following in my settings.py.
AWS_S3_ADDRESSING_STYLE = "virtual"
I am moving this chart up from below to help give more visibility to it.
Region | Setting |
---|---|
us-east-1 | default or AWS_S3_SIGNATURE_VERSION = "s3v4" |
us-east-2 | AWS_S3_ADDRESSING_STYLE = "virtual" |
ap-northeast-1 | AWS_S3_SIGNATURE_VERSION = "s3v4" |
ap-southeast-2 | AWS_S3_ADDRESSING_STYLE = "virtual" |
ap-south-1 | AWS_S3_ADDRESSING_STYLE = "virtual" |
eu-central-1 | AWS_S3_ADDRESSING_STYLE = "virtual" |
eu-central-1 | AWS_S3_ADDRESSING_STYLE = "virtual" AWS_S3_ENDPOINT_URL = 'https://s3.eu-central-1.amazonaws.com' |
eu-west-1 | AWS_S3_SIGNATURE_VERSION = "s3v4" AWS_S3_ADDRESSING_STYLE = "virtual" |
eu-west-2 | AWS_S3_ADDRESSING_STYLE = "virtual" |
eu-west-3 | AWS_S3_ADDRESSING_STYLE = "virtual" |
ca-central-1 | AWS_S3_ADDRESSING_STYLE = "virtual" |
Based on a comment make sure you are up-to-date with the latest version of this package.
Spend 5 hours and this worked for me, @buddylindsey solution didn't worked for me AWS_DEFAULT_ACL = 'private' AWS_S3_SIGNATURE_VERSION = 's3v4'
@AchintyaRanjanChaudhary what region where you in and version of boto3? I found those settings, but the version of boto3 I had was already using s3v4
.
I had this issue with a bucket in
us-east-2
. Without going into the last 2 hours of archeology of boto3 issues and storages code. I solved it by setting the following in my settings.py.AWS_S3_ADDRESSING_STYLE = "virtual"
Your a life saver!!! Thanks.
@buddylindsey boto version --> boto3==1.13.13 AWS region -->ap-northeast-1 django-storage --> django-storages==1.9.1
So it looks like so far | Region | Setting |
---|---|---|
us-east-1 | default or AWS_S3_SIGNATURE_VERSION = "s3v4" |
|
us-east-2 | AWS_S3_ADDRESSING_STYLE = "virtual" |
|
ap-northeast-1 | AWS_S3_SIGNATURE_VERSION = "s3v4" |
|
eu-central-1 | AWS_S3_ADDRESSING_STYLE = "virtual" |
|
eu-west-2 | AWS_S3_ADDRESSING_STYLE = "virtual" |
|
eu-west-3 | AWS_S3_ADDRESSING_STYLE = "virtual" |
If we get more variations from people or other regions I can update this table.
I had this issue with a bucket in
us-east-2
. Without going into the last 2 hours of archeology of boto3 issues and storages code. I solved it by setting the following in my settings.py.AWS_S3_ADDRESSING_STYLE = "virtual"
I love you.
getting this error again and again..none of the above worked..but observed that url of file from website does not contain "Amz-Security-Token" field..how to resolve that?
AWS_S3_ADDRESSING_STYLE = "virtual"
also works for eu-central-1
I had this issue with a bucket in
us-east-2
. Without going into the last 2 hours of archeology of boto3 issues and storages code. I solved it by setting the following in my settings.py.AWS_S3_ADDRESSING_STYLE = "virtual"
Dude! This Totally worked thanks.
AWS_S3_ADDRESSING_STYLE = "virtual"
Also works for eu-west-3
Added a new, identical setting bucket in region us-east-2
for use in dev only, and had to add
AWS_S3_ADDRESSING_STYLE = "virtual"
thanks @buddylindsey
1st bucket worked without it, but also works with it. 🤷🏻♂️
The first bucket didn't work until I added AWS_S3_SIGNATURE_VERSION = "s3v4"
,
but the new one works with or without it.
Not sure if the 1st still needs AWS_S3_SIGNATURE_VERSION
too, but I'm leaving it for now.
Is it django-storages causing all these inconsistencies or AWS?
First of all thank you. This answers really helped.
Second:
I have a bucket at us-east-1
and the default didn't work neither the WS_S3_ADDRESSING_STYLE = "virtual"
. What it worked was AWS_S3_SIGNATURE_VERSION = "s3v4"
I had this issue with a bucket in
us-east-2
. Without going into the last 2 hours of archeology of boto3 issues and storages code. I solved it by setting the following in my settings.py.AWS_S3_ADDRESSING_STYLE = "virtual"
Dude i love you tks !!!
@buddylindsey Thanks alot
AWS_S3_ADDRESSING_STYLE = "virtual"
worked for us-east-2
AWS_S3_ADDRESSING_STYLE = "virtual"
worked for eu-west-2
. Thank you! ♥️
Many thanks for this info. This saved me another hour of searching through code
AWS_S3_ADDRESSING_STYLE = "virtual" worked for eu-west-2. Thank You..
AWS_S3_ADDRESSING_STYLE = "virtual"
Works for ap-southeast-2. Thank you!
I tried all of these solutions for the correct timezones and for some reason it's still not working 🤦♂️ I've triple checked my keys and tried both:
AWS_S3_ADDRESSING_STYLE = "virtual"
and
AWS_S3_SIGNATURE_VERSION = "s3v4"
one at a time and even at the same time.
I made a new bucket under us-east-1 just because that's what was shown in other answers and it still didn't work with either settings.
This works for the region - ap-south-1
AWS_S3_ADDRESSING_STYLE = "virtual"
So it looks like so far Region Setting us-east-1 default or
AWS_S3_SIGNATURE_VERSION = "s3v4"
us-east-2AWS_S3_ADDRESSING_STYLE = "virtual"
ap-northeast-1AWS_S3_SIGNATURE_VERSION = "s3v4"
eu-central-1AWS_S3_ADDRESSING_STYLE = "virtual"
eu-west-2AWS_S3_ADDRESSING_STYLE = "virtual"
eu-west-3AWS_S3_ADDRESSING_STYLE = "virtual"
If we get more variations from people or other regions I can update this table.
"virtual" setting works for ca-central-1
as well.
While troubleshooting student projects I have found that this is caused by there being a /
in the secret access key. I didn't know about these settings but generating new credentials without the /
would solve it.
This also works for eu-west-1
:
AWS_S3_SIGNATURE_VERSION = "s3v4"
AWS_S3_ADDRESSING_STYLE = "virtual"
None of these worked for me. us-east-2
Edit: Updating from storages 1.9 to 1.13.1 fixed this error
I had this issue with a bucket in
us-east-2
. Without going into the last 2 hours of archeology of boto3 issues and storages code. I solved it by setting the following in my settings.py.AWS_S3_ADDRESSING_STYLE = "virtual"
I am moving this chart up from below to help give more visibility to it.
Region Setting us-east-1 default or
AWS_S3_SIGNATURE_VERSION = "s3v4"
us-east-2AWS_S3_ADDRESSING_STYLE = "virtual"
ap-northeast-1AWS_S3_SIGNATURE_VERSION = "s3v4"
ap-southeast-2AWS_S3_ADDRESSING_STYLE = "virtual"
ap-south-1AWS_S3_ADDRESSING_STYLE = "virtual"
eu-central-1AWS_S3_ADDRESSING_STYLE = "virtual"
eu-central-1AWS_S3_ADDRESSING_STYLE = "virtual"
AWS_S3_ENDPOINT_URL = 'https://s3.eu-central-1.amazonaws.com'
eu-west-1AWS_S3_SIGNATURE_VERSION = "s3v4"
AWS_S3_ADDRESSING_STYLE = "virtual"
eu-west-2AWS_S3_ADDRESSING_STYLE = "virtual"
eu-west-3AWS_S3_ADDRESSING_STYLE = "virtual"
ca-central-1AWS_S3_ADDRESSING_STYLE = "virtual"
Based on a comment make sure you are up-to-date with the latest version of this package.
For eu-central-1 you need both settings as they are. Cheers buddy! You got a beer from me.
For eu-central-1
I needed to set 3 mentioned before variables:
AWS_S3_ADDRESSING_STYLE = "virtual"
AWS_S3_ENDPOINT_URL = 'https://s3.eu-central-1.amazonaws.com'
AWS_S3_ADDRESSING_STYLE = "virtual"
and also 1 additional:
AWS_S3_REGION_NAME = 'eu-central-1'
Ran into this issue today and found both combinations work (for a public bucket)
AWS_S3_REGION_NAME = 'us-east-2'
AWS_S3_ENDPOINT_URL = f'https://s3.{AWS_S3_REGION_NAME}.amazonaws.com'
or
AWS_S3_REGION_NAME = 'us-east-2'
AWS_S3_ADDRESSING_STYLE = 'path'
along with my AWS_STORAGE_BUCKET_NAME
Thank you @Jackevansevo, I tried AWS_S3_ADDRESSING_STYLE = 'virtual'
and I still would get the SignatureDoesNotMatch error but it works with AWS_S3_ADDRESSING_STYLE = 'path'
, my bucket is hosted in eu-west-3
.
It has the effect of changing the url from
https://{bucket_name}.s3.{region_name}.amazonaws.com
to
https://s3.{region_name}.amazonaws.com/{bucket_name}
If someone can tell me why this works and not the first url I would gladly appreciate. EDIT: I waited one night and now both addressing style works, I literally spent all yesterday afternoon debugging this. RIP
Hi guys, I uploaded my application to Vercel and it started pointing out this error. However, when running the local application or in an EC2 instance, it generates another url with less information and I can access the file without problems.
Anyone else going through this that has resolved it? My Region: us-east-1 My settings AWS_S3_ACCESS_KEY_ID = os.environ.get("AWS_S3_ACCESS_KEY_ID") AWS_S3_SECRET_ACCESS_KEY = os.environ.get("AWS_S3_SECRET_ACCESS_KEY") AWS_STORAGE_BUCKET_NAME = os.environ.get("AWS_STORAGE_BUCKET_NAME") AWS_S3_CUSTOM_DOMAIN = os.environ.get("AWS_S3_CUSTOM_DOMAIN") AWS_STORAGE_PRIVATE_BUCKET_NAME = os.environ.get("AWS_STORAGE_PRIVATE_BUCKET_NAME") AWS_DEFAULT_ACL = None AWS_S3_SIGNATURE_VERSION = "s3v4"
AWS_S3_ADDRESSING_STYLE = "virtual"
This also worked for me. thanks
AWS_S3_ADDRESSING_STYLE = "virtual"
Thank you this works for me
Keep getting this error when i try to retrieve the saved image via url. Kindly help