Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NoRegionError when default region defined in config file #401

Open
mrmuth opened this issue Jun 21, 2024 · 0 comments
Open

NoRegionError when default region defined in config file #401

mrmuth opened this issue Jun 21, 2024 · 0 comments

Comments

@mrmuth
Copy link

mrmuth commented Jun 21, 2024

awslogs produces a NoRegionError when using an AWS profile that has a default region defined in ~/.aws/config but no region defined in the profile's section in ~/.aws/credentials. No error is produced after adding the region in the profile's section in the credentials file.

Version: 0.15.0
Python: 3.9.18 (main, Jan 24 2024, 16:34:55)
[Clang 14.0.5 (https://github.com/llvm/llvm-project.git llvmorg-14.0.5-0-gc1238
boto3 version: 1.34.131
Platform: FreeBSD-13.2-RELEASE-p11-amd64-64bit-ELF
Args: ['/home/myusername/.local/bin/awslogs', 'get', '/aws/lambda/nameofmylambda, '-s1h', '--profile', 'myusername-cli']
Config: {options}

Traceback (most recent call last):
File "/home/myusername/.local/lib/python3.9/site-packages/awslogs/bin.py", line 206, in main
logs = AWSLogs(**vars(options))
File "/home/myusername/.local/lib/python3.9/site-packages/awslogs/core.py", line 88, in init
self.client = boto3_client(
File "/home/myusername/.local/lib/python3.9/site-packages/awslogs/core.py", line 45, in boto3_client
return session.client(
File "/home/myusername/.local/lib/python3.9/site-packages/boto3/session.py", line 297, in client
return self._session.create_client(
File "/home/myusername/.local/lib/python3.9/site-packages/botocore/session.py", line 997, in create_client
client = client_creator.create_client(
File "/home/myusername/.local/lib/python3.9/site-packages/botocore/client.py", line 161, in create_client
client_args = self._get_client_args(
File "/home/myusername/.local/lib/python3.9/site-packages/botocore/client.py", line 520, in _get_client_args
return args_creator.get_client_args(
File "/home/myusername/.local/lib/python3.9/site-packages/botocore/args.py", line 100, in get_client_args
final_args = self.compute_client_args(
File "/home/myusername/.local/lib/python3.9/site-packages/botocore/args.py", line 219, in compute_client_args
endpoint_config = self._compute_endpoint_config(
File "/home/myusername/.local/lib/python3.9/site-packages/botocore/args.py", line 369, in _compute_endpoint_config
return self._resolve_endpoint(**resolve_endpoint_kwargs)
File "/home/myusername/.local/lib/python3.9/site-packages/botocore/args.py", line 474, in _resolve_endpoint
return endpoint_bridge.resolve(
File "/home/myusername/.local/lib/python3.9/site-packages/botocore/client.py", line 625, in resolve
resolved = self.endpoint_resolver.construct_endpoint(
File "/home/myusername/.local/lib/python3.9/site-packages/botocore/regions.py", line 229, in construct_endpoint
result = self._endpoint_for_partition(
File "/home/myusername/.local/lib/python3.9/site-packages/botocore/regions.py", line 277, in _endpoint_for_partition
raise NoRegionError()
botocore.exceptions.NoRegionError: You must specify a region.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant