HAProxy network error: cannot bind socket

By Tech-Assured     
May 5, 2021  360 Views

HAProxy network error: cannot bind socket

If you are getting HAProxy Network Error “cannot bind socket”, then it seems that another process is listening on the same interface and TCP port combination, which is used by HAProxy.

Here at tech-Assured, our Support Engineers have helped our clients with such issues.

Let’s see the causes and fixes to it

Causes for HAProxy network error


  • Another process listens on the same interface and TCP port combination, which is used by HAProxy
  • IP address is not assigned to a network interface

Solution


Troubleshooting with systemctl

Command line for CentOS, Fedora, and RedHat-derived systems:

$ sudo systemctl status haproxy.service -l –no-pager

Troubleshooting with journalctl

Command line for Ubuntu:

$ sudo journalctl -u haproxy.service –since today –no-pager

Command line for CentOS:

$ sudo journalctl -u haproxy.service –since today –no-pager

Troubleshooting with ss and ps utilities:

In order to determine the name of the process which is bound to IPv4 interface on port 80. (Note: Replace 80 with the exact port number from the error message)

$ sudo ss -4 -tlnp | grep 80

Troubleshooting with IP utility:

In order to examine both IPv4 and IPv6 on network interfaces, we need to use following command line

For IPv4:

$ sudo ip -4 -c address show

 

For IPv6:

$ sudo ip -6 -c address show

Ask for helpIf issue still persists, Our Support Engineers at tech assured will find the solution for you.