jorgebastida / jorgebastida/awslogs

Providing stream as '*' errors out

Open
#94 1 comment 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.7.0
Python: 3.5.2 (default, Aug 16 2016, 05:35:40)
[GCC 4.2.1 Compatible Apple LLVM 7.3.0 (clang-703.0.31)]
boto3 version: 1.4.0
Platform: Darwin-15.6.0-x86_64-i386-64bit
Config: {'log_group_name': '/nile/perso.nile.works/heliograf-election2016-admin', 'output_stream_enabled': True, 'aws_secret_access_key': 'SENSITIVE', 'output_timestamp_enabled': False, 'log_stream_name': '_', 'aws_profile': 'SENSITIVE', 'aws_session_token': 'SENSITIVE', 'output_ingestion_time_enabled': False, 'aws_region': 'us-east-1', 'end': None, 'watch': True, 'func': 'list_logs', 'color_enabled': True, 'output_group_enabled': True, 'aws_access_key_id': 'SENSITIVE', 'query': None, 'filter_pattern': None, 'start': '10 min'}
Args: ['/Users/johria/.virtualenvs/heliograf/bin/awslogs', 'get', '/nile/perso.nile.works/heliograf-election2016-admin', '_', '--profile', 'main', '-s', '10 min', '--watch']

```
Traceback (most recent call last):
File "/Users/johria/.virtualenvs/heliograf/lib/python3.5/site-packages/awslogs/bin.py", line 166, in main
getattr(logs, options.func)()
File "/Users/johria/.virtualenvs/heliograf/lib/python3.5/site-packages/awslogs/core.py", line 75, in list_logs
streams = list(self._get_streams_from_pattern(self.log_group_name, self.log_stream_name))
File "/Users/johria/.virtualenvs/heliograf/lib/python3.5/site-packages/awslogs/core.py", line 67, in _get_streams_from_pattern
reg = re.compile('^{0}'.format(pattern))
File "/Users/johria/.virtualenvs/heliograf/lib/python3.5/re.py", line 224, in compile
return _compile(pattern, flags)
File "/Users/johria/.virtualenvs/heliograf/lib/python3.5/re.py", line 293, in _compile
p = sre_compile.compile(pattern, flags)
File "/Users/johria/.virtualenvs/heliograf/lib/python3.5/sre_compile.py", line 536, in compile
p = sre_parse.parse(p, flags)
File "/Users/johria/.virtualenvs/heliograf/lib/python3.5/sre_parse.py", line 829, in parse
p = _parse_sub(source, pattern, 0)
File "/Users/johria/.virtualenvs/heliograf/lib/python3.5/sre_parse.py", line 437, in _parse_sub
itemsappend(_parse(source, state))
File "/Users/johria/.virtualenvs/heliograf/lib/python3.5/sre_parse.py", line 638, in _parse
source.tell() - here + len(this))
# sre_constants.error: nothing to repeat at position 1

```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in awslogs/core.py at _get_streams_from_pattern, identified by the traceback, and reproduce the reported get command with '*' as the stream argument. Trace how the stream pattern is compiled and verify that the command completes without the reported regular-expression error.

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
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.