Score:0

Compute engine: getting "Connection refused" on all my instances

in flag

I just checked up on one of my servers to discover it stopped responding to any requests

around 2021-08-31 22:00:16.575 CEST giving:

Failed to connect to search.myapp.com port 443: Connection refused

Upon checking on my server it appears that the VM instance was restarted a day ago (docker show my main container up for only 24h).

This error screams firewall, so I double checked and I have both allow-http and allow-https firewall rules enabled for my instance.

EDIT: so I tried creating another new VM and just running a simple HTTP server, same error, connection refused on both :80 and :443.

What am I missing here ?

Michael Hampton avatar
cz flag
You have to start some service that listens on those ports.
John Hanley avatar
cn flag
Connection Refused typically means that you have reached the VM network stack but no process is listening on the port specified. For example, ports 80 and 443 would have Apache, Nginx, or similar configured to listen on those ports. Log in to the instance and future out what services are running and what ports are configured. Review the system logs (or serial port) and look for warnings or errors related to the services, out of disk space, etc.
Anant Swaraj avatar
cn flag
Ensure that the affiliated firewalls are allowing traffic from 0.0.0.0/0 in TCP ports 80 and 443. If it’s there and you’re still facing problems, SSH to your VM, run 'netstat -a', share the result along with the details of the firewall rules attached with the VPC with which your VMs are attached.
Score:0
cn flag

Have you enabled port 443/80 on your server? Is the server listening on port 443/80? I am asking this because connection refused means the TCP connection on port 443 did not establish so you would need to run a netstat command on the server and doublecheck if the service is lintening on those port and the IPs. Please run the netstat and share your output so we wpuld be able to give a look on it.

Regards

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.