jorgebastida / jorgebastida/awslogs

Traceback bug :(

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

Version: 0.14.0
Python: 3.10.8 (main, Oct 12 2022, 09:32:59) [Clang 14.0.0 (clang-1400.0.29.102)]
boto3 version: 1.22.5
Platform: macOS-12.6-arm64-arm-64bit
Args: ['/opt/homebrew/bin/awslogs', 'get', '/aws/lambda/backend-graphql-dev-graphql', '--start=2h 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': '/aws/lambda/backend-graphql-dev-graphql', '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': '2h ago', 'end': None, 'color': 'auto', 'query': None, 'func': 'list_logs'}

Traceback (most recent call last):
File "/opt/homebrew/Cellar/awslogs/0.14.0_3/libexec/lib/python3.10/site-packages/awslogs/bin.py", line 175, in main
logs = AWSLogs(**vars(options))
File "/opt/homebrew/Cellar/awslogs/0.14.0_3/libexec/lib/python3.10/site-packages/awslogs/core.py", line 89, in __init__
self.client = boto3_client(
File "/opt/homebrew/Cellar/awslogs/0.14.0_3/libexec/lib/python3.10/site-packages/awslogs/core.py", line 44, in boto3_client
return session.client(
File "/opt/homebrew/Cellar/awslogs/0.14.0_3/libexec/lib/python3.10/site-packages/boto3/session.py", line 299, in client
return self._session.create_client(
File "/opt/homebrew/Cellar/awslogs/0.14.0_3/libexec/lib/python3.10/site-packages/botocore/session.py", line 884, in create_client
client = client_creator.create_client(
File "/opt/homebrew/Cellar/awslogs/0.14.0_3/libexec/lib/python3.10/site-packages/botocore/client.py", line 102, in create_client
client_args = self._get_client_args(
File "/opt/homebrew/Cellar/awslogs/0.14.0_3/libexec/lib/python3.10/site-packages/botocore/client.py", line 384, in _get_client_args
return args_creator.get_client_args(
File "/opt/homebrew/Cellar/awslogs/0.14.0_3/libexec/lib/python3.10/site-packages/botocore/args.py", line 71, in get_client_args
final_args = self.compute_client_args(
File "/opt/homebrew/Cellar/awslogs/0.14.0_3/libexec/lib/python3.10/site-packages/botocore/args.py", line 148, in compute_client_args
endpoint_config = self._compute_endpoint_config(
File "/opt/homebrew/Cellar/awslogs/0.14.0_3/libexec/lib/python3.10/site-packages/botocore/args.py", line 234, in _compute_endpoint_config
return self._resolve_endpoint(**resolve_endpoint_kwargs)
File "/opt/homebrew/Cellar/awslogs/0.14.0_3/libexec/lib/python3.10/site-packages/botocore/args.py", line 320, in _resolve_endpoint
return endpoint_bridge.resolve(
File "/opt/homebrew/Cellar/awslogs/0.14.0_3/libexec/lib/python3.10/site-packages/botocore/client.py", line 465, in resolve
resolved = self.endpoint_resolver.construct_endpoint(
File "/opt/homebrew/Cellar/awslogs/0.14.0_3/libexec/lib/python3.10/site-packages/botocore/regions.py", line 196, in construct_endpoint
result = self._endpoint_for_partition(
File "/opt/homebrew/Cellar/awslogs/0.14.0_3/libexec/lib/python3.10/site-packages/botocore/regions.py", line 230, in _endpoint_for_partition
raise NoRegionError()
botocore.exceptions.NoRegionError: You must specify a region.

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the command shown in the report, then inspect awslogs/bin.py around main and awslogs/core.py around boto3_client, where the traceback reaches botocore's region resolution. Determine the expected behavior when no AWS region is configured and add or update the relevant test if the repository provides one; done means the reported invocation has defined behavior instead of the uncaught NoRegionError.

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.