jorgebastida / jorgebastida/awslogs

Some issue regarding aws session token

Open
#338 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

You've found a bug! Please, raise an issue attaching the following traceback
https://github.com/jorgebastida/awslogs/issues/new

Version: 0.14.0
Python: 3.9.1 (default, Feb 3 2021, 07:38:02)
[Clang 12.0.0 (clang-1200.0.32.29)]
boto3 version: 1.15.17
Platform: macOS-11.1-x86_64-i386-64bit
Args: ['/usr/local/bin/awslogs', 'get', '/aws/elasticbeanstalk/api2-pckt-party', '--watch', '--query=message']
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/elasticbeanstalk/api2-pckt-party', 'log_stream_name': 'ALL', 'filter_pattern': None, 'watch': True, 'watch_interval': 1, 'output_group_enabled': True, 'output_stream_enabled': True, 'output_timestamp_enabled': False, 'output_ingestion_time_enabled': False, 'start': '5m', 'end': None, 'color': 'auto', 'query': 'message', 'func': 'list_logs'}

Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/awslogs/bin.py", line 179, in main
getattr(logs, options.func)()
File "/usr/local/lib/python3.9/site-packages/awslogs/core.py", line 229, in list_logs
consumer()
File "/usr/local/lib/python3.9/site-packages/awslogs/core.py", line 212, in consumer
parsed = json.loads(event['message'])
File "/usr/local/Cellar/python@3.9/3.9.1_8/Frameworks/Python.framework/Versions/3.9/lib/python3.9/json/__init__.py", line 346, in loads
return _default_decoder.decode(s)
File "/usr/local/Cellar/python@3.9/3.9.1_8/Frameworks/Python.framework/Versions/3.9/lib/python3.9/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/local/Cellar/python@3.9/3.9.1_8/Frameworks/Python.framework/Versions/3.9/lib/python3.9/json/decoder.py", line 353, in raw_decode
obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Expecting ',' delimiter: line 1 column 15 (char 14)

~ awslogs get /aws/elasticbeanstalk/api2-pckt-party --watch --query=message

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with awslogs/core.py, especially list_logs and consumer, then inspect the call from awslogs/bin.py:179. Reproduce the supplied awslogs command and examine the event message passed to json.loads; determine how the AWS session-token configuration relates to the malformed JSON error. Done means the cause and expected behavior are established and covered by an appropriate regression test.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.