awslogs icon indicating copy to clipboard operation
awslogs copied to clipboard

Error running awslogs groups

Open mmonette opened this issue 4 years ago • 1 comments

Version: 0.14.0 Python: 3.8.2 (tags/v3.8.2:7b3ab59, Feb 25 2020, 23:03:10) [MSC v.1916 64 bit (AMD64)] boto3 version: 1.14.46 Platform: Windows-10-10.0.19041-SP0 Args: ['C:\Program Files\Python38\Scripts\awslogs', 'groups'] 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_prefix': None, 'func': 'list_groups'}

Traceback (most recent call last): File "c:\program files\python38\lib\site-packages\awslogs\bin.py", line 175, in main logs = AWSLogs(**vars(options)) File "c:\program files\python38\lib\site-packages\awslogs\core.py", line 89, in init self.client = boto3_client( File "c:\program files\python38\lib\site-packages\awslogs\core.py", line 44, in boto3_client return session.client( File "c:\program files\python38\lib\site-packages\boto3\session.py", line 258, in client return self._session.create_client( File "c:\program files\python38\lib\site-packages\botocore\session.py", line 834, in create_client client = client_creator.create_client( File "c:\program files\python38\lib\site-packages\botocore\client.py", line 83, in create_client client_args = self._get_client_args( File "c:\program files\python38\lib\site-packages\botocore\client.py", line 285, in _get_client_args return args_creator.get_client_args( File "c:\program files\python38\lib\site-packages\botocore\args.py", line 71, in get_client_args final_args = self.compute_client_args( File "c:\program files\python38\lib\site-packages\botocore\args.py", line 147, in compute_client_args endpoint_config = self._compute_endpoint_config( File "c:\program files\python38\lib\site-packages\botocore\args.py", line 218, in _compute_endpoint_config return self._resolve_endpoint(**resolve_endpoint_kwargs) File "c:\program files\python38\lib\site-packages\botocore\args.py", line 300, in _resolve_endpoint return endpoint_bridge.resolve( File "c:\program files\python38\lib\site-packages\botocore\client.py", line 360, in resolve resolved = self.endpoint_resolver.construct_endpoint( File "c:\program files\python38\lib\site-packages\botocore\regions.py", line 133, in construct_endpoint result = self._endpoint_for_partition( File "c:\program files\python38\lib\site-packages\botocore\regions.py", line 148, in _endpoint_for_partition raise NoRegionError() botocore.exceptions.NoRegionError: You must specify a region.

mmonette avatar Aug 27 '20 20:08 mmonette

I have an same error.

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.8.5 (default, Jul 21 2020, 10:48:26) 
[Clang 11.0.3 (clang-1103.0.32.62)]
boto3 version: 1.14.20
Platform:      macOS-10.15.6-x86_64-i386-64bit
Args:          ['/usr/local/bin/awslogs', 'groups', '--profile=lpss3devread']
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_prefix': None, 'func': 'list_groups'}

Traceback (most recent call last):
  File "/usr/local/Cellar/awslogs/0.14.0/libexec/lib/python3.8/site-packages/awslogs/bin.py", line 175, in main
    logs = AWSLogs(**vars(options))
  File "/usr/local/Cellar/awslogs/0.14.0/libexec/lib/python3.8/site-packages/awslogs/core.py", line 89, in __init__
    self.client = boto3_client(
  File "/usr/local/Cellar/awslogs/0.14.0/libexec/lib/python3.8/site-packages/awslogs/core.py", line 44, in boto3_client
    return session.client(
  File "/usr/local/Cellar/awslogs/0.14.0/libexec/lib/python3.8/site-packages/boto3/session.py", line 258, in client
    return self._session.create_client(
  File "/usr/local/Cellar/awslogs/0.14.0/libexec/lib/python3.8/site-packages/botocore/session.py", line 831, in create_client
    client = client_creator.create_client(
  File "/usr/local/Cellar/awslogs/0.14.0/libexec/lib/python3.8/site-packages/botocore/client.py", line 83, in create_client
    client_args = self._get_client_args(
  File "/usr/local/Cellar/awslogs/0.14.0/libexec/lib/python3.8/site-packages/botocore/client.py", line 285, in _get_client_args
    return args_creator.get_client_args(
  File "/usr/local/Cellar/awslogs/0.14.0/libexec/lib/python3.8/site-packages/botocore/args.py", line 71, in get_client_args
    final_args = self.compute_client_args(
  File "/usr/local/Cellar/awslogs/0.14.0/libexec/lib/python3.8/site-packages/botocore/args.py", line 147, in compute_client_args
    endpoint_config = self._compute_endpoint_config(
  File "/usr/local/Cellar/awslogs/0.14.0/libexec/lib/python3.8/site-packages/botocore/args.py", line 218, in _compute_endpoint_config
    return self._resolve_endpoint(**resolve_endpoint_kwargs)
  File "/usr/local/Cellar/awslogs/0.14.0/libexec/lib/python3.8/site-packages/botocore/args.py", line 300, in _resolve_endpoint
    return endpoint_bridge.resolve(
  File "/usr/local/Cellar/awslogs/0.14.0/libexec/lib/python3.8/site-packages/botocore/client.py", line 360, in resolve
    resolved = self.endpoint_resolver.construct_endpoint(
  File "/usr/local/Cellar/awslogs/0.14.0/libexec/lib/python3.8/site-packages/botocore/regions.py", line 133, in construct_endpoint
    result = self._endpoint_for_partition(
  File "/usr/local/Cellar/awslogs/0.14.0/libexec/lib/python3.8/site-packages/botocore/regions.py", line 148, in _endpoint_for_partition
    raise NoRegionError()
botocore.exceptions.NoRegionError: You must specify a region.

I added region to ~/.aws/credentials like as following, then retried and it worked.

[myaccount]
aws_access_key_id=XXXXX
aws_secret_access_key=XXXXX
region=ap-northeast-1

nomurashunta avatar Sep 04 '20 03:09 nomurashunta