0

I am trying to set up existing rails 3.2.11 project in production environment.

We have used asset_sync gem for syncing assets in s3. But when I ran the precompile command I am getting Expected(200) <=> Actual(400 Bad Request) error. As per the documentation I have added required configuration in the file (application.yml file).

production:
  FOG_DIRECTORY: xxxxxx
  FOG_PROVIDER: xxxxxx
  FOG_REGION: xxxxxx
  ASYNC_UPLOAD_BUCKET: xxxxxx
  AWS_ACCESS_KEY_ID: xxxxxx
  AWS_BUCKET: xxxxxx
  AWS_SECRET_ACCESS_KEY: xxxxxx

As per the doc created separate initializer file (config/initializers/asset_sync.rb)

AssetSync.configure do |config|
  config.fog_provider = 'AWS'
  config.aws_access_key_id = ENV['AWS_ACCESS_KEY_ID']
  config.aws_secret_access_key = ENV['AWS_SECRET_ACCESS_KEY']
  config.fog_directory = ENV['FOG_DIRECTORY']
  config.fog_region = ENV['FOG_REGION']
end

When I checked the response for the compilation it is showing message

<Message>The authorization mechanism you have provided is not supported. Please use AWS4-HMAC-SHA256.</Message>  

Can any one let me know how can I fix this issue.

I-am-simple-user
  • 409
  • 7
  • 19
  • Are you using the yegor256/s3auth auth gateway by any chance? – Sebastián Palma Jun 25 '17 at 06:52
  • How can I check the auth getway. Also I haven't configured any getway. – I-am-simple-user Jun 25 '17 at 06:53
  • I wonder if it is a good idea to deploy a Rails 3.2.11 app to production? That version is more than 4 years old, unmaintained and has known security issues. The issue you face is probably related to having a version of the `aws` gem in your `Gemfile` that is too old too: https://stackoverflow.com/questions/26533245/the-authorization-mechanism-you-have-provided-is-not-supported-please-use-aws4 – spickermann Jun 25 '17 at 07:29
  • @spickermann I tired by passing signatureVersion but getting the same issue. I tired this way `Aws.config.update(signatureVersion: 'v4')` Is there any other suggestion. – I-am-simple-user Jun 25 '17 at 08:08

0 Answers0