AWS CLI: cloudformation deploy: Connection was closed before we received a valid response from endpoint URL

0

I am trying to deploy my cloudformation stack using the aws cli as I did many times before. Since a couple of hours I am getting the following error code after around 2 seconds: Connection was closed before we received a valid response from endpoint URL: "https://cloudformation.eu-central-1.amazonaws.com/".

I have checked my internet connection and firewalls. Using the same internet connection as I did when it worked fine on friday afternoon. Any ideas what might be the issue?

I am using aws cli verison: aws-cli/2.11.15 Python/3.11.3 Darwin/22.3.0 exe/x86_64 prompt/off

And I am on MacOS 13.2 on an Apple Silicon M2.

asked a year ago447 views
1 Answer
0

The most common error causes for: - Connection was closed before we received a valid response from endpoint URL: ... are the next ones:

  • Network Connectivity issues
  • Firewall block
  • Packet filtering
  • The remote API you called takes very long to respond or it is unreachable.
  • Internet access issue in VPC etc

Basically, this type of issue usually happens when there is a network issue from the client side.

To get to the bottom of the problem I recommend you use the following commands in your CLI:

  • time telnet cloudformation.eu-central-1.amazonaws.com 443 This command, will tell you how much time does your server keeps the connection open while a query response is sent by cloudformation.

  • netstat The route print command will fetch us the route table on your instance which will give us an idea if there is anything on the instance blocking the subnet.

You can also perform a nslookup or dig on the endpoint to check if there are any DNS issues.

Finally, you can run the --debug parameter in your CLI command that deploys CF to check the logs (Troubleshooting CLI errors).

profile pictureAWS
answered a year 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