lukewaite / logstash-input-cloudwatch-logs

Input plugin for Logstash to stream events from CloudWatch Logs
Other
142 stars 74 forks source link

Error: The request signature we calculated does not match the signature you provided #49

Closed jkopacze closed 6 years ago

jkopacze commented 6 years ago

For some reason I cannot authenticate using inline access_key_id and secret_access_key and get error like below:

[2018-04-30T11:39:36,964][ERROR][logstash.pipeline ] A plugin had an unrecoverable error. Will restart this plugin. Pipeline_id:main Plugin: <LogStash::Inputs::CloudWatch_Logs log_group=>["/aws/lambda/xxxxxxxxx"], log_group_prefix=>true, access_key_id=>"Axxxx", secret_access_key=><password>, region=>"us-east-1", type=>"lambda", id=>"3a9eca949288562397c794252c12cf269461c5c5286f0af4a007fe352ce8ea78", enable_metric=>true, codec=><LogStash::Codecs::Plain id=>"plain_47402051-7611-4745-9383-8098c39648c1", enable_metric=>true, charset=>"UTF-8">, role_session_name=>"logstash", interval=>60, start_position=>"beginning"> Error: The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details. Exception: Aws::CloudWatchLogs::Errors::InvalidSignatureException Stack: /usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/aws-sdk-core-2.11.32/lib/seahorse/client/plugins/raise_response_errors.rb:15:incall' /usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/aws-sdk-core-2.11.32/lib/aws-sdk-core/plugins/jsonvalue_converter.rb:20:in call' /usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/aws-sdk-core-2.11.32/lib/aws-sdk-core/plugins/idempotency_token.rb:18:incall' /usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/aws-sdk-core-2.11.32/lib/aws-sdk-core/plugins/param_converter.rb:20:in call' /usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/aws-sdk-core-2.11.32/lib/aws-sdk-core/plugins/response_paging.rb:26:incall' /usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/aws-sdk-core-2.11.32/lib/seahorse/client/plugins/response_target.rb:21:in call' /usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/aws-sdk-core-2.11.32/lib/seahorse/client/request.rb:70:insend_request' /usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/aws-sdk-core-2.11.32/lib/seahorse/client/base.rb:207:in block in describe_log_groups' /usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-input-cloudwatch_logs-1.0.2/lib/logstash/inputs/cloudwatch_logs.rb:141:inblock in find_log_groups' org/jruby/RubyKernel.java:1292:in loop' /usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-input-cloudwatch_logs-1.0.2/lib/logstash/inputs/cloudwatch_logs.rb:140:inblock in find_log_groups' org/jruby/RubyArray.java:1734:in each' /usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-input-cloudwatch_logs-1.0.2/lib/logstash/inputs/cloudwatch_logs.rb:139:infind_log_groups' /usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-input-cloudwatch_logs-1.0.2/lib/logstash/inputs/cloudwatch_logs.rb:115:in run' /usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:514:ininputworker' `

My input conf: cloudwatch_logs { log_group => "/aws/lambda/xxxx" log_group_prefix => "true" access_key_id => "A....." secret_access_key => "Sxxxxxx...." region => "us-east-1" type => "lambda" } Any ideas ?

lukewaite commented 6 years ago

Double check your key/secret. I believe errors in those (possible extra whitespace, or missing characters) are the usual culprit for this error.

Not 100% sure, but possibly the date being very off on your host machine could cause this as well.

jkopacze commented 6 years ago

Right, so obvious. Of course it fixed the error ;) Thanks Luke!

lukewaite commented 6 years ago

Happy to help!