CNAME conf error. Haproxy fail (sorry)

Hello all,

Sorry for this question, because its surely a newbie question but i am stuck at

haproxy_1 | [ALERT] 107/100013 (16) : parsing [/usr/local/etc/haproxy/haproxy.cfg:76] : ‘server balena_api_1’ : could not resolve address ‘api’.
haproxy_1 | [ALERT] 107/100013 (16) : parsing [/usr/local/etc/haproxy/haproxy.cfg:82] : ‘server balena_registry_1’ : could not resolve address ‘registry’.
haproxy_1 | [ALERT] 107/100013 (16) : parsing [/usr/local/etc/haproxy/haproxy.cfg:88] : ‘server balena_vpn_1’ : could not resolve address ‘vpn’.
haproxy_1 | [ALERT] 107/100013 (16) : parsing [/usr/local/etc/haproxy/haproxy.cfg:94] : ‘server balena_s3_1’ : could not resolve address ‘s3’.
haproxy_1 | [ALERT] 107/100013 (16) : parsing [/usr/local/etc/haproxy/haproxy.cfg:104] : ‘server balena_vpn_1’ : could not resolve address ‘vpn’.
haproxy_1 | [ALERT] 107/100013 (16) : parsing [/usr/local/etc/haproxy/haproxy.cfg:129] : ‘server balena_vpn’ : could not resolve address ‘vpn’.
haproxy_1 | [ALERT] 107/100013 (16) : parsing [/usr/local/etc/haproxy/haproxy.cfg:134] : ‘server balena_vpn’ : could not resolve address ‘vpn’.

I have follow the tutorial stricly, and i really dont get why those addresses are not resolved.
The doc said that i need to conf CNAME according to my server.

So, if my domain is:
edge.mydomain.io (A to the IP of the server)

s3.edge.mydomain.io (CNAME to edge.mydomain.io)
vpn.edge.mydomain.io (CNAME to edge.mydomain.io)
api.edge.mydomain.io (CNAME to edge.mydomain.io)

i tried CNAME and A type. But… haproxy said just the same.

etc…
right ?

Hello, Charles.

Thanks for reaching out to us. We’ve had a few users interested in running haproxy and balena. Check out the starter guides cited in this thread. TL;DR: Users find success in editing/augmenting wifi-connect and creating their own networking config to get this going. Please take a look and let us know how else we can help.

Actullay, i past the OPENBALENA logs of haproxy. It runs on ubuntu… not on Pi. I dont get why it is related to wifi-connect ?

I had the same problem on my Debian 11 VPS, but real reason why it was not working was solved by Services crash without log. · Issue #99 · balena-io/open-balena · GitHub … Hopefully It will help you too.

1 Like

Hello @fromnowhereuser,

from the logs I would assume that this is not an issue with the CNAME or any domain resolution, but a docker compose / compose runtime.

Checking haproxy.cfg from openBalena the server that haproxy is calling is api:80 which is a local domain.

This local domain api is resolved by the docker engine and links to the service name from here:

As openBalena runs from a ‘forged’ docker-compose.yml file, can you please make sure, that the services have the correct names and that all services are correct.
Can you also please share the docker environment that you use to run the openBalena stack?

If you have any chance can you please share the ‘forged’ docker-compose.yml file with everything blacked that you are concerned about to be published?

Best Regards
Harald

Hello,

I just installed a fresh copy of OpenBalena v3.6.0 on a DigitalOcean Droplet running Ubuntu 22.04.
The only difference from the getting started guide is that I installed the latest version of Docker Compose (v2.6.1) instead of the proposed version (v1.27.4).

I had a similar error to this thread as well as this other thread:

I cannot post my full output of ./scripts/compose logs because the problem is now fixed and I forgot to capture the output before, but basically most of the containers would die instantly.

All this to say that this Github comment mentionned by @aleho (Services crash without log. · Issue #99 · balena-io/open-balena · GitHub) fixed my issue !

echo 'GRUB_CMDLINE_LINUX=systemd.unified_cgroup_hierarchy=false' > /etc/default/grub.d/cgroup.cfg
update-grub
reboot