Skip to content

Healthcheck for web container fails! #150

Open

Description

@Netzvamp

There is an urgent error that crashes openproject docker compose deployments:

There is no curl anymore in the app container image, so the health checks fail and autoheal is restarting the web container, but they don't come up again.

web:
    ...
    labels:
      - autoheal=true
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:8080${OPENPROJECT_RAILS__RELATIVE__URL__ROOT:-}/health_checks/default"]
      interval: 10s
      timeout: 3s
      retries: 3
      start_period: 30s
root@docker1:/docker/openproject# docker inspect openproject-web-1 --format '{{json .State.Health}}'
{"Status":"unhealthy","FailingStreak":79,"Log":[{"Start":"2026-03-11T15:36:43.524098518+01:00","End":"2026-03-11T15:36:43.60891546+01:00","ExitCode":-1,"Output":"OCI runtime exec failed: exec failed: unable to start container process: exec: \"curl\": executable file not found in $PATH"},{"Start":"2026-03-11T15:36:53.610644642+01:00","End":"2026-03-11T15:36:53.721577561+01:00","ExitCode":-1,"Output":"OCI runtime exec failed: exec failed: unable to start container process: exec: \"curl\": executable file not found in $PATH"},{"Start":"2026-03-11T15:37:03.723026179+01:00","End":"2026-03-11T15:37:03.847926613+01:00","ExitCode":-1,"Output":"OCI runtime exec failed: exec failed: unable to start container process: exec: \"curl\": executable file not found in $PATH"},{"Start":"2026-03-11T15:37:13.850434569+01:00","End":"2026-03-11T15:37:14.035559271+01:00","ExitCode":-1,"Output":"OCI runtime exec failed: exec failed: unable to start container process: exec: \"curl\": executable file not found in $PATH"},{"Start":"2026-03-11T15:37:24.036825754+01:00","End":"2026-03-11T15:37:24.19010835+01:00","ExitCode":-1,"Output":"OCI runtime exec failed: exec failed: unable to start container process: exec: \"curl\": executable file not found in $PATH"}]}
root@docker1:/docker/openproject# docker exec -it openproject-web-1 bash
app@openproject:/app$ curl
bash: curl: command not found

I've fixed it by commenting out the "autoheal=true", but we need curl in the container.

Activity

  1. changed the title [-]Healthchecks for web fails![/-] [+]Healthcheck for web fails![/+] on Mar 11, 2026
  2. changed the title [-]Healthcheck for web fails![/-] [+]Healthcheck for web container fails![/+] on Mar 11, 2026
  3. CodeDok commented on Mar 11, 2026

    @CodeDok

    One possible workaround currently is using wget:

    test: ["CMD-SHELL", "wget -q --spider http://localhost:8080${OPENPROJECT_RAILS__RELATIVE__URL__ROOT:-}/health_checks/default || exit 1"]
    
  4. bwildenhain commented on Mar 12, 2026

    @bwildenhain

    No, that doesn't work, as the container contains neither curl nor wget.

  5. CodeDok commented on Mar 12, 2026

    @CodeDok

    Might depend on the tag you use. Im using the "full" version without slim and it works fine. I searched in /usr/bin/ for available options first:

    Image
  6. bwildenhain commented on Mar 12, 2026

    @bwildenhain

    Okay, I am using slim, which has at least Perl (without LWP), so I used the following script to check instead (see attachment, also includes changes for postgres17)

    docker-compose.override.yml.txt

        test: ["CMD", "perl", "-MIO::Socket::INET", "-e", "'$$s=IO::Socket::INET->new(PeerAddr=>\"localhost:8080\",Timeout=>5)or die;$$s->print(\"GET /health_checks/default HTTP/1.0\r\nHost: localhost\r\n\r\n\");$$r=join(\"\",<$$s>);exit($$r!~/PASSED/)'"]
    
  7. ukberry commented on Mar 12, 2026

    @ukberry

    Similar to the approach provided by @bwildenhain I modified the test command to get this working on my local install. I chose ruby since the container is guaranteed to have ruby installed.

    test: ["CMD", "ruby", "-e", "require 'net/http'; exit 1 unless Net::HTTP.get_response(URI('http://localhost:8080/health_checks/default')).is_a?(Net::HTTPSuccess)"]
    

    I have provided a pull request to my changes if it helps progress a fix.

  8. DuaelFr commented on Aug 5, 2026

    @DuaelFr

    It seems that the 17-slim images now have curl 🤷

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions