# Getting Error While starting haproxy

**URL:** <https://discourse.haproxy.org/t/getting-error-while-starting-haproxy/5606>\
**Category:** Help!\
**Created:** [August 14, 2020, 9:36am UTC](https://discourse.haproxy.org/t/getting-error-while-starting-haproxy/5606 "2020-08-14T09:36:04Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kasuncha](https://avatars.discourse-cdn.com/v4/letter/k/e8c25b/32.png) [@kasuncha](https://discourse.haproxy.org/u/kasuncha)\
**Post date:** [August 14, 2020, 9:36am UTC](https://discourse.haproxy.org/t/getting-error-while-starting-haproxy/5606/1 "2020-08-14T09:36:04Z")

</div>

[root@haproxy\_restored haproxy]# haproxy -c -f haproxy.cfg

Configuration file is valid  
[root@haproxy\_restored haproxy]#  
[root@haproxy\_restored haproxy]# systemctl restart haproxy.service  
[root@haproxy\_restored haproxy]# systemctl status haproxy.service  
● haproxy.service - HAProxy Load Balancer  
Loaded: loaded (/usr/lib/systemd/system/haproxy.service; enabled; vendor preset: disabled)  
Active: failed (Result: exit-code) since Fri 2020-08-14 15:04:27 +0530; 4s ago  
Process: 4310 ExecStart=/usr/sbin/haproxy-systemd-wrapper -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid $OPTIONS (code=exited, status=1/FAILURE)  
Main PID: 4310 (code=exited, status=1/FAILURE)

Aug 14 15:04:27 haproxy\_restored haproxy-systemd-wrapper[4310]: [ALERT] 226/150427 (4311) : Starting proxy xcurrent\_coinone1\_l2: cannot bind socket…4:5000]  
Aug 14 15:04:27 haproxy\_restored haproxy-systemd-wrapper[4310]: [ALERT] 226/150427 (4311) : Starting proxy xcurrent\_coinone2\_l2: cannot bind socket…4:3999]  
Aug 14 15:04:27 haproxy\_restored haproxy-systemd-wrapper[4310]: [ALERT] 226/150427 (4311) : Starting proxy xcurrent\_coinone3\_l3: cannot bind socket…4:3002]  
Aug 14 15:04:27 haproxy\_restored haproxy-systemd-wrapper[4310]: [ALERT] 226/150427 (4311) : Starting proxy xcurrent\_coinone4\_l4: cannot bind socket…4:3009]  
Aug 14 15:04:27 haproxy\_restored haproxy-systemd-wrapper[4310]: [ALERT] 226/150427 (4311) : Starting proxy xcurrent\_sabb1\_l1: cannot bind socket [1…44:443]  
Aug 14 15:04:27 haproxy\_restored haproxy-systemd-wrapper[4310]: [ALERT] 226/150427 (4311) : Starting proxy kapruka: cannot bind socket [192.168.5.44:8080]  
Aug 14 15:04:27 haproxy\_restored haproxy-systemd-wrapper[4310]: haproxy-systemd-wrapper: exit, haproxy RC=1  
Aug 14 15:04:27 haproxy\_restored systemd[1]: haproxy.service: main process exited, code=exited, status=1/FAILURE  
Aug 14 15:04:27 haproxy\_restored systemd[1]: Unit haproxy.service entered failed state.  
Aug 14 15:04:27 haproxy\_restored systemd[1]: haproxy.service failed.  
Hint: Some lines were ellipsized, use -l to show in full.  
[root@haproxy\_restored haproxy]#

---

<div class="post-metadata">

**Author:** ![lukastribus](https://avatars.discourse-cdn.com/v4/letter/l/7ea924/32.png) [@lukastribus](https://discourse.haproxy.org/u/lukastribus)\
**Post date:** [August 15, 2020, 7:50am UTC](https://discourse.haproxy.org/t/getting-error-while-starting-haproxy/5606/2 "2020-08-15T07:50:41Z")

</div>

Can you should the output of:

```
haproxy -vv
cat /usr/lib/systemd/system/haproxy.service

```

Also please explain what OS you have and the install history of haproxy here.

---

<div class="post-metadata">

**Author:** ![kasuncha](https://avatars.discourse-cdn.com/v4/letter/k/e8c25b/32.png) [@kasuncha](https://discourse.haproxy.org/u/kasuncha)\
**Post date:** [August 17, 2020, 2:47am UTC](https://discourse.haproxy.org/t/getting-error-while-starting-haproxy/5606/3 "2020-08-17T02:47:33Z")

</div>

> [@lukastribus](#):
>
> `cat /usr/lib/systemd/system/haproxy.service`

[root@haproxy\_restored ~]# haproxy -vv  
HA-Proxy version 1.5.18 2016/05/10  
Copyright 2000-2016 Willy Tarreau [willy@haproxy.org](mailto:willy@haproxy.org)

Build options :  
TARGET = linux2628  
CPU = generic  
CC = gcc  
CFLAGS = -O2 -g -fno-strict-aliasing -DTCP\_USER\_TIMEOUT=18  
OPTIONS = USE\_LINUX\_TPROXY=1 USE\_GETADDRINFO=1 USE\_ZLIB=1 USE\_REGPARM=1 USE\_OPENSSL=1 USE\_PCRE=1

Default settings :  
maxconn = 2000, bufsize = 16384, maxrewrite = 8192, maxpollevents = 200

Encrypted password support via crypt(3): yes  
Built with zlib version : 1.2.7  
Compression algorithms supported : identity, deflate, gzip  
Built with OpenSSL version : OpenSSL 1.0.2k-fips 26 Jan 2017  
Running on OpenSSL version : OpenSSL 1.0.2k-fips 26 Jan 2017  
OpenSSL library supports TLS extensions : yes  
OpenSSL library supports SNI : yes  
OpenSSL library supports prefer-server-ciphers : yes  
Built with PCRE version : 8.32 2012-11-30  
PCRE library supports JIT : no (USE\_PCRE\_JIT not set)  
Built with transparent proxy support using: IP\_TRANSPARENT IPV6\_TRANSPARENT IP\_FREEBIND

Available polling systems :  
epoll : pref=300, test result OK  
poll : pref=200, test result OK  
select : pref=150, test result OK  
Total: 3 (3 usable), will use epoll.

[root@haproxy\_restored ~]# cat /usr/lib/systemd/system/haproxy.service  
[Unit]  
Description=HAProxy Load Balancer  
After=syslog.target network.target

[Service]  
EnvironmentFile=/etc/sysconfig/haproxy  
ExecStart=/usr/sbin/haproxy-systemd-wrapper -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid $OPTIONS  
ExecReload=/bin/kill -USR2 $MAINPID  
KillMode=mixed

[Install]  
WantedBy=multi-user.target  
[root@haproxy\_restored ~]#

[root@haproxy\_restored ~]# cat /etc/redhat-release  
Red Hat Enterprise Linux Server release 7.8 (Maipo)  
[root@haproxy\_restored ~]#

---

<div class="post-metadata">

**Author:** ![lukastribus](https://avatars.discourse-cdn.com/v4/letter/l/7ea924/32.png) [@lukastribus](https://discourse.haproxy.org/u/lukastribus)\
**Post date:** [August 17, 2020, 6:22pm UTC](https://discourse.haproxy.org/t/getting-error-while-starting-haproxy/5606/4 "2020-08-17T18:22:58Z")

</div>

You probably cannot bind to those IP:port combination, either because the IP does not exist or because there already is another application bound to those ports.

Did you check that?

---

<div class="post-metadata">

**Author:** ![kasuncha](https://avatars.discourse-cdn.com/v4/letter/k/e8c25b/32.png) [@kasuncha](https://discourse.haproxy.org/u/kasuncha)\
**Post date:** [August 19, 2020, 9:49am UTC](https://discourse.haproxy.org/t/getting-error-while-starting-haproxy/5606/5 "2020-08-19T09:49:02Z")

</div>

Thanks. It is already bound to another application.
