Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic setup implodes on pg connection with RDS + IAM (ec2 instance profile) #71

Open
rromanchuk opened this issue May 21, 2021 · 0 comments

Comments

@rromanchuk
Copy link

# config/initializers/aws-xray.rb
Rails.application.config.xray = {
  name: 'Foo',
  patch: %I[net_http aws_sdk]
}

# Gemfile
gem 'aws-xray-sdk', require: ['aws-xray-sdk/facets/rails/railtie']

If i trigger a database connection, or load console and fetch from AR, the following fatal is thrown

AWS_REGION=us-east-1 bin/rails db:migrate --trace

** Invoke db:migrate (first_time)
** Invoke db:load_config (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:load_config
** Execute db:migrate
rails aborted!
Aws::Sigv4::Errors::MissingCredentialsError: missing credentials, provide credentials with one of the following options:

  • :access_key_id and :secret_access_key
  • :credentials
  • :credentials_provider
    /home/ubuntu/vendor/ruby/3.0.0/gems/aws-sigv4-1.2.3/lib/aws-sigv4/signer.rb:621:in `extract_credentials_provider'

If i rm config/initializers/aws-xray.rb the issue is gone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant