Getting "S3 Transfer Acceleration is not configured on this bucket" error when using django-storages

809 Views Asked by At

In a Django project that uses django-storages and is configured with AWS credentials, I am getting the following error when uploading a file (i.e. saving a model that has a models.FileField field)

An error occurred (InvalidRequest) when calling the PutObject operation: S3 Transfer Acceleration is not configured on this bucket

I triple-checked the AWS credentials -- they even work on another computer with the same codebase, but not on my machine. (I provide the solution below)

1

There are 1 best solutions below

0
Greg Sadetsky On

The problem was happening because my ~/.aws/config global AWS/boto3 configuration file had:

[default]
s3 =
    use_accelerate_endpoint = true

This, in turn, was read by the boto3 library (see this page and search for "use_accelerate_endpoint") which then tried to use the accelerated endpoint on an S3 bucket which did not have an accelerated endpoint enabled.