aws / aws/aws-xray-sdk-ruby

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

Open
#71 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Ruby
Stars
60
Forks
54
PR merge metrics
No merged PRs in 30d

Description

```ruby
# 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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.