jorgebastida / awslogs

AWS CloudWatch logs for Humans™
Other
4.86k stars 336 forks source link

urllib3.exceptions.NewConnectionError: <botocore.awsrequest.AWSHTTPSConnection object at 0x7ff2ad0950d0>: Failed to establish a new connection: [Errno -2] Name or service not known #369

Open anderson-oliveira-sinch opened 2 years ago

anderson-oliveira-sinch commented 2 years ago

Version: 0.14.0 Python: 3.8.10 (default, Nov 26 2021, 20:14:08) [GCC 9.3.0] boto3 version: 1.21.17 Platform: Linux-5.13.0-35-generic-x86_64-with-glibc2.29 Args: ['/home/anderson.oliveira/.local/bin/awslogs', 'get', '/aws/lambda/botsOffload-production-botOffload', '--aws_profile', 'discovery', '--aws_region', 'us-east-2', '--start=22/2/2022 11:00', '--end=22/2/2022 12:00'] Config: {'aws_access_key_id': 'SENSITIVE', 'aws_secret_access_key': 'SENSITIVE', 'aws_session_token': 'SENSITIVE', 'aws_profile': 'SENSITIVE', 'aws_region': None, 'aws_endpoint_url': None, 'log_group_name': '/aws/lambda/botsOffload-production-botOffload', 'log_stream_name': 'ALL', 'filter_pattern': None, 'watch': False, 'watch_interval': 1, 'output_group_enabled': True, 'output_stream_enabled': True, 'output_timestamp_enabled': False, 'output_ingestion_time_enabled': False, 'start': '22/2/2022 11:00', 'end': '22/2/2022 12:00', 'color': 'auto', 'query': None, 'func': 'list_logs'}

Traceback (most recent call last): File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 159, in _new_conn conn = connection.create_connection( File "/usr/lib/python3/dist-packages/urllib3/util/connection.py", line 61, in create_connection for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): File "/usr/lib/python3.8/socket.py", line 918, in getaddrinfo for res in _socket.getaddrinfo(host, port, family, type, proto, flags): socket.gaierror: [Errno -2] Name or service not known

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/anderson.oliveira/.local/lib/python3.8/site-packages/botocore/httpsession.py", line 405, in send urllib_response = conn.urlopen( File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 719, in urlopen retries = retries.increment( File "/usr/lib/python3/dist-packages/urllib3/util/retry.py", line 376, in increment raise six.reraise(type(error), error, _stacktrace) File "/usr/lib/python3/dist-packages/six.py", line 703, in reraise raise value File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 665, in urlopen httplib_response = self._make_request( File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 376, in _make_request self._validate_conn(conn) File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 996, in _validate_conn conn.connect() File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 314, in connect conn = self._new_conn() File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 171, in _new_conn raise NewConnectionError( urllib3.exceptions.NewConnectionError: <botocore.awsrequest.AWSHTTPSConnection object at 0x7ff2ad0950d0>: Failed to establish a new connection: [Errno -2] Name or service not known

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/anderson.oliveira/.local/lib/python3.8/site-packages/awslogs/bin.py", line 179, in main getattr(logs, options.func)() File "/home/anderson.oliveira/.local/lib/python3.8/site-packages/awslogs/core.py", line 229, in list_logs consumer() File "/home/anderson.oliveira/.local/lib/python3.8/site-packages/awslogs/core.py", line 170, in consumer for event in generator(): File "/home/anderson.oliveira/.local/lib/python3.8/site-packages/awslogs/core.py", line 157, in generator response = self.client.filter_log_events(kwargs) File "/home/anderson.oliveira/.local/lib/python3.8/site-packages/botocore/client.py", line 395, in _api_call return self._make_api_call(operation_name, kwargs) File "/home/anderson.oliveira/.local/lib/python3.8/site-packages/botocore/client.py", line 711, in _make_api_call http, parsed_response = self._make_request( File "/home/anderson.oliveira/.local/lib/python3.8/site-packages/botocore/client.py", line 731, in _make_request return self._endpoint.make_request(operation_model, request_dict) File "/home/anderson.oliveira/.local/lib/python3.8/site-packages/botocore/endpoint.py", line 107, in make_request return self._send_request(request_dict, operation_model) File "/home/anderson.oliveira/.local/lib/python3.8/site-packages/botocore/endpoint.py", line 183, in _send_request while self._needs_retry(attempts, operation_model, request_dict, File "/home/anderson.oliveira/.local/lib/python3.8/site-packages/botocore/endpoint.py", line 305, in _needs_retry responses = self._event_emitter.emit( File "/home/anderson.oliveira/.local/lib/python3.8/site-packages/botocore/hooks.py", line 357, in emit return self._emitter.emit(aliased_event_name, kwargs) File "/home/anderson.oliveira/.local/lib/python3.8/site-packages/botocore/hooks.py", line 228, in emit return self._emit(event_name, kwargs) File "/home/anderson.oliveira/.local/lib/python3.8/site-packages/botocore/hooks.py", line 211, in _emit response = handler(kwargs) File "/home/anderson.oliveira/.local/lib/python3.8/site-packages/botocore/retryhandler.py", line 192, in call if self._checker(checker_kwargs): File "/home/anderson.oliveira/.local/lib/python3.8/site-packages/botocore/retryhandler.py", line 265, in call should_retry = self._should_retry(attempt_number, response, File "/home/anderson.oliveira/.local/lib/python3.8/site-packages/botocore/retryhandler.py", line 292, in _should_retry return self._checker(attempt_number, response, caught_exception) File "/home/anderson.oliveira/.local/lib/python3.8/site-packages/botocore/retryhandler.py", line 331, in call checker_response = checker(attempt_number, response, File "/home/anderson.oliveira/.local/lib/python3.8/site-packages/botocore/retryhandler.py", line 231, in call return self._check_caught_exception( File "/home/anderson.oliveira/.local/lib/python3.8/site-packages/botocore/retryhandler.py", line 374, in _check_caught_exception raise caught_exception File "/home/anderson.oliveira/.local/lib/python3.8/site-packages/botocore/endpoint.py", line 249, in _do_get_response http_response = self._send(request) File "/home/anderson.oliveira/.local/lib/python3.8/site-packages/botocore/endpoint.py", line 321, in _send return self.http_session.send(request) File "/home/anderson.oliveira/.local/lib/python3.8/site-packages/botocore/httpsession.py", line 434, in send raise EndpointConnectionError(endpoint_url=request.url, error=e) botocore.exceptions.EndpointConnectionError: Could not connect to the endpoint URL: "https://logs.US.amazonaws.com/"