HTTP Client raised an unhandled exception: 'module' object has no attribute 'raise_from'

0

I'm trying to run an aws lightsail command, from within my Amazon Linux 1 instance, to update the caching settings on my distribution.

When I first created the command it worked fine ... but after a while it stopped working and gave an "An HTTP Client raised an unhandled exception: 'module' object has no attribute 'raise_from'" error.

I ran the command with the debug parm and got the output at the bottom of this post (partially, the full debug output won't fit in a post).

Any suggestions? It seems I'm missing a python module, but don't know python at all (Java & RPG are my thing).

Thanks!

David

2022-12-09 07:44:33,646 - MainThread - botocore.endpoint - DEBUG - Sending http request: <AWSPreparedRequest stream_output=False, method=POST, url=https://lightsail.us-east-1.amazonaws.com/, headers={'Content-Length': '1118', 'X-Amz-Target': 'Lightsail_20161128.UpdateDistribution', 'X-Amz-Date': '20221209T134433Z', 'User-Agent': 'aws-cli/1.18.107 Python/2.7.18 Linux/4.14.248-129.473.amzn1.x86_64 botocore/1.17.31', 'Content-Type': 'application/x-amz-json-1.1', 'Authorization': 'AWS4-HMAC-SHA256 Credential=qqqqqqq/20221209/us-east-1/lightsail/aws4_request, SignedHeaders=content-type;host;x-amz-date;x-amz-target, Signature=xxxxxxxx'}> 2022-12-09 07:44:33,646 - MainThread - botocore.httpsession - DEBUG - Exception received when sending urllib3 HTTP request Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/botocore/httpsession.py", line 250, in send conn = manager.connection_from_url(request.url) File "/usr/lib/python2.7/dist-packages/urllib3/poolmanager.py", line 290, in connection_from_url u = parse_url(url) File "/usr/lib/python2.7/dist-packages/urllib3/util/url.py", line 392, in parse_url return six.raise_from(LocationParseError(source_url), None) AttributeError: 'module' object has no attribute 'raise_from' 2022-12-09 07:44:33,653 - MainThread - botocore.hooks - DEBUG - Event needs-retry.lightsail.UpdateDistribution: calling handler <botocore.retryhandler.RetryHandler object at 0x7fa41e1f5c90> 2022-12-09 07:44:33,653 - MainThread - awscli.clidriver - DEBUG - Exception caught in main() Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/awscli/clidriver.py", line 217, in main return command_table[parsed_args.command](remaining, parsed_args) File "/usr/lib/python2.7/dist-packages/awscli/clidriver.py", line 358, in call return command_table[parsed_args.operation](remaining, parsed_globals) File "/usr/lib/python2.7/dist-packages/awscli/clidriver.py", line 530, in call call_parameters, parsed_globals) File "/usr/lib/python2.7/dist-packages/awscli/clidriver.py", line 650, in invoke client, operation_name, parameters, parsed_globals) File "/usr/lib/python2.7/dist-packages/awscli/clidriver.py", line 662, in _make_client_call **parameters) File "/usr/lib/python2.7/dist-packages/botocore/client.py", line 316, in _api_call return self._make_api_call(operation_name, kwargs) File "/usr/lib/python2.7/dist-packages/botocore/client.py", line 622, in _make_api_call operation_model, request_dict, request_context) File "/usr/lib/python2.7/dist-packages/botocore/client.py", line 641, in _make_request return self._endpoint.make_request(operation_model, request_dict) File "/usr/lib/python2.7/dist-packages/botocore/endpoint.py", line 102, in make_request return self._send_request(request_dict, operation_model) File "/usr/lib/python2.7/dist-packages/botocore/endpoint.py", line 137, in _send_request success_response, exception): File "/usr/lib/python2.7/dist-packages/botocore/endpoint.py", line 256, in _needs_retry caught_exception=caught_exception, request_dict=request_dict) File "/usr/lib/python2.7/dist-packages/botocore/hooks.py", line 356, in emit return self._emitter.emit(aliased_event_name, **kwargs) File "/usr/lib/python2.7/dist-packages/botocore/hooks.py", line 228, in emit return self._emit(event_name, kwargs) File "/usr/lib/python2.7/dist-packages/botocore/hooks.py", line 211, in _emit response = handler(**kwargs) File "/usr/lib/python2.7/dist-packages/botocore/retryhandler.py", line 183, in call if self._checker(attempts, response, caught_exception): File "/usr/lib/python2.7/dist-packages/botocore/retryhandler.py", line 251, in call caught_exception) File "/usr/lib/python2.7/dist-packages/botocore/retryhandler.py", line 269, in _should_retry return self._checker(attempt_number, response, caught_exception) File "/usr/lib/python2.7/dist-packages/botocore/retryhandler.py", line 317, in call caught_exception) File "/usr/lib/python2.7/dist-packages/botocore/retryhandler.py", line 223, in call attempt_number, caught_exception) File "/usr/lib/python2.7/dist-packages/botocore/retryhandler.py", line 359, in _check_caught_exception raise caught_exception HTTPClientError: An HTTP Client raised an unhandled exception: 'module' object has no attribute 'raise_from' 2022-12-09 07:44:33,660 - MainThread - awscli.clidriver - DEBUG - Exiting with rc 255

An HTTP Client raised an unhandled exception: 'module' object has no attribute 'raise_from'

1 Answer
0
Accepted Answer

It's difficult to tell but my guess here is "old software".

You're running Amazon Linux 1 which is in a limited support phase so I'd recommend upgrading to Amazon Linux 2 very soon.

It also appears as if you're running an old version of the AWS CLI which is using Python 2.7 which went end of life in 2020.

So please update your operating system and your AWS CLI - version 2 of the CLI is now available.

profile pictureAWS
EXPERT
answered a year ago
  • Thanks ... I upgraded my python version and the problem went away.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions