jorgebastida / jorgebastida/awslogs
Application Crashed
- Dominant language
- Python
- Stars
- 5k
- Forks
- 342
- PR merge metrics
- No merged PRs in 30d
Description
Version: **0.14.0**
Python: **3.8.10 (default, Sep 28 2021, 16:10:42)**
[GCC 9.3.0]
boto3 version: **1.17.53**
Platform: **Linux-5.4.0-88-generic-x86_64-with-glibc2.29**
Args:
`['/home/navigus/.local/bin/awslogs', 'get', '/ecs/staging-xxx-yyy-server', '--query=message', '--start=60m ago', '--end=30m ago']`
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': '/ecs/staging-xxx-yyy-server', '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': '60m ago', 'end': '30m ago', 'color': 'auto', 'query': 'message', 'func': 'list_logs'}`
```
Traceback (most recent call last):
File "/home/xxx/.local/lib/python3.8/site-packages/awslogs/bin.py", line 179, in main
getattr(logs, options.func)()
File "/home/xxx/.local/lib/python3.8/site-packages/awslogs/core.py", line 229, in list_logs
consumer()
File "/home/xxx/.local/lib/python3.8/site-packages/awslogs/core.py", line 212, in consumer
parsed = json.loads(event['message'])
File "/usr/lib/python3.8/json/__init__.py", line 357, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.8/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.8/json/decoder.py", line 353, in raw_decode
obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 1 column 3 (char 2)
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with awslogs/core.py at the consumer call on line 212 and inspect the json.loads(event['message']) path; awslogs/bin.py line 179 shows how the command reaches it. Reproduce with the reported awslogs get arguments and a message like the one that triggers JSONDecodeError. Done should mean the command no longer crashes unexpectedly when processing that event.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, python
- Domain
- cli, cloud
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100