Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The bucket you are attempting to access must be addressed using the specified endpoint

I'm using paperclip 5.0.0.beta2 in my latest rails (4.2.6) project. The application is hosted on Heroku. I can upload an image and it seems to be stored in a bucket on Amazon S3. However in the browser the image appears to have a broken url, although it's point to the bucket on Amazon S3, the url is:

http://s3.amazonaws.com/gigbnb/profiles/profile_pics/000/000/002/small/anthony_candaele-300x300.jpg?1464956858

When I enter this url in the browser, I get an xml page with this error message:

The bucket you are attempting to access must be addressed using the     specified endpoint. Please send all future requests to this endpoint.

It looks like there is an issue with the S3 endpoint.

However I set the region (eu-west-1) in configuration file:

config/environments/production.rb


config.paperclip_defaults = {
   storage: :s3,
   s3_region: ENV.fetch('AWS_REGION'),
   s3_credentials: {
     bucket: ENV.fetch('S3_BUCKET_NAME'),
     access_key_id: ENV.fetch('AWS_ACCESS_KEY_ID'),
     secret_access_key: ENV.fetch('AWS_SECRET_ACCESS_KEY'),
   }
}

My Github repository is at:

https://github.com/acandael/gigbnb

Does anyone have an idea what's going on?

Thanks for your help,

Anthony

like image 563
Toontje Avatar asked Oct 18 '22 07:10

Toontje


1 Answers

this is a workaround that fixed the issue for me. It's presented by aminariana

like image 95
Toontje Avatar answered Oct 21 '22 06:10

Toontje