Turn on Haproxy

Hello,
I can't run the Haproxy. Do you have any idea how to turn it on?

Thank you.
OctoPrint version : 1.3.6
OctoPi version : 0.14.0

It's a lot easier to read if you paste the text in.

Look in /var/log/haproxy.log to see if there are errors.

Okay here is the log. But I really have no idea what is going on.

Jun 21 09:49:51 octopi haproxy-systemd-wrapper[888]: haproxy-systemd-wrapper: executing /usr/sbin/haproxy -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid -Ds
Jun 21 09:49:51 octopi haproxy-systemd-wrapper[888]: [WARNING] 171/094951 (890) : Setting tune.ssl.default-dh-param to 1024 by default, if your workload permits it you should set it to at least 2048. Please set a value >= 1024 to make t$
Jun 21 09:49:49 octopi haproxy-systemd-wrapper[708]: haproxy-systemd-wrapper: executing /usr/sbin/haproxy -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid -Ds
Jun 21 09:49:49 octopi haproxy-systemd-wrapper[708]: [WARNING] 171/094949 (710) : Setting tune.ssl.default-dh-param to 1024 by default, if your workload permits it you should set it to at least 2048. Please set a value >= 1024 to make t$
Jun 21 09:49:49 octopi haproxy-systemd-wrapper[705]: haproxy-systemd-wrapper: executing /usr/sbin/haproxy -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid -Ds
Jun 21 09:49:49 octopi haproxy-systemd-wrapper[705]: [WARNING] 171/094949 (706) : Setting tune.ssl.default-dh-param to 1024 by default, if your workload permits it you should set it to at least 2048. Please set a value >= 1024 to make t$
Jun 21 09:49:47 octopi haproxy-systemd-wrapper[669]: haproxy-systemd-wrapper: executing /usr/sbin/haproxy -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid -Ds
Jun 21 09:49:47 octopi haproxy-systemd-wrapper[669]: [WARNING] 171/094947 (671) : Setting tune.ssl.default-dh-param to 1024 by default, if your workload permits it you should set it to at least 2048. Please set a value >= 1024 to make t$
Jun 21 10:00:47 octopi haproxy-systemd-wrapper[669]: haproxy-systemd-wrapper: SIGINT -> 675
Jun 21 10:00:47 octopi haproxy-systemd-wrapper[669]: haproxy-systemd-wrapper: exit, haproxy RC=0
Jun 21 10:01:21 octopi204 haproxy-systemd-wrapper[694]: haproxy-systemd-wrapper: executing /usr/sbin/haproxy -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid -Ds
Jun 21 10:01:21 octopi204 haproxy-systemd-wrapper[694]: [WARNING] 171/100121 (698) : Setting tune.ssl.default-dh-param to 1024 by default, if your workload permits it you should set it to at least 2048. Please set a value >= 1024 to mak$
Jun 21 10:11:28 octopi204 haproxy-systemd-wrapper[694]: haproxy-systemd-wrapper: SIGINT -> 699
Jun 21 10:11:28 octopi204 haproxy-systemd-wrapper[694]: haproxy-systemd-wrapper: exit, haproxy RC=0
Jun 21 10:12:02 octopi204 haproxy-systemd-wrapper[678]: haproxy-systemd-wrapper: executing /usr/sbin/haproxy -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid -Ds
Jun 21 10:12:02 octopi204 haproxy-systemd-wrapper[678]: [WARNING] 171/101202 (681) : Setting tune.ssl.default-dh-param to 1024 by default, if your workload permits it you should set it to at least 2048. Please set a value >= 1024 to mak$
Jun 21 10:25:34 octopi204 haproxy-systemd-wrapper[678]: haproxy-systemd-wrapper: SIGINT -> 682
Jun 21 10:25:34 octopi204 haproxy-systemd-wrapper[678]: haproxy-systemd-wrapper: exit, haproxy RC=0
Jun 21 10:25:45 octopi204 haproxy-systemd-wrapper[741]: haproxy-systemd-wrapper: executing /usr/sbin/haproxy -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid -Ds
Jun 21 10:25:45 octopi204 haproxy-systemd-wrapper[741]: [WARNING] 171/102545 (743) : Setting tune.ssl.default-dh-param to 1024 by default, if your workload permits it you should set it to at least 2048. Please set a value >= 1024 to mak$
Mar 18 20:50:23 octopi204 haproxy-systemd-wrapper[741]: haproxy-systemd-wrapper: SIGINT -> 744
Mar 18 20:50:23 octopi204 haproxy-systemd-wrapper[741]: haproxy-systemd-wrapper: exit, haproxy RC=0
Mar 18 20:50:34 octopi204 haproxy-systemd-wrapper[795]: haproxy-systemd-wrapper: executing /usr/sbin/haproxy -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid -Ds
Mar 18 20:50:34 octopi204 haproxy-systemd-wrapper[795]: [WARNING] 076/205034 (796) : Setting tune.ssl.default-dh-param to 1024 by default, if your workload permits it you should set it to at least 2048. Please set a value >= 1024 to mak$
Mar 19 00:07:24 octopi204 haproxy-systemd-wrapper[795]: haproxy-systemd-wrapper: SIGINT -> 799
Mar 19 00:07:24 octopi204 haproxy-systemd-wrapper[795]: haproxy-systemd-wrapper: exit, haproxy RC=0
Mar 19 00:07:36 octopi204 haproxy-systemd-wrapper[816]: haproxy-systemd-wrapper: executing /usr/sbin/haproxy -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid -Ds
Mar 19 00:07:36 octopi204 haproxy-systemd-wrapper[816]: [WARNING] 077/000736 (819) : Setting tune.ssl.default-dh-param to 1024 by default, if your workload permits it you should set it to at least 2048. Please set a value >= 1024 to mak$
Mar 19 01:01:08 octopi204 haproxy-systemd-wrapper[816]: haproxy-systemd-wrapper: SIGINT -> 821
Mar 19 01:01:08 octopi204 haproxy-systemd-wrapper[816]: haproxy-systemd-wrapper: exit, haproxy RC=0
Mar 19 01:01:20 octopi204 haproxy-systemd-wrapper[812]: haproxy-systemd-wrapper: executing /usr/sbin/haproxy -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid -Ds
Mar 19 01:01:20 octopi204 haproxy-systemd-wrapper[812]: [WARNING] 077/010120 (816) : Setting tune.ssl.default-dh-param to 1024 by default, if your workload permits it you should set it to at least 2048. Please set a value >= 1024 to mak$
Mar 19 01:01:19 octopi204 haproxy-systemd-wrapper[808]: haproxy-systemd-wrapper: executing /usr/sbin/haproxy -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid -Ds
Mar 19 01:01:19 octopi204 haproxy-systemd-wrapper[808]: [WARNING] 077/010119 (809) : Setting tune.ssl.default-dh-param to 1024 by default, if your workload permits it you should set it to at least 2048. Please set a value >= 1024 to mak$
Mar 19 01:18:27 octopi204 haproxy-systemd-wrapper[808]: haproxy-systemd-wrapper: SIGINT -> 811
Mar 19 01:18:27 octopi204 haproxy-systemd-wrapper[808]: haproxy-systemd-wrapper: exit, haproxy RC=0
Mar 19 01:18:41 octopi204 haproxy-systemd-wrapper[827]: haproxy-systemd-wrapper: executing /usr/sbin/haproxy -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid -Ds
Mar 19 01:18:41 octopi204 haproxy-systemd-wrapper[827]: [WARNING] 077/011841 (829) : Setting tune.ssl.default-dh-param to 1024 by default, if your workload permits it you should set it to at least 2048. Please set a value >= 1024 to mak$
Mar 19 01:18:41 octopi204 haproxy-systemd-wrapper[827]: [ALERT] 077/011841 (829) : Starting frontend public: cannot bind socket [0.0.0.0:8080]
Mar 19 01:18:41 octopi204 haproxy-systemd-wrapper[827]: haproxy-systemd-wrapper: exit, haproxy RC=256
Mar 19 01:18:41 octopi204 haproxy-systemd-wrapper[847]: haproxy-systemd-wrapper: executing /usr/sbin/haproxy -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid -Ds
Mar 19 01:18:42 octopi204 haproxy-systemd-wrapper[847]: [WARNING] 077/011841 (848) : Setting tune.ssl.default-dh-param to 1024 by default, if your workload permits it you should set it to at least 2048. Please set a value >= 1024 to mak$
Mar 19 01:18:42 octopi204 haproxy-systemd-wrapper[847]: [ALERT] 077/011841 (848) : Starting frontend public: cannot bind socket [0.0.0.0:8080]
Mar 19 01:18:42 octopi204 haproxy-systemd-wrapper[847]: haproxy-systemd-wrapper: exit, haproxy RC=256
Mar 19 01:18:42 octopi204 haproxy-systemd-wrapper[857]: haproxy-systemd-wrapper: executing /usr/sbin/haproxy -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid -Ds
Mar 19 01:18:42 octopi204 haproxy-systemd-wrapper[857]: [WARNING] 077/011842 (858) : Setting tune.ssl.default-dh-param to 1024 by default, if your workload permits it you should set it to at least 2048. Please set a value >= 1024 to mak$
Mar 19 01:18:42 octopi204 haproxy-systemd-wrapper[857]: [ALERT] 077/011842 (858) : Starting frontend public: cannot bind socket [0.0.0.0:8080]
Mar 19 01:18:42 octopi204 haproxy-systemd-wrapper[857]: haproxy-systemd-wrapper: exit, haproxy RC=256
Mar 19 01:18:42 octopi204 haproxy-systemd-wrapper[863]: haproxy-systemd-wrapper: executing /usr/sbin/haproxy -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid -Ds
Mar 19 01:18:42 octopi204 haproxy-systemd-wrapper[863]: [WARNING] 077/011842 (864) : Setting tune.ssl.default-dh-param to 1024 by default, if your workload permits it you should set it to at least 2048. Please set a value >= 1024 to mak$
Mar 19 01:18:42 octopi204 haproxy-systemd-wrapper[863]: [ALERT] 077/011842 (864) : Starting frontend public: cannot bind socket [0.0.0.0:8080]
Mar 19 01:18:42 octopi204 haproxy-systemd-wrapper[863]: haproxy-systemd-wrapper: exit, haproxy RC=256
Mar 19 01:18:43 octopi204 haproxy-systemd-wrapper[869]: haproxy-systemd-wrapper: executing /usr/sbin/haproxy -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid -Ds
Mar 19 01:18:43 octopi204 haproxy-systemd-wrapper[869]: [WARNING] 077/011843 (870) : Setting tune.ssl.default-dh-param to 1024 by default, if your workload permits it you should set it to at least 2048. Please set a value >= 1024 to mak$
Mar 19 01:18:43 octopi204 haproxy-systemd-wrapper[869]: [ALERT] 077/011843 (870) : Starting frontend public: cannot bind socket [0.0.0.0:8080]
Mar 19 01:18:43 octopi204 haproxy-systemd-wrapper[869]: haproxy-systemd-wrapper: exit, haproxy RC=256

From terminal.

sudo service haproxy status
● haproxy.service - HAProxy Load Balancer
Loaded: loaded (/lib/systemd/system/haproxy.service; enabled)
Active: failed (Result: start-limit) since Mon 2018-03-19 22:38:51 UTC; 33min ago
Docs: man:haproxy(1)
file:/usr/share/doc/haproxy/configuration.txt.gz
Process: 838 ExecStartPre=/usr/sbin/haproxy -f ${CONFIG} -c -q (code=exited, status=1/FAILURE)

Mar 19 22:38:51 octopi204 systemd[1]: haproxy.service: control process exited, code=exited status=1
Mar 19 22:38:51 octopi204 systemd[1]: Failed to start HAProxy Load Balancer.
Mar 19 22:38:51 octopi204 systemd[1]: Unit haproxy.service entered failed state.
Mar 19 22:38:51 octopi204 systemd[1]: haproxy.service holdoff time over, scheduling restart.
Mar 19 22:38:51 octopi204 systemd[1]: Stopping HAProxy Load Balancer...
Mar 19 22:38:51 octopi204 systemd[1]: Starting HAProxy Load Balancer...
Mar 19 22:38:51 octopi204 systemd[1]: haproxy.service start request repeated too quickly, refusing to start.
Mar 19 22:38:51 octopi204 systemd[1]: Failed to start HAProxy Load Balancer.
Mar 19 22:38:51 octopi204 systemd[1]: Unit haproxy.service entered failed state.

"cannot bind socket" implies it is running. Any results from ps waxu | grep haproxy?

Starting frontend public: cannot bind socket [0.0.0.0:8080]

Let me guess. You tried to change the port haproxy is listening on. That's fine in principle but you changed it to the port that the webcam server is already listening on. That's why it now won't start, you can't have two servers on the same port. Change it back to 80 instead of 8080 and all will work again. Or change it to any other port, but not one that is already in use.

In the future please include such details in your initial problem description ("I changed the port to 8080...")

1 Like

Something like this:
pi@octopi:~ $ ps waxu | grep haproxy
pi 1043 0.0 0.2 4272 1848 pts/0 S+ 22:46 0:00 grep --color=auto haproxy

Yes. But then I changed everything back and it does not work anymore.