boto3 caught_exception botocore.exceptions.EndpointConnectio
Posted: Mon May 20, 2019 5:47 am
Dear all,
we have just installed boto3 as requested by the AWS Wizard.
The Wizard itself works perfectly, we were able to pass the credentials and any information requested.
But we got some error even launching manually the command:
I tried to modify the Region to "eu-central-1" without "b" and I got this error:
Currently all the information looks correct!
Do you have any suggestion or workaround to avoid those errors?
we have just installed boto3 as requested by the AWS Wizard.
The Wizard itself works perfectly, we were able to pass the credentials and any information requested.
But we got some error even launching manually the command:
Code: Select all
sudo ./check_ec2.py -P 5 --metricname CPUCreditBalance --instanceid 'i-xxxxxxxx' --accesskeyid 'ACCESSKEY' --secretaccesskey 'SECRETYKEY' --region 'eu-central-1b' --warning '100:' --critical '25:'Code: Select all
Traceback (most recent call last):
File "./check_ec2.py", line 561, in <module>
main()
File "./check_ec2.py", line 460, in main
check_ec2(options.metricname, options.instanceid, options.period, statistics, options.accesskeyid, options.secretaccesskey, options.region)
File "./check_ec2.py", line 139, in check_ec2
Statistics=statistics
File "/usr/lib/python2.7/site-packages/botocore/client.py", line 357, in _api_call
return self._make_api_call(operation_name, kwargs)
File "/usr/lib/python2.7/site-packages/botocore/client.py", line 648, in _make_api_call
operation_model, request_dict, request_context)
File "/usr/lib/python2.7/site-packages/botocore/client.py", line 667, in _make_request
return self._endpoint.make_request(operation_model, request_dict)
File "/usr/lib/python2.7/site-packages/botocore/endpoint.py", line 102, in make_request
return self._send_request(request_dict, operation_model)
File "/usr/lib/python2.7/site-packages/botocore/endpoint.py", line 137, in _send_request
success_response, exception):
File "/usr/lib/python2.7/site-packages/botocore/endpoint.py", line 231, in _needs_retry
caught_exception=caught_exception, request_dict=request_dict)
File "/usr/lib/python2.7/site-packages/botocore/hooks.py", line 356, in emit
return self._emitter.emit(aliased_event_name, **kwargs)
File "/usr/lib/python2.7/site-packages/botocore/hooks.py", line 228, in emit
return self._emit(event_name, kwargs)
File "/usr/lib/python2.7/site-packages/botocore/hooks.py", line 211, in _emit
response = handler(**kwargs)
File "/usr/lib/python2.7/site-packages/botocore/retryhandler.py", line 183, in __call__
if self._checker(attempts, response, caught_exception):
File "/usr/lib/python2.7/site-packages/botocore/retryhandler.py", line 251, in __call__
caught_exception)
File "/usr/lib/python2.7/site-packages/botocore/retryhandler.py", line 277, in _should_retry
return self._checker(attempt_number, response, caught_exception)
File "/usr/lib/python2.7/site-packages/botocore/retryhandler.py", line 317, in __call__
caught_exception)
File "/usr/lib/python2.7/site-packages/botocore/retryhandler.py", line 223, in __call__
attempt_number, caught_exception)
File "/usr/lib/python2.7/site-packages/botocore/retryhandler.py", line 359, in _check_caught_exception
raise caught_exception
botocore.exceptions.EndpointConnectionError: Could not connect to the endpoint URL: "https://monitoring.eu-central-1b.amazonaws.com/"
Code: Select all
sudo ./check_ec2.py -P 5 --metricname CPUCreditBalance --instanceid 'i-xxxxxxxx' --accesskeyid 'ACCESSKEY' --secretaccesskey 'SECRETYKEY' --region 'eu-central-1' --warning '100:' --critical '25:'Code: Select all
The check has received a response with no data. This is generally caused by an incorrect region name, invalid metric name, or invalid instance ID.
Please verify the following:
Region: eu-central-1
Metric: CPUCreditBalance
Instance ID: i-xxxxxxxxxxxxxxx
Do you have any suggestion or workaround to avoid those errors?