I hided real IPv6 addresses in this question.
I set a backend config in /etc/haproxy/haproxy.cfg:
# ...
frontend app
bind *:8000
default_backend app
backend app
balance roundrobin
server server1 [IPv6 address1 here]:8000 check
server server2 [IPv6 address2 here]:8000 check
After start the haproxy service, check the status got failed:
$ sudo systemctl start haproxy
$ sudo systemctl status haproxy
...
Jan 10 15:00:36 myserver haproxy-systemd-wrapper[6330]: [ALERT] 009/150036 (6331) : parsing [/etc/haproxy/haproxy.cfg:91] : 'server server1' : invalid address: '[IPv6 address1 here]:8080'
Jan 10 15:00:36 myserver haproxy-systemd-wrapper[6330]: [ALERT] 009/150036 (6331) : parsing [/etc/haproxy/haproxy.cfg:92] : 'server server2' : invalid address: '[IPv6 address2 here]:8080'
Jan 10 15:00:37 myserver haproxy-systemd-wrapper[6330]: [ALERT] 009/150036 (6331) : Error(s) found in configuration file : /etc/haproxy/haproxy.cfg
Jan 10 15:00:37 myserver haproxy-systemd-wrapper[6330]: [ALERT] 009/150037 (6331) : Fatal errors found in configuration.
Jan 10 15:00:37 myserver haproxy-systemd-wrapper[6330]: haproxy-systemd-wrapper: exit, haproxy RC=1
Jan 10 15:00:37 myserver systemd[1]: haproxy.service: main process exited, code=exited, status=1/FAILURE
Jan 10 15:00:37 myserver systemd[1]: Unit haproxy.service entered failed state.
Jan 10 15:00:37 myserver systemd[1]: haproxy.service failed.
I think the usage of IPv6 setting is like: [2001:0db8:85a3:0000:0000:8a2e:0370:7334]:8000. Why that's the invalid address in this case?
I think HAProxy does not support square brackets as part of the IPv6 address. Be sure to specify the port number always, or add a trailing colon if you want to use the default port. So in your case, you would have 9 components (8 for the IP and one for the port) and no brackets. There might be a shorter representation of the IPv6 address, but better to specify all of the components.