Skip to content
MtrXTools

ECONNREFUSED

Connection refused

Seen in Node.js, Python (ConnectionRefusedError), Java (Connection refused)

The host answered, but nothing is listening on that port, or a firewall actively rejected the connection.

Common causes

  • The service is stopped or crashed.
  • The service listens on a different port, or only on 127.0.0.1.
  • A firewall sends a reject (RST) for the port.

How to fix it

  1. Start the service and check it binds to 0.0.0.0 or the right interface.
  2. Confirm the port number in config and client.
  3. Allow the port in the firewall or security group.
Check the port

Got a different message? Paste it into the error explainer.

Related errors

All 19 Network errors