haproxytech / haproxy-docker-ubuntu

HAProxy CE Docker Ubuntu image
42 stars 21 forks source link

/etc/haproxy/dataplaneapi.hcl: no such file or directory #2

Closed Tadija-Lemax closed 3 years ago

Tadija-Lemax commented 3 years ago

When running docker-compose up -d of a service with image haproxytech/haproxy-ubuntu:latest haproxy fails to start (container immediately exits with code 1).

looking at container logs:

[NOTICE]   (1) : New program 'api' (7) forked
[NOTICE]   (1) : New worker #1 (8) forked
time="2021-05-19T15:54:48Z" level=fatal msg="open /etc/haproxy/dataplaneapi.hcl: no such file or directory"
[NOTICE]   (1) : haproxy version is 2.4.0-6cbbecf
[NOTICE]   (1) : path to executable is /usr/local/sbin/haproxy
[ALERT]    (1) : Current program 'api' (7) exited with code 1 (Exit)
[ALERT]    (1) : exit-on-failure: killing every processes with SIGTERM
[ALERT]    (1) : Current worker #1 (8) exited with code 143 (Terminated)
[WARNING]  (1) : All workers exited. Exiting... (1)

If I change the image to haproxytech/haproxy-ubuntu:2.2.1 Container starts and works normally.

Not sure if related but I can see here: https://github.com/haproxytech/dataplaneapi/releases/tag/v2.3.0 that a feature related to dataplaneapi is added 8 days ago.

dkorunic commented 3 years ago

FIxed by d4622c01cf679620313942f60fad13dbd8fe5e58. Closing.

Tadija-Lemax commented 3 years ago

Just a note that with this fix we changed the way we passed haproxy.cfg file to the container.

Our docker-compose.yml looked like this (we could see and use the container's haproxy folder on our host) :

  haproxy:
    image: haproxytech/haproxy-ubuntu:latest
    volumes:
      - ./configurations/haproxy:/usr/local/etc/haproxy/:rw
    ports:
      - 8080:80
      - 70:70
      - 32768:32768
      - 5555:5555

This interfered with the bugfix in d4622c0 because it would remove the created empty file dataplaneapi.hcl since we don't have it in our host ./configurations/haproxy folder.

If I add an empty dataplaneapi.hcl file to our HAProxy container would start and work normally... I don't like this since we would need to maintain this workaround, empty dataplaneapi.hcl file.

So we changed our docker-compose file to (we copy only the config file and not the whole folder):

  haproxy:
    image: haproxytech/haproxy-ubuntu:latest
    volumes:
      - ./configurations/haproxy/haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg:rw
    ports:
      - 8080:80
      - 70:70
      - 32768:32768
      - 5555:5555

And haproxy container starts and works as expected, but we lost the ability to see the haproxy folder on docker host :(

dkorunic commented 3 years ago

@Tadija-Lemax Next release of the Dataplane, to be more specific v2.3.1 doesn't require an empty dataplaneapi.hcl or dataplaneapi.yml, but I don't think there is any damage of having it in your configurations/haproxy folder on your host, does it?