Open maggieghamry opened 5 years ago
@maggieghamry I know its too long ago. But recently I too ran into the same issue. Were you able to resolve this back then?
I have the same issue :( I see similar questions in multiple sites, but still no replies. Kindly provide a solution for this. In my case i got the same lines as mentioned above. but at the beginning of the logs it says invalid token. But the creds i use are admin role based one and i am sure that should have access.
[2021-07-27T06:38:52,836][INFO ][logstash.inputs.cloudwatch][main][5772a169ac916ad4268acd37974e918d32c63cd2e05f01891d870ce64c6dc698] Polling CloudWatch API
[2021-07-27T06:38:52,877][INFO ][logstash.agent ] Pipelines running {:count=>1, :running_pipelines=>[:main], :non_running_pipelines=>[]}
Version 2 of the Ruby SDK will enter maintenance mode as of November 20, 2020. To continue receiving service updates and new features, please upgrade to Version 3. More information can be found here: https://aws.amazon.com/blogs/developer/deprecation-schedule-for-aws-sdk-for-ruby-v2/
[2021-07-27T06:38:57,796][INFO ][logstash.inputs.cloudwatch][main][5772a169ac916ad4268acd37974e918d32c63cd2e05f01891d870ce64c6dc698] [Aws::CloudWatch::Client 403 2.13857 0 retries] list_metrics(namespace:"AWS/EC2") Aws::CloudWatch::Errors::InvalidClientTokenId The security token included in the request is invalid.
[2021-07-27T06:38:57,812][ERROR][logstash.javapipeline ][main][5772a169ac916ad4268acd37974e918d32c63cd2e05f01891d870ce64c6dc698] A plugin had an unrecoverable error. Will restart this plugin.
Pipeline_id:main
Plugin: <LogStash::Inputs::CloudWatch access_key_id=>"ASIAYFEUE3R3SPB6LSGU", namespace=>"AWS/EC2", secret_access_key=><password>, metrics=>["CPUUtilization"], id=>"5772a169ac916ad4268acd37974e918d32c63cd2e05f01891d870ce64c6dc698", region=>"us-east-2", enable_metric=>true, codec=><LogStash::Codecs::Plain id=>"plain_47a35d02-6648-4235-8a02-455ff0135ccb", enable_metric=>true, charset=>"UTF-8">, role_session_name=>"logstash", statistics=>["SampleCount", "Average", "Minimum", "Maximum", "Sum"], interval=>900, period=>300, combined=>false>
Error: The security token included in the request is invalid.
Exception: Aws::CloudWatch::Errors::InvalidClientTokenId
Stack: /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/aws-sdk-core-2.11.632/lib/seahorse/client/plugins/raise_response_errors.rb:15:in `call'
/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/aws-sdk-core-2.11.632/lib/aws-sdk-core/plugins/jsonvalue_converter.rb:20:in `call'
.....
......
/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-cloudwatch-2.2.4/lib/logstash/inputs/cloudwatch.rb:270:in `block in metrics_available'
org/jruby/RubyHash.java:765:in `default'
org/jruby/RubyHash.java:1170:in `[]'
/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-cloudwatch-2.2.4/lib/logstash/inputs/cloudwatch.rb:260:in `metrics_for'
/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-cloudwatch-2.2.4/lib/logstash/inputs/cloudwatch.rb:154:in `run'
/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:405:in `inputworker'
/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:396:in `block in start_input'
[2021-07-27T06:38:58,840][INFO ][logstash.inputs.cloudwatch][main][5772a169ac916ad4268acd37974e918d32c63cd2e05f01891d870ce64c6dc698] Polling CloudWatch API
[2021-07-27T06:38:58,846][ERROR][logstash.javapipeline ][main][5772a169ac916ad4268acd37974e918d32c63cd2e05f01891d870ce64c6dc698] A plugin had an unrecoverable error. Will restart this plugin.
Pipeline_id:main
Plugin: <LogStash::Inputs::CloudWatch access_key_id=>"ASIAYFEUE3R3SPB6LSGU", namespace=>"AWS/EC2", secret_access_key=><password>, metrics=>["CPUUtilization"], id=>"5772a169ac916ad4268acd37974e918d32c63cd2e05f01891d870ce64c6dc698", region=>"us-east-2", enable_metric=>true, codec=><LogStash::Codecs::Plain id=>"plain_47a35d02-6648-4235-8a02-455ff0135ccb", enable_metric=>true, charset=>"UTF-8">, role_session_name=>"logstash", statistics=>["SampleCount", "Average", "Minimum", "Maximum", "Sum"], interval=>900, period=>300, combined=>false>
Error: No metrics to query
You may want to check further up your logs. In terms of @arjunkrishnasb you have the error further up, specifically. Error: The security token included in the request is invalid.
Version: 6.3.0
Steps to Reproduce: We are getting this error on cloudwatch input plugin. This appears to be related to an unresolved thread here: https://discuss.elastic.co/t/cloudwatch-input-plugin-no-metrics-to-query-error-in-6-3-0/137032
Can you please help identify if there is a specific issue related to the namespace or IAM profile in this instance There are some indications based on the discuss thread that this worked in 6.2.1. Not sure if this is a new bug?