question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

boto3 tries to use non-existing URL for support service

See original GitHub issue

Describe the bug If the AWS_REGION is set to us-west-2 and an make a support client call, you will get an error: EndpointConnectionError: Could not connect to the endpoint URL: “https://support.us-west-2.amazonaws.com/

Steps to reproduce set AWS_REGION to us-west-2 and try to use support API, you can reproduce this with aws tool as well

Expected behavior Call should work. There’s a workaround is to use us-east-1 as a region, since support isn’t specific to given region, but users shouldn’t need to override the region.

Debug logs

[ERROR] EndpointConnectionError: Could not connect to the endpoint URL: "https://support.us-west-2.amazonaws.com/"
Traceback (most recent call last):
  File "/var/task/index.py", line 68, in lambda_handler
    case_id = open_support_ticket(account_id, company_name, cc_emails)
  File "/var/task/index.py", line 35, in open_support_ticket
    issueType="customer-service",
  File "/var/runtime/botocore/client.py", line 316, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/var/runtime/botocore/client.py", line 613, in _make_api_call
    operation_model, request_dict, request_context)
  File "/var/runtime/botocore/client.py", line 632, in _make_request
    return self._endpoint.make_request(operation_model, request_dict)
  File "/var/runtime/botocore/endpoint.py", line 102, in make_request
    return self._send_request(request_dict, operation_model)
  File "/var/runtime/botocore/endpoint.py", line 137, in _send_request
    success_response, exception):
  File "/var/runtime/botocore/endpoint.py", line 231, in _needs_retry
    caught_exception=caught_exception, request_dict=request_dict)
  File "/var/runtime/botocore/hooks.py", line 356, in emit
    return self._emitter.emit(aliased_event_name, **kwargs)
  File "/var/runtime/botocore/hooks.py", line 228, in emit
    return self._emit(event_name, kwargs)
  File "/var/runtime/botocore/hooks.py", line 211, in _emit
    response = handler(**kwargs)
  File "/var/runtime/botocore/retryhandler.py", line 183, in __call__
    if self._checker(attempts, response, caught_exception):
  File "/var/runtime/botocore/retryhandler.py", line 251, in __call__
    caught_exception)
  File "/var/runtime/botocore/retryhandler.py", line 277, in _should_retry
    return self._checker(attempt_number, response, caught_exception)
  File "/var/runtime/botocore/retryhandler.py", line 317, in __call__
    caught_exception)
  File "/var/runtime/botocore/retryhandler.py", line 223, in __call__
    attempt_number, caught_exception)
  File "/var/runtime/botocore/retryhandler.py", line 359, in _check_caught_exception
    raise caught_exception
  File "/var/runtime/botocore/endpoint.py", line 200, in _do_get_response
    http_response = self._send(request)
  File "/var/runtime/botocore/endpoint.py", line 244, in _send
    return self.http_session.send(request)
  File "/var/runtime/botocore/httpsession.py", line 283, in send
    raise EndpointConnectionError(endpoint_url=request.url, error=e)

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:2
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
swetashrecommented, Jun 26, 2020

@takeda - I would create ticket to service team about the issue to see what they are thinking of adding isRegionalized parameter to the endpoint . I will post here when i get any update.

1reaction
takedacommented, Jun 25, 2020

@swetashre I should have provide more context. This error appeared when I deployed a lambda code into us-west-2. The code crashed, with the error and the workaround was to force a different region i.e. change:

support = boto3.client("support")

into this:

support = boto3.Session(region_name="us-east-1").client("support")

I think for this service boto should just ignore region defined in AWS_DEFAULT_REGION and always send requests to https://support.us-east-1.amazonaws.com since it is a global service. I don’t think it is a good practice to make workarounds like this in code.

Read more comments on GitHub >

github_iconTop Results From Across the Web

class IAM. Client - Boto3 Docs 1.26.33 documentation
If you try to submit a URL that has already been used for an OpenID Connect provider in the Amazon Web Services account,...
Read more >
Boto3 not directing to the endpoint_url - Stack Overflow
I'm currently trying to connect to my enterprise s3 URL (which is not amazon web-service) using boto3 and I have the following error....
Read more >
Let's Try Again: Making Retries Work With Cloud Services
We then explore their interaction with rate limits and show the Python code for configuring boto3 to gracefully handle that case. Along the...
Read more >
An Introduction to boto's S3 interface — boto v2.49.0
This tutorial focuses on the boto interface to the Simple Storage Service from ... The example below makes use of the FileChunkIO module,...
Read more >
boto3 python example
Boto is a software development kit (SDK) designed to enhance the use of the Python programming language by Amazon Web Services. Using Boto3,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found