Skip to content

<Assume_role_credentials> throw MissingCredentialsError #246

Open
@purva1192

Description

@purva1192

I am running fluentd in a Kubernetes cluster. When configuring the s3_out plugin, instead of providing the access_key and the secret_key, I used the <assume_role_credentials>. My s3 configuration looks like this -

<match s3.logs>
  @type s3
  @log_level debug
  <assume_role_credentials>
    role_arn arn:aws:iam::1111111111111:role/fluentd-test-role
    role_session_name Admin
  </assume_role_credentials>
  s3_bucket "sumo-log"
  s3_region "us-west-2"
  path logs/
  time_slice_format %Y%m%d%H%M
  utc
  auto_create_bucket true
</match>

However, I get the following error

2018-10-12 18:50:25 +0000 [info]: #0 starting fluentd worker pid=30 ppid=1 worker=0
2018-10-12 18:50:25 +0000 [error]: #0 unexpected error error_class=Aws::Errors::MissingCredentialsError error="unable to sign request without credentials set"
  2018-10-12 18:50:25 +0000 [error]: #0 /var/lib/gems/2.3.0/gems/aws-sdk-core-3.30.0/lib/aws-sdk-core/plugins/signature_v4.rb:72:in `sign_request'
  2018-10-12 18:50:25 +0000 [error]: #0 /var/lib/gems/2.3.0/gems/aws-sdk-core-3.30.0/lib/aws-sdk-core/plugins/signature_v4.rb:112:in `apply_signature'
  2018-10-12 18:50:25 +0000 [error]: #0 /var/lib/gems/2.3.0/gems/aws-sdk-core-3.30.0/lib/aws-sdk-core/plugins/signature_v4.rb:65:in `call'
  2018-10-12 18:50:25 +0000 [error]: #0 /var/lib/gems/2.3.0/gems/aws-sdk-core-3.30.0/lib/aws-sdk-core/plugins/helpful_socket_errors.rb:10:in `call'
  2018-10-12 18:50:25 +0000 [error]: #0 /var/lib/gems/2.3.0/gems/aws-sdk-core-3.30.0/lib/aws-sdk-core/plugins/retry_errors.rb:138:in `call'
  2018-10-12 18:50:25 +0000 [error]: #0 /var/lib/gems/2.3.0/gems/aws-sdk-core-3.30.0/lib/aws-sdk-core/query/handler.rb:28:in `call'
  2018-10-12 18:50:25 +0000 [error]: #0 /var/lib/gems/2.3.0/gems/aws-sdk-core-3.30.0/lib/aws-sdk-core/plugins/user_agent.rb:13:in `call'
  2018-10-12 18:50:25 +0000 [error]: #0 /var/lib/gems/2.3.0/gems/aws-sdk-core-3.30.0/lib/seahorse/client/plugins/endpoint.rb:45:in `call'
  2018-10-12 18:50:25 +0000 [error]: #0 /var/lib/gems/2.3.0/gems/aws-sdk-core-3.30.0/lib/aws-sdk-core/plugins/param_validator.rb:24:in `call'
  2018-10-12 18:50:25 +0000 [error]: #0 /var/lib/gems/2.3.0/gems/aws-sdk-core-3.30.0/lib/seahorse/client/plugins/raise_response_errors.rb:14:in `call'
  2018-10-12 18:50:25 +0000 [error]: #0 /var/lib/gems/2.3.0/gems/aws-sdk-core-3.30.0/lib/aws-sdk-core/plugins/jsonvalue_converter.rb:20:in `call'
  2018-10-12 18:50:25 +0000 [error]: #0 /var/lib/gems/2.3.0/gems/aws-sdk-core-3.30.0/lib/aws-sdk-core/plugins/idempotency_token.rb:17:in `call'
  2018-10-12 18:50:25 +0000 [error]: #0 /var/lib/gems/2.3.0/gems/aws-sdk-core-3.30.0/lib/aws-sdk-core/plugins/param_converter.rb:24:in `call'
  2018-10-12 18:50:25 +0000 [error]: #0 /var/lib/gems/2.3.0/gems/aws-sdk-core-3.30.0/lib/aws-sdk-core/plugins/response_paging.rb:10:in `call'
  2018-10-12 18:50:25 +0000 [error]: #0 /var/lib/gems/2.3.0/gems/aws-sdk-core-3.30.0/lib/seahorse/client/plugins/response_target.rb:23:in `call'
  2018-10-12 18:50:25 +0000 [error]: #0 /var/lib/gems/2.3.0/gems/aws-sdk-core-3.30.0/lib/seahorse/client/request.rb:70:in `send_request'
  2018-10-12 18:50:25 +0000 [error]: #0 /var/lib/gems/2.3.0/gems/aws-sdk-core-3.30.0/lib/aws-sdk-sts/client.rb:486:in `assume_role'
  2018-10-12 18:50:25 +0000 [error]: #0 /var/lib/gems/2.3.0/gems/aws-sdk-core-3.30.0/lib/aws-sdk-core/assume_role_credentials.rb:49:in `refresh'
  2018-10-12 18:50:25 +0000 [error]: #0 /var/lib/gems/2.3.0/gems/aws-sdk-core-3.30.0/lib/aws-sdk-core/refreshing_credentials.rb:20:in `initialize'
  2018-10-12 18:50:25 +0000 [error]: #0 /var/lib/gems/2.3.0/gems/aws-sdk-core-3.30.0/lib/aws-sdk-core/assume_role_credentials.rb:40:in `initialize'
  2018-10-12 18:50:25 +0000 [error]: #0 /var/lib/gems/2.3.0/gems/fluent-plugin-s3-1.1.4/lib/fluent/plugin/out_s3.rb:426:in `new'
  2018-10-12 18:50:25 +0000 [error]: #0 /var/lib/gems/2.3.0/gems/fluent-plugin-s3-1.1.4/lib/fluent/plugin/out_s3.rb:426:in `setup_credentials'
  2018-10-12 18:50:25 +0000 [error]: #0 /var/lib/gems/2.3.0/gems/fluent-plugin-s3-1.1.4/lib/fluent/plugin/out_s3.rb:198:in `start'
  2018-10-12 18:50:25 +0000 [error]: #0 /var/lib/gems/2.3.0/gems/fluentd-1.1.3/lib/fluent/root_agent.rb:165:in `block in start'
  2018-10-12 18:50:25 +0000 [error]: #0 /var/lib/gems/2.3.0/gems/fluentd-1.1.3/lib/fluent/root_agent.rb:154:in `block (2 levels) in lifecycle'
  2018-10-12 18:50:25 +0000 [error]: #0 /var/lib/gems/2.3.0/gems/fluentd-1.1.3/lib/fluent/root_agent.rb:153:in `each'
  2018-10-12 18:50:25 +0000 [error]: #0 /var/lib/gems/2.3.0/gems/fluentd-1.1.3/lib/fluent/root_agent.rb:153:in `block in lifecycle'
  2018-10-12 18:50:25 +0000 [error]: #0 /var/lib/gems/2.3.0/gems/fluentd-1.1.3/lib/fluent/root_agent.rb:140:in `each'
  2018-10-12 18:50:25 +0000 [error]: #0 /var/lib/gems/2.3.0/gems/fluentd-1.1.3/lib/fluent/root_agent.rb:140:in `lifecycle'
  2018-10-12 18:50:25 +0000 [error]: #0 /var/lib/gems/2.3.0/gems/fluentd-1.1.3/lib/fluent/root_agent.rb:164:in `start'
  2018-10-12 18:50:25 +0000 [error]: #0 /var/lib/gems/2.3.0/gems/fluentd-1.1.3/lib/fluent/engine.rb:274:in `start'
  2018-10-12 18:50:25 +0000 [error]: #0 /var/lib/gems/2.3.0/gems/fluentd-1.1.3/lib/fluent/engine.rb:219:in `run'
  2018-10-12 18:50:25 +0000 [error]: #0 /var/lib/gems/2.3.0/gems/fluentd-1.1.3/lib/fluent/supervisor.rb:774:in `run_engine'
  2018-10-12 18:50:25 +0000 [error]: #0 /var/lib/gems/2.3.0/gems/fluentd-1.1.3/lib/fluent/supervisor.rb:523:in `block in run_worker'
  2018-10-12 18:50:25 +0000 [error]: #0 /var/lib/gems/2.3.0/gems/fluentd-1.1.3/lib/fluent/supervisor.rb:699:in `main_process'
  2018-10-12 18:50:25 +0000 [error]: #0 /var/lib/gems/2.3.0/gems/fluentd-1.1.3/lib/fluent/supervisor.rb:518:in `run_worker'
  2018-10-12 18:50:25 +0000 [error]: #0 /var/lib/gems/2.3.0/gems/fluentd-1.1.3/lib/fluent/command/fluentd.rb:316:in `<top (required)>'
  2018-10-12 18:50:25 +0000 [error]: #0 /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
  2018-10-12 18:50:25 +0000 [error]: #0 /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
  2018-10-12 18:50:25 +0000 [error]: #0 /var/lib/gems/2.3.0/gems/fluentd-1.1.3/bin/fluentd:8:in `<top (required)>'
  2018-10-12 18:50:25 +0000 [error]: #0 /usr/local/bin/fluentd:22:in `load'
  2018-10-12 18:50:25 +0000 [error]: #0 /usr/local/bin/fluentd:22:in `<main>'
2018-10-12 18:50:25 +0000 [error]: #0 unexpected error error_class=Aws::Errors::MissingCredentialsError error="unable to sign request without credentials set"
  2018-10-12 18:50:25 +0000 [error]: #0 suppressed same stacktrace
2018-10-12 18:50:25 +0000 [info]: Worker 0 finished unexpectedly with status 1

I should be able to access AWS without providing the access key and secret key.

Can anybody provide more details about it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions