Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The parameter MetricData.member.12.Dimensions.member.1.Value is required. (Aws::CloudWatch::Errors::MissingParameter) #43

Open
taimoordev opened this issue Nov 2, 2023 · 2 comments

Comments

@taimoordev
Copy link

Hey @sj26
I have following gems
sidekiq-cloudwatchmetrics (2.6.0)
sidekiq (7.2.0, 7.0.7, 6.4.2)
aws-sdk-cloudwatch (1.81.0, 1.67.0)

and I get the following error on the CloudWatch console.

53
2023-11-01T16:36:01.871-07:00
#<Thread:0x00007f5f4f1d1b30@cloudwatch metrics publisher /usr/local/bundle/gems/sidekiq-6.4.2/lib/sidekiq/util.rb:63 run> terminated with exception (report_on_exception is true):
54
2023-11-01T16:36:01.871-07:00
/usr/local/bundle/gems/aws-sdk-core-3.131.1/lib/seahorse/client/plugins/raise_response_errors.rb:17:in `call': The parameter MetricData.member.12.Dimensions.member.1.Value is required. (Aws::CloudWatch::Errors::MissingParameter)
55
2023-11-01T16:36:01.871-07:00
from /usr/local/bundle/gems/aws-sdk-core-3.131.1/lib/aws-sdk-core/plugins/checksum_algorithm.rb:111:in `call'
56
2023-11-01T16:36:01.871-07:00
from /usr/local/bundle/gems/aws-sdk-core-3.131.1/lib/aws-sdk-core/plugins/jsonvalue_converter.rb:22:in `call'
57
2023-11-01T16:36:01.871-07:00
from /usr/local/bundle/gems/aws-sdk-core-3.131.1/lib/aws-sdk-core/plugins/idempotency_token.rb:19:in `call'
58
2023-11-01T16:36:01.871-07:00
from /usr/local/bundle/gems/aws-sdk-core-3.131.1/lib/aws-sdk-core/plugins/param_converter.rb:26:in `call'
59
2023-11-01T16:36:01.871-07:00
from /usr/local/bundle/gems/aws-sdk-core-3.131.1/lib/seahorse/client/plugins/request_callback.rb:71:in `call'
60
2023-11-01T16:36:01.871-07:00
from /usr/local/bundle/gems/aws-sdk-core-3.131.1/lib/aws-sdk-core/plugins/response_paging.rb:12:in `call'
61
2023-11-01T16:36:01.871-07:00
from /usr/local/bundle/gems/aws-sdk-core-3.131.1/lib/seahorse/client/plugins/response_target.rb:24:in `call'
62
2023-11-01T16:36:01.871-07:00
from /usr/local/bundle/gems/aws-sdk-core-3.131.1/lib/seahorse/client/request.rb:72:in `send_request'
63
2023-11-01T16:36:01.871-07:00
from /usr/local/bundle/gems/aws-sdk-cloudwatch-1.67.0/lib/aws-sdk-cloudwatch/client.rb:3365:in `put_metric_data'
64
2023-11-01T16:36:01.871-07:00
from /usr/local/bundle/gems/sidekiq-cloudwatchmetrics-2.6.0/lib/sidekiq/cloudwatchmetrics.rb:235:in `block in publish'
65
2023-11-01T16:36:01.871-07:00
from /usr/local/bundle/gems/sidekiq-cloudwatchmetrics-2.6.0/lib/sidekiq/cloudwatchmetrics.rb:234:in `each'
66
2023-11-01T16:36:01.871-07:00
from /usr/local/bundle/gems/sidekiq-cloudwatchmetrics-2.6.0/lib/sidekiq/cloudwatchmetrics.rb:234:in `each_slice'
67
2023-11-01T16:36:01.871-07:00
from /usr/local/bundle/gems/sidekiq-cloudwatchmetrics-2.6.0/lib/sidekiq/cloudwatchmetrics.rb:234:in `publish'
68
2023-11-01T16:36:01.871-07:00
from /usr/local/bundle/gems/sidekiq-cloudwatchmetrics-2.6.0/lib/sidekiq/cloudwatchmetrics.rb:77:in `run'
69
2023-11-01T16:36:01.871-07:00
from /usr/local/bundle/gems/sidekiq-6.4.2/lib/sidekiq/util.rb:56:in `watchdog'
70
2023-11-01T16:36:01.871-07:00
from /usr/local/bundle/gems/sidekiq-6.4.2/lib/sidekiq/util.rb:65:in `block in safe_thread'
image
@taimoordev
Copy link
Author

taimoordev commented Nov 2, 2023

@sj26 I suspect that these loops don't have guard statement, and these might be sending dimension value as nil
The parameter MetricData.member.12.Dimensions.member.1.Value is required. (Aws::CloudWatch::Errors::MissingParameter)
image

according to aws-sdk-cloudwatch doc, dimenstion is optional but for objects inside it, value and name must be present
official doc reference
image

@taimoordev
Copy link
Author

@sj26 I found out the issue lies here
image

!!'' == true as empty string evaluates to true, that is why this dimension object contains blank value in it for tag.

Solution
add unless process['tag'].empty? check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant