jorgebastida / jorgebastida/awslogs
The error occurred when I tried to use awslog cli
- Dominant language
- Python
- Stars
- 5k
- Forks
- 342
- PR merge metrics
- No merged PRs in 30d
Description
When I use this command on my dev desktop: "awslogs get /aws/elasticbeanstalk/DMSFServiceSpringEBEnvironment/SkyFireService/log --watch --profile dmtvqa_profile",
the following error occurred:
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.6.13 (default, Feb 17 2021, 23:26:09)
[GCC 7.5.0]
boto3 version: 1.17.9
Platform: Linux-4.9.230-0.1.ac.223.84.332.metal1.x86_64-x86_64-with-redhat-5.3-Tikanga
Args: ['/home/mwang/.local/bin/awslogs', 'get', '/aws/elasticbeanstalk/DMSFServiceSpringEBEnvironment/SkyFireService/log', '--watch', '--profile', 'dmtvqa_profile']
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/elasticbeanstalk/DMSFServiceSpringEBEnvironment/SkyFireService/log', 'log_stream_name': 'ALL', 'filter_pattern': None, 'watch': True, 'watch_interval': 1, 'output_group_enabled': True, 'output_stream_enabled': True, 'output_timestamp_enabled': False, 'output_ingestion_time_enabled': False, 'start': '5m', 'end': None, 'color': 'auto', 'query': None, 'func': 'list_logs'}
Traceback (most recent call last):
File "/home/mwang/.local/lib/python3.6/site-packages/awslogs/bin.py", line 175, in main
logs = AWSLogs(**vars(options))
File "/home/mwang/.local/lib/python3.6/site-packages/awslogs/core.py", line 95, in __init__
self.aws_endpoint_url
File "/home/mwang/.local/lib/python3.6/site-packages/awslogs/core.py", line 50, in boto3_client
endpoint_url=aws_endpoint_url or None
File "/home/mwang/.local/lib/python3.6/site-packages/boto3/session.py", line 263, in client
aws_session_token=aws_session_token, config=config)
File "/home/mwang/.local/lib/python3.6/site-packages/botocore/session.py", line 826, in create_client
credentials = self.get_credentials()
File "/home/mwang/.local/lib/python3.6/site-packages/botocore/session.py", line 431, in get_credentials
'credential_provider').load_credentials()
File "/home/mwang/.local/lib/python3.6/site-packages/botocore/credentials.py", line 1969, in load_credentials
creds = provider.load()
File "/home/mwang/.local/lib/python3.6/site-packages/botocore/credentials.py", line 955, in load
creds_dict = self._retrieve_credentials_using(credential_process)
File "/home/mwang/.local/lib/python3.6/site-packages/botocore/credentials.py", line 980, in _retrieve_credentials_using
provider=self.METHOD, error_msg=stderr.decode('utf-8'))
botocore.exceptions.CredentialRetrievalError: Error when retrieving credentials from custom-process: Traceback (most recent call last):
File "/apollo/env/AmazonAwsCli/bin/isengard", line 12, in
sys.exit(main())
File "/home/mwang/.local/lib/python3.6/site-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/home/mwang/.local/lib/python3.6/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/home/mwang/.local/lib/python3.6/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/mwang/.local/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/mwang/.local/lib/python3.6/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/home/mwang/.local/lib/python3.6/site-packages/isengard/_cli/isengard_cli.py", line 128, in get_command
region, account_name, role_name, format, include_ca_token=include_ca_token
File "/home/mwang/.local/lib/python3.6/site-packages/isengard/_cli/functions.py", line 282, in get_command
data = load_account_data(region)
File "/home/mwang/.local/lib/python3.6/site-packages/isengard/_cli/account_data.py", line 72, in load_account_data
return caching.read(CACHE_NAME + "-" + PARTITIONS[region]) or update_account_data(region)
File "/home/mwang/.local/lib/python3.6/site-packages/isengard/_cli/account_data.py", line 47, in update_account_data
data = request_user_account_data(region)
File "/home/mwang/.local/lib/python3.6/site-packages/isengard/_cli/account_data.py", line 36, in request_user_account_data
accounts = client.get_permissions_for_user()
File "/home/mwang/.local/lib/python3.6/site-packages/isengard/utils.py", line 273, in wrapper
return f(*args, **kwargs)
File "/home/mwang/.local/lib/python3.6/site-packages/isengard/client.py", line 354, in get_permissions_for_user
response = self.client.get_permissions_for_user()
File "/home/mwang/.local/lib/python3.6/site-packages/botocore/client.py", line 357, in _api_call
return self._make_api_call(operation_name, kwargs)
File "/home/mwang/.local/lib/python3.6/site-packages/botocore/client.py", line 676, in _make_api_call
raise error_class(parsed_response, operation_name)
botocore.exceptions.ClientError: An error occurred (307) when calling the GetPermissionsForUser operation:
307 Temporary Redirect
307 Temporary Redirect
Server
Contributor guide
No contributing guide indexed for this repository
Research direction
The traceback enters awslogs/bin.py:main and awslogs/core.py:AWSLogs/boto3_client before failing during boto3 credential retrieval. Reproduce the supplied awslogs get command with the same profile and inspect how CredentialRetrievalError and the 307 response are surfaced. Done means the cause is isolated and the reported invocation has a clear, verified outcome.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, python
- Domain
- cli, cloud
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100