jorgebastida / jorgebastida/awslogs

Crashed while watching a lambda log

Open
#267 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
5k
Forks
342
PR merge metrics
No merged PRs in 30d

Description

Watch command:
```awslogs get /aws/lambda/xxx ALL --watch```

Traceback:
```Version: 0.11.0
Python: 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 22:22:05) [MSC v.1916 64 bit (AMD64)]
boto3 version: 1.9.208
Platform: Windows-7-6.1.7601-SP1
Config: {'aws_access_key_id': 'SENSITIVE', 'aws_secret_access_key': 'SENSITIVE', 'aws_session_token': 'SENSITIVE', 'aws_profile': 'SENSITIVE', 'aws_region': None, 'log_group_name':
'/aws/lambda/ticker-mon', 'log_stream_name': 'ALL', 'filter_pattern': None, 'watch': True, 'watch_interval': 1, 'output_group_enabled': True, 'output_stream_enabled': True, 'outpu
t_timestamp_enabled': False, 'output_ingestion_time_enabled': False, 'start': '5m', 'end': None, 'color': 'auto', 'query': None, 'func': 'list_logs'}
Args: ['C:\\Python37\\Scripts\\awslogs', 'get', '/aws/lambda/ticker-mon', 'ALL', '--watch']

Traceback (most recent call last):
File "c:\python37\lib\site-packages\urllib3\connection.py", line 171, in _new_conn
(self._dns_host, self.port), self.timeout, **extra_kw)
File "c:\python37\lib\site-packages\urllib3\util\connection.py", line 56, in create_connection
for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
File "c:\python37\lib\socket.py", line 748, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno 11004] getaddrinfo failed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "c:\python37\lib\site-packages\botocore\httpsession.py", line 262, in send
chunked=self._chunked(request.headers),
File "c:\python37\lib\site-packages\urllib3\connectionpool.py", line 638, in urlopen
_stacktrace=sys.exc_info()[2])
File "c:\python37\lib\site-packages\urllib3\util\retry.py", line 343, in increment
raise six.reraise(type(error), error, _stacktrace)
File "c:\python37\lib\site-packages\urllib3\packages\six.py", line 686, in reraise
raise value
File "c:\python37\lib\site-packages\urllib3\connectionpool.py", line 600, in urlopen
chunked=chunked)
File "c:\python37\lib\site-packages\urllib3\connectionpool.py", line 343, in _make_request
self._validate_conn(conn)
File "c:\python37\lib\site-packages\urllib3\connectionpool.py", line 849, in _validate_conn
conn.connect()
File "c:\python37\lib\site-packages\urllib3\connection.py", line 314, in connect
conn = self._new_conn()
File "c:\python37\lib\site-packages\urllib3\connection.py", line 180, in _new_conn
self, "Failed to establish a new connection: %s" % e)
urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 11004] getaddrinfo failed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "c:\python37\lib\site-packages\awslogs\bin.py", line 178, in main
getattr(logs, options.func)()
File "c:\python37\lib\site-packages\awslogs\core.py", line 223, in list_logs
consumer()
File "c:\python37\lib\site-packages\awslogs\core.py", line 164, in consumer
for event in generator():
File "c:\python37\lib\site-packages\awslogs\core.py", line 151, in generator
response = self.client.filter_log_events(**kwargs)
File "c:\python37\lib\site-packages\botocore\client.py", line 357, in _api_call
return self._make_api_call(operation_name, kwargs)
File "c:\python37\lib\site-packages\botocore\client.py", line 648, in _make_api_call
operation_model, request_dict, request_context)
File "c:\python37\lib\site-packages\botocore\client.py", line 667, in _make_request
return self._endpoint.make_request(operation_model, request_dict)
File "c:\python37\lib\site-packages\botocore\endpoint.py", line 102, in make_request
return self._send_request(request_dict, operation_model)
File "c:\python37\lib\site-packages\botocore\endpoint.py", line 137, in _send_request
success_response, exception):
File "c:\python37\lib\site-packages\botocore\endpoint.py", line 231, in _needs_retry
caught_exception=caught_exception, request_dict=request_dict)
File "c:\python37\lib\site-packages\botocore\hooks.py", line 356, in emit
return self._emitter.emit(aliased_event_name, **kwargs)
File "c:\python37\lib\site-packages\botocore\hooks.py", line 228, in emit
return self._emit(event_name, kwargs)
File "c:\python37\lib\site-packages\botocore\hooks.py", line 211, in _emit
response = handler(**kwargs)
File "c:\python37\lib\site-packages\botocore\retryhandler.py", line 183, in __call__
if self._checker(attempts, response, caught_exception):
File "c:\python37\lib\site-packages\botocore\retryhandler.py", line 251, in __call__
caught_exception)
File "c:\python37\lib\site-packages\botocore\retryhandler.py", line 277, in _should_retry
return self._checker(attempt_number, response, caught_exception)
File "c:\python37\lib\site-packages\botocore\retryhandler.py", line 317, in __call__
caught_exception)
File "c:\python37\lib\site-packages\botocore\retryhandler.py", line 223, in __call__
attempt_number, caught_exception)
File "c:\python37\lib\site-packages\botocore\retryhandler.py", line 359, in _check_caught_exception
raise caught_exception
File "c:\python37\lib\site-packages\botocore\endpoint.py", line 200, in _do_get_response
http_response = self._send(request)
File "c:\python37\lib\site-packages\botocore\endpoint.py", line 244, in _send
return self.http_session.send(request)
File "c:\python37\lib\site-packages\botocore\httpsession.py", line 282, in send
raise EndpointConnectionError(endpoint_url=request.url, error=e)
botocore.exceptions.EndpointConnectionError: Could not connect to the endpoint URL: "https://logs.us-east-1.amazonaws.com/"

```

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the reported `awslogs get /aws/lambda/xxx ALL --watch` command on the stated environment and start by tracing the call from `awslogs/bin.py` into `awslogs/core.py`. Compare the resulting endpoint-resolution failure with the watch-mode behavior; done should mean the reported crash is understood and the command’s handling is verified.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, python
Domain
cli, cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.