jorgebastida / jorgebastida/awslogs
Gracefully handle NoCredentialsError
- Dominant language
- Python
- Stars
- 5k
- Forks
- 342
- PR merge metrics
- No merged PRs in 30d
Description
💁 preethsr @ 💻 8c85904326da in 📁 .aws
└❯ awslogs groups --profile syd --region us-east-1
You've found a bug! Please, raise an issue attaching the following traceback
https://github.com/jorgebastida/awslogs/issues/new
```Version: 0.11.0
Python: 2.7.14 (default, May 29 2018, 18:58:31)
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.39.2)]
boto3 version: 1.7.29
Platform: Darwin-16.7.0-x86_64-i386-64bit
Config: {'func': 'list_groups', 'aws_region': None, 'log_group_prefix': None, 'aws_access_key_id': 'SENSITIVE', 'aws_profile': 'SENSITIVE', 'aws_secret_access_key': 'SENSITIVE', 'aws_session_token': 'SENSITIVE'}
Args: ['/Users/preethsr/.pyenv/versions/2.7.14/bin/awslogs', 'groups', '--profile', 'syd', '--region', 'us-east-1']
Traceback (most recent call last):
File "/Users/preethsr/.pyenv/versions/2.7.14/lib/python2.7/site-packages/awslogs/bin.py", line 178, in main
getattr(logs, options.func)()
File "/Users/preethsr/.pyenv/versions/2.7.14/lib/python2.7/site-packages/awslogs/core.py", line 230, in list_groups
for group in self.get_groups():
File "/Users/preethsr/.pyenv/versions/2.7.14/lib/python2.7/site-packages/awslogs/core.py", line 244, in get_groups
for page in paginator.paginate(**kwargs):
File "/Users/preethsr/.pyenv/versions/2.7.14/lib/python2.7/site-packages/botocore/paginate.py", line 255, in __iter__
response = self._make_request(current_kwargs)
File "/Users/preethsr/.pyenv/versions/2.7.14/lib/python2.7/site-packages/botocore/paginate.py", line 332, in _make_request
return self._method(**current_kwargs)
File "/Users/preethsr/.pyenv/versions/2.7.14/lib/python2.7/site-packages/botocore/client.py", line 314, in _api_call
return self._make_api_call(operation_name, kwargs)
File "/Users/preethsr/.pyenv/versions/2.7.14/lib/python2.7/site-packages/botocore/client.py", line 599, in _make_api_call
operation_model, request_dict)
File "/Users/preethsr/.pyenv/versions/2.7.14/lib/python2.7/site-packages/botocore/endpoint.py", line 148, in make_request
return self._send_request(request_dict, operation_model)
File "/Users/preethsr/.pyenv/versions/2.7.14/lib/python2.7/site-packages/botocore/endpoint.py", line 173, in _send_request
request = self.create_request(request_dict, operation_model)
File "/Users/preethsr/.pyenv/versions/2.7.14/lib/python2.7/site-packages/botocore/endpoint.py", line 157, in create_request
operation_name=operation_model.name)
File "/Users/preethsr/.pyenv/versions/2.7.14/lib/python2.7/site-packages/botocore/hooks.py", line 227, in emit
return self._emit(event_name, kwargs)
File "/Users/preethsr/.pyenv/versions/2.7.14/lib/python2.7/site-packages/botocore/hooks.py", line 210, in _emit
response = handler(**kwargs)
File "/Users/preethsr/.pyenv/versions/2.7.14/lib/python2.7/site-packages/botocore/signers.py", line 90, in handler
return self.sign(operation_name, request)
File "/Users/preethsr/.pyenv/versions/2.7.14/lib/python2.7/site-packages/botocore/signers.py", line 156, in sign
auth.add_auth(request)
File "/Users/preethsr/.pyenv/versions/2.7.14/lib/python2.7/site-packages/botocore/auth.py", line 352, in add_auth
raise NoCredentialsError
NoCredentialsError: Unable to locate credentials
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start at awslogs/bin.py main and core.py list_groups/get_groups, the entry points shown in the traceback. Reproduce the awslogs groups --profile syd --region us-east-1 command and verify that missing credentials are handled without the displayed uncaught traceback.
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
- 35/100