Healthcheck always shows "starting" #19381
Replies: 13 comments 1 reply
-
Built podman 4.6.0 from source and issue reproduced.
|
Beta Was this translation helpful? Give feedback.
-
I'm also having the same issue. When I run the healthcheck manually |
Beta Was this translation helpful? Give feedback.
-
Podman uses systemd timers to run healtchecks periodically, so if you use a distro without systemd it will not work. |
Beta Was this translation helpful? Give feedback.
-
@Luap99 so is it a bug-feature then? how docker handles it just fine without systemd? |
Beta Was this translation helpful? Give feedback.
-
Well docker runs as a daemon, they can just execute the healtchecks themselves. With podman there is no guarantee that a podman process is around so we need to rely on another process to execute us periodically and systemd fits that well. |
Beta Was this translation helpful? Give feedback.
-
On a non-systemd machine, I would expect Podman to throw an error. At least for the case where users explicitly set health checks via the CLI; I am not sure about the case where Podman uses the checks from the image. |
Beta Was this translation helpful? Give feedback.
-
I don't think we should error with images, #16749 As for errors when they are set on the cli that might make more sense but I am not sure we can really check that that far in the backend where the healthcheck was set. |
Beta Was this translation helpful? Give feedback.
-
I think we could check it in the front end and check whether systemd is available. |
Beta Was this translation helpful? Give feedback.
-
We need to be careful with frontend checks, they will result in false positives when using podman-remote. |
Beta Was this translation helpful? Give feedback.
-
Fair point. It would only fail for local Linux cases. |
Beta Was this translation helpful? Give feedback.
-
It would be nice to mention it here https://podman.io/docs/installation#build-tags as now it says systemd is used for journaling and at least emit some warning that --health-cmd, --health-interval, --health-timeout, --health-retries will do nothing for you if the timers are not implemented. Anyway for now podman cannot be a drop-in replacement for docker as docker-compose breaks on non-systemd systems when you have dependencies and healthchecks. |
Beta Was this translation helpful? Give feedback.
-
YOu could setup cron jobs to fire the checks. But we are taking advantage of systemd for many functions of Podman and this is not likely to change. If you would like to open a PR to change the documentation to advise people on non-systemd machines how to use cron jobs for healthchecks, that would be fine. I am moving this to a discussion since it is not something we plan to fix. |
Beta Was this translation helpful? Give feedback.
-
I appreciate the discussion. I stumbled upon this on my Gentoo system, which uses OpenRC as its init. |
Beta Was this translation helpful? Give feedback.
-
Issue Description
When running a container with podman that defines a health check, the following state is returned.
Steps to reproduce the issue
Steps to reproduce the issue
podman run --health-cmd 'pg_isready -U postgres' --health-interval 10s --health-timeout 5s --health-retries 30 -e POSTGRES_PASSWORD=password docker.io/library/postgres:15.2-alpine
podman inspect $cid "Health": { "Status": "starting", "FailingStreak": 0, "Log": null },
Describe the results you received
podman inspect $cid
"Health": { "Status": "starting", "FailingStreak": 0, "Log": null },
Describe the results you expected
"Health": { "Status": "healthy", "FailingStreak": 0, "Log": null },
podman info output
Podman in a container
No
Privileged Or Rootless
Rootless
Upstream Latest Release
No
Additional environment details
Alpine 3.18.2 running in a Hyper-V VM
Additional information
Additional information like issue happens only occasionally or issue happens with a particular architecture or on a particular setting
Beta Was this translation helpful? Give feedback.
All reactions