Git Product home page Git Product logo

Comments (2)

flanger001 avatar flanger001 commented on May 29, 2024 1

Apologies for posting on an old thread, but I was running into the same issue. This error is easier to debug if you can figure out what URL you're actually generating. In my case it was of the form https://[BUCKET_NAME].s3-[REGION].amazonaws.com/, so I just manually browsed to that URL and got a very helpful response:

<Error>
  <Code>PermanentRedirect</Code>
  <Message>
    The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint.
  </Message>
  <Bucket>[BUCKET_NAME]</Bucket>
  <Endpoint>s3.amazonaws.com</Endpoint> <!-- this is the correct endpoint -->
  <!-- extra stuff omitted -->
</Error>

It was because I was using the wrong REGION. I used this chart to figure out what region I should be using based on that endpoint, and everything started working again: http://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region

Here's my config/initializers/carrierwave.rb file for the interested, it's about as minimal a config as you can get:

CarrierWave.configure do |config|
  config.storage = :aws
  config.aws_bucket = ENV['AWS_BUCKET_NAME']
  config.aws_acl = ENV['AWS_BUCKET_ACL']

  config.aws_attributes = {
    cache_control: "max-age=#{365.day.to_i}",
  }

  config.aws_credentials = {
    access_key_id: ENV['AWS_ACCESS_KEY_ID'],
    secret_access_key: ENV['AWS_SECRET_ACCESS_KEY'],
    region: ENV['AWS_BUCKET_REGION'],
  }

  config.cache_dir = "#{Rails.root}/tmp/uploads"
end

from carrierwave-aws.

sorentwo avatar sorentwo commented on May 29, 2024

I took a look at your question on stack overflow and answered there, but I'll duplicate it here as well.

It looks like you have set up an incorrect asset host. Remove that configuration and see if that clears up the problem.

from carrierwave-aws.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.