jorgebastida / awslogs

AWS CloudWatch logs for Humans™
Other
4.86k stars 335 forks source link

You've found a bug! while executing $ awslogs groups --profile testing / --profile=testing #287

Open MJ-Max opened 4 years ago

MJ-Max commented 4 years ago

$ awslogs groups --profile testing

You've found a bug! Please, raise an issue attaching the following traceback https://github.com/jorgebastida/awslogs/issues/new

Python: 3.7.4 (tags/v3.7.4:e09359112e, Jul  8 2019, 19:29:22) [MSC v.1916 32 bit (Intel)]
boto3 version: 1.11.11
Platform: Windows-10-10.0.18362-SP0
Config: {'aws_access_key_id': 'SENSITIVE', 'aws_secret_access_key': 'SENSITIVE', 'aws_session_token': 'SENSITIVE', 'aws_profile': 'SENSITIVE', 'aws_region': None, 'log_group_prefix': None, 'func': 'list_groups'}
Args: ['C:\\Python37-32\\Scripts\\awslogs', 'groups', '--profile', 'testing']

Traceback (most recent call last):
  File "c:\python37-32\lib\site-packages\awslogs\bin.py", line 174, in main
    logs = AWSLogs(**vars(options))
  File "c:\python37-32\lib\site-packages\awslogs\core.py", line 89, in __init__
    self.aws_region
  File "c:\python37-32\lib\site-packages\awslogs\core.py", line 48, in boto3_client
    region_name=aws_region)
  File "c:\python37-32\lib\site-packages\boto3\session.py", line 263, in client
    aws_session_token=aws_session_token, config=config)
  File "c:\python37-32\lib\site-packages\botocore\session.py", line 835, in create_client
    client_config=config, api_version=api_version)
  File "c:\python37-32\lib\site-packages\botocore\client.py", line 83, in create_client
    verify, credentials, scoped_config, client_config, endpoint_bridge)
  File "c:\python37-32\lib\site-packages\botocore\client.py", line 247, in _get_client_args
    verify, credentials, scoped_config, client_config, endpoint_bridge)
  File "c:\python37-32\lib\site-packages\botocore\args.py", line 73, in get_client_args
    endpoint_url, is_secure, scoped_config)
  File "c:\python37-32\lib\site-packages\botocore\args.py", line 153, in compute_client_args
    s3_config=s3_config,
  File "c:\python37-32\lib\site-packages\botocore\args.py", line 217, in _compute_endpoint_config
    return self._resolve_endpoint(**resolve_endpoint_kwargs)
  File "c:\python37-32\lib\site-packages\botocore\args.py", line 300, in _resolve_endpoint
    service_name, region_name, endpoint_url, is_secure)
  File "c:\python37-32\lib\site-packages\botocore\client.py", line 321, in resolve
    service_name, region_name)
  File "c:\python37-32\lib\site-packages\botocore\regions.py", line 122, in construct_endpoint
    partition, service_name, region_name)
  File "c:\python37-32\lib\site-packages\botocore\regions.py", line 135, in _endpoint_for_partition
    raise NoRegionError()
botocore.exceptions.NoRegionError: You must specify a region.

$ awslogs groups --profile=testing

You've found a bug! Please, raise an issue attaching the following traceback https://github.com/jorgebastida/awslogs/issues/new

Python: 3.7.4 (tags/v3.7.4:e09359112e, Jul  8 2019, 19:29:22) [MSC v.1916 32 bit (Intel)]
boto3 version: 1.11.11
Platform: Windows-10-10.0.18362-SP0
Config: {'aws_access_key_id': 'SENSITIVE', 'aws_secret_access_key': 'SENSITIVE', 'aws_session_token': 'SENSITIVE', 'aws_profile': 'SENSITIVE', 'aws_region': None, 'log_group_prefix': None, 'func': 'list_groups'}
Args: ['C:\\Python37-32\\Scripts\\awslogs', 'groups', '--profile=testing']

Traceback (most recent call last):
  File "c:\python37-32\lib\site-packages\awslogs\bin.py", line 174, in main
    logs = AWSLogs(**vars(options))
  File "c:\python37-32\lib\site-packages\awslogs\core.py", line 89, in __init__
    self.aws_region
  File "c:\python37-32\lib\site-packages\awslogs\core.py", line 48, in boto3_client
    region_name=aws_region)
  File "c:\python37-32\lib\site-packages\boto3\session.py", line 263, in client
    aws_session_token=aws_session_token, config=config)
  File "c:\python37-32\lib\site-packages\botocore\session.py", line 835, in create_client
    client_config=config, api_version=api_version)
  File "c:\python37-32\lib\site-packages\botocore\client.py", line 83, in create_client
    verify, credentials, scoped_config, client_config, endpoint_bridge)
  File "c:\python37-32\lib\site-packages\botocore\client.py", line 247, in _get_client_args
    verify, credentials, scoped_config, client_config, endpoint_bridge)
  File "c:\python37-32\lib\site-packages\botocore\args.py", line 73, in get_client_args
    endpoint_url, is_secure, scoped_config)
  File "c:\python37-32\lib\site-packages\botocore\args.py", line 153, in compute_client_args
    s3_config=s3_config,
  File "c:\python37-32\lib\site-packages\botocore\args.py", line 217, in _compute_endpoint_config
    return self._resolve_endpoint(**resolve_endpoint_kwargs)
  File "c:\python37-32\lib\site-packages\botocore\args.py", line 300, in _resolve_endpoint
    service_name, region_name, endpoint_url, is_secure)
  File "c:\python37-32\lib\site-packages\botocore\client.py", line 321, in resolve
    service_name, region_name)
  File "c:\python37-32\lib\site-packages\botocore\regions.py", line 122, in construct_endpoint
    partition, service_name, region_name)
  File "c:\python37-32\lib\site-packages\botocore\regions.py", line 135, in _endpoint_for_partition
    raise NoRegionError()
botocore.exceptions.NoRegionError: You must specify a region.

MJ-Max commented 4 years ago

During installation two packages were marked as incompatible. Don't know what to do about it though.

$ pip install awslogs Collecting awslogs Downloading https://files.pythonhosted.org/packages/45/be/28fe3276045c564aeb79fc74ba436201ded4a17d964d8be54adb72a0c873/awslogs-0.11.0-py2.py3-none-any.whl Collecting termcolor>=1.1.0 (from awslogs) Downloading https://files.pythonhosted.org/packages/8a/48/a76be51647d0eb9f10e2a4511bf3ffb8cc1e6b14e9e4fab46173aa79f981/termcolor-1.1.0.tar.gz Requirement already satisfied: jmespath<1.0.0,>=0.7.1 in c:\python37-32\lib\site-packages (from awslogs) (0.9.4) Requirement already satisfied: python-dateutil>=2.4.0 in c:\python37-32\lib\site-packages (from awslogs) (2.8.0) Collecting boto3>=1.2.1 (from awslogs) Downloading https://files.pythonhosted.org/packages/d4/f7/d8c122725ab80fa58076be793e5392022d6557f54f77e6ef46436682fb71/boto3-1.11.11-py2.py3-none-any.whl (128kB) |████████████████████████████████| 133kB 6.4MB/s Requirement already satisfied: six>=1.5 in c:\python37-32\lib\site-packages (from python-dateutil>=2.4.0->awslogs) (1.12.0) Collecting s3transfer<0.4.0,>=0.3.0 (from boto3>=1.2.1->awslogs) Downloading https://files.pythonhosted.org/packages/c7/48/a8252b6b3cd31774eab312b19d58a6ac55f296240c206617dcd38cd93bf8/s3transfer-0.3.2-py2.py3-none-any.whl (69kB) |████████████████████████████████| 71kB 4.5MB/s Collecting botocore<1.15.0,>=1.14.11 (from boto3>=1.2.1->awslogs) Downloading https://files.pythonhosted.org/packages/52/76/b9d0cebb9d4f07bd6e448474afee16c548ffe5bea97cbffd2843877447b2/botocore-1.14.11-py2.py3-none-any.whl (5.9MB) |████████████████████████████████| 5.9MB ... Requirement already satisfied: urllib3<1.26,>=1.20 in c:\python37-32\lib\site-packages (from botocore<1.15.0,>=1.14.11->boto3>=1.2.1->awslogs) (1.25.3) Requirement already satisfied: docutils<0.16,>=0.10 in c:\python37-32\lib\site-packages (from botocore<1.15.0,>=1.14.11->boto3>=1.2.1->awslogs) (0.14) ERROR: awscli 1.16.217 has requirement botocore==1.12.207, but you'll have botocore 1.14.11 which is incompatible. ERROR: awscli 1.16.217 has requirement s3transfer<0.3.0,>=0.2.0, but you'll have s3transfer 0.3.2 which is incompatible. Installing collected packages: termcolor, botocore, s3transfer, boto3, awslogs Running setup.py install for termcolor ... done Found existing installation: botocore 1.12.207 Uninstalling botocore-1.12.207: Successfully uninstalled botocore-1.12.207 Found existing installation: s3transfer 0.2.1 Uninstalling s3transfer-0.2.1: Successfully uninstalled s3transfer-0.2.1 Successfully installed awslogs-0.11.0 boto3-1.11.11 botocore-1.14.11 s3transfer-0.3.2 termcolor-1.1.0

MJ-Max commented 4 years ago

This is on OS Name Microsoft Windows 10 Pro Version 10.0.18363 Build 18363

gene1wood commented 4 years ago

botocore.exceptions.NoRegionError: You must specify a region.

This is because you've not set the AWS region you want to pull logs from either as an environment variable or in your ~/.aws/config

https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-quickstart.html#cli-configure-quickstart-region

gene1wood commented 4 years ago

ERROR: awscli 1.16.217 has requirement botocore==1.12.207, but you'll have botocore 1.14.11 which is incompatible. ERROR: awscli 1.16.217 has requirement s3transfer<0.3.0,>=0.2.0, but you'll have s3transfer 0.3.2 which is incompatible.

You can resolve this by installing awslogs into a virtualenv so it doesn't conflict with your OS level python package dependencies