Skip to content

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

Description

@rromanchuk
# 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions