OL7: haproxy.service Fails to Start With Error "parsing [/etc/haproxy/haproxy.cfg:86] invalid address"

(Doc ID 2289985.1)

Last updated on AUGUST 17, 2017

Applies to:

Linux OS - Version Oracle Linux 7.0 and later
Linux x86-64

Symptoms

On oracle Linux 7, "haproxy" service fail's to start, if dns names are used for back-end servers in /etc/haproxy/haproxy.cfg.

Aug 15 00:07:24 ol7 haproxy-systemd-wrapper: [ALERT] 226/000723 (1307) : parsing [/etc/haproxy/haproxy.cfg:86] : 'server app1' : invalid address: 'ol6.tux' in 'ol6.tux:100
01'
Aug 15 00:07:24 ol7 haproxy-systemd-wrapper: [ALERT] 226/000723 (1307) : Error(s) found in configuration file : /etc/haproxy/haproxy.cfg
Aug 15 00:07:24 ol7 haproxy-systemd-wrapper: [ALERT] 226/000724 (1307) : Fatal errors found in configuration.
Aug 15 00:07:24 ol7 systemd: haproxy.service: main process exited, code=exited, status=1/FAILURE
Aug 15 00:07:24 ol7 haproxy-systemd-wrapper: haproxy-systemd-wrapper: exit, haproxy RC=1
Aug 15 00:07:24 ol7 systemd: Unit haproxy.service entered failed state.
Aug 15 00:07:24 ol7 systemd: haproxy.service failed.

haproxy Config:

#---------------------------------------------------------------------
# main frontend which proxys to the backends
#---------------------------------------------------------------------
frontend main ol7:8000
acl url_static path_beg -i /static /images /javascript /stylesheets
acl url_static path_end -i .jpg .gif .png .css .js

use_backend static if url_static
default_backend app

#---------------------------------------------------------------------
# static backend for serving up images, stylesheets and such
#---------------------------------------------------------------------
backend static
balance roundrobin
server static 127.0.0.1:4331 check

#---------------------------------------------------------------------
# round robin balancing between the various backends
#---------------------------------------------------------------------
backend app
# balance roundrobin
# server app1 127.0.0.1:5001 check
# server app2 127.0.0.1:5002 check
# server app3 127.0.0.1:5003 check
# server app4 127.0.0.1:5004 check
server app1 testweb:10001

 

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms