jorgebastida / jorgebastida/awslogs

Bug on awslogs

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

Hi,

When I run log_group=$(awslogs groups -p ecsworkshop-frontend), from the ecsworkshop guide I receive the following error

```Version: 0.11.0
Python: 3.6.10 (default, Feb 10 2020, 19:55:14)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-28)]
boto3 version: 1.12.16
Platform: Linux-4.14.165-103.209.amzn1.x86_64-x86_64-with-glibc2.3.4
Config: {'aws_access_key_id': 'SENSITIVE', 'aws_secret_access_key': 'SENSITIVE', 'aws_session_token': 'SENSITIVE', 'aws_profile': 'SENSITIVE', 'aws_region': '', 'log_group_prefix': 'ecsworkshop-frontend', 'func': 'list_groups'}
Args: ['/home/ec2-user/environment/.env/bin/awslogs', 'groups', '-p', 'ecsworkshop-frontend']

Traceback (most recent call last):
File "/home/ec2-user/environment/.env/local/lib/python3.6/dist-packages/awslogs/bin.py", line 174, in main
logs = AWSLogs(**vars(options))
File "/home/ec2-user/environment/.env/local/lib/python3.6/dist-packages/awslogs/core.py", line 89, in __init__
self.aws_region
File "/home/ec2-user/environment/.env/local/lib/python3.6/dist-packages/awslogs/core.py", line 48, in boto3_client
region_name=aws_region)
File "/home/ec2-user/environment/.env/local/lib/python3.6/dist-packages/boto3/session.py", line 263, in client
aws_session_token=aws_session_token, config=config)
File "/home/ec2-user/environment/.env/local/lib/python3.6/dist-packages/botocore/session.py", line 835, in create_client
client_config=config, api_version=api_version)
File "/home/ec2-user/environment/.env/local/lib/python3.6/dist-packages/botocore/client.py", line 85, in create_client
verify, credentials, scoped_config, client_config, endpoint_bridge)
File "/home/ec2-user/environment/.env/local/lib/python3.6/dist-packages/botocore/client.py", line 287, in _get_client_args
verify, credentials, scoped_config, client_config, endpoint_bridge)
File "/home/ec2-user/environment/.env/local/lib/python3.6/dist-packages/botocore/args.py", line 107, in get_client_args
client_cert=new_config.client_cert)
File "/home/ec2-user/environment/.env/local/lib/python3.6/dist-packages/botocore/endpoint.py", line 261, in create_endpoint
raise ValueError("Invalid endpoint: %s" % endpoint_url)
ValueError: Invalid endpoint: https://logs..amazonaws.com

I think is the extra dot in the endpoint

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing `awslogs groups -p ecsworkshop-frontend` and inspect `awslogs/core.py` at `boto3_client`, with `awslogs/bin.py` showing the command entry point. Check how the empty AWS region becomes the endpoint URL; done means the command reaches a valid CloudWatch Logs endpoint and lists groups without the extra dot.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, python
Domain
cli, cloud, observability-sre
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.