Failed to establish a new connection: [Errno -3] Temporary failure in name resolution while calling Lambda from Local machine Python Requests Module

0

While invoking a Lambda Function URL using Python from the local machine, I am getting the Error

Failed to establish a new connection: [Errno -3] Temporary failure in name resolution

I recently started facing this issue while calling Lambda Function from the local environment, which used to work completely fine a while back, using the Same Lambda Function, the Same Lambda Function URL, with the same permissions and all, no change. The URL has no restrictions and can be publicly accessed with CORS enabled.

When I changed my local router connection to a different one, it started working fine. Is it due to some kind of IP blockage from the AWS side? I am even able to invoke the function from a server, or postman in the browser, but local invocation does not work, for ANY Lambda function. Works for EC2 and other services, but lambda seems to be blocked.

Using Python 3.8.10 with the latest version of the requests module. No change is there from the module's point of view.

In Postman, I get

Error: getaddrinfo ENOTFOUND xxxxxxxxx.lambda-url.us-east-1.on.aws

Would appreciate some help on this. Thanks.

1 Answer
0

The error seems to be related to your DNS configuration. Your machine is not able to map the DNS name to an IP address. Try running nslookup to see what you get.

profile pictureAWS
EXPERT
Uri
answered 6 months ago

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