Community Health Toolkit

HAProxy container not started on first launch with docker-compose up

Describe the Bug
When bringing up the compose file from cht-core, I run into the following error:

haproxy   | backend couch-backend2
haproxy   |   balance roundrobin
haproxy   |   server couchdb1 medic-os:5987
haproxy   | [alert] 265/175822 (1) : parseBasic loaded
haproxy   | [alert] 265/175822 (1) : parseCookie loaded
haproxy   | [alert] 265/175822 (1) : replacePassword loaded
haproxy   | [ALERT] 265/175822 (1) : parsing [/usr/local/etc/haproxy/haproxy.cfg:48] : 'server couchdb1' : could not resolve address 'medic-os'.
haproxy   | [ALERT] 265/175822 (1) : parsing [/usr/local/etc/haproxy/haproxy.cfg:52] : 'server couchdb1' : could not resolve address 'medic-os'.
haproxy   | [ALERT] 265/175822 (1) : Failed to initialize server(s) addr.

I need to run docker-compose up on another shell as well to bring up haproxy (no logged errors)

haproxy   | frontend http-in2
haproxy   |   bind  *:5986
haproxy   |   default_backend couch-backend2
haproxy   | 
haproxy   | backend couch-backend
haproxy   |   balance roundrobin
haproxy   |   server couchdb1 medic-os:5985
haproxy   | 
haproxy   | backend couch-backend2
haproxy   |   balance roundrobin
haproxy   |   server couchdb1 medic-os:5987

Environment

  • Instance: Local docker setup
  • Browser: N?A
  • Client platform: MacOS Big Sur (11.6)
  • Docker For Mac Version Details: v4.0.1, compose v2.0.0-rc3

@derick - Thanks for posting this! While this is a known issue, I’m sorry you’re having troubles with it. It’s been documented in tickets like this one already.

Long term, we’re planning improvements to the architecture of the CHT in architecture 3.0 scheduled for CHT 4.0. Container orchestration will be greatly improved and startup issues, like the one your having now, should be resolved.

In the immediate term, the Product Team is hoping to improve architecture 2.0 with the CHT Docker Compose Helper. I’ve been using it as my daily driver for many weeks now. This helper script is currently in public beta and any feedback is very welcome!

It’s noteworthy that this helper script addresses the symptom of a failure, and not the cause. While not ideal, it does give us a chance to keep architecture 2.0 as is and work on improving it in architecture 3.0. Further, the simplified UI that the helper script has presented, is being looked at to possibly implement in 3.0 too.

1 Like