Closed car51901 closed 1 year ago
Looking
@car51901 Can you please provide a Dockerfile and do podman inspect <container_name>
?
dockerfile, note the base image defines "HEALTHCHECK NONE"
FROM dev.registry/common/ubi8-openjdk-11-runtime:1.0.2-332 COPY target/webservices.jar /app.jar ENTRYPOINT ["sh", "-c", "java $JAVA_OPTS -Djava.security.egd=file:/dev/.urandom -jar /app.jar"]
from container inspect
[ { "Id": "efd56fd0f344651747aa5aeb6da31ee8a2002dcb6cb3cc14b600981ac4e84428", "Created": "2023-06-12T12:18:28.28906165-05:00", "Path": "sh", "Args": [ "-c", "java $JAVA_OPTS -Djava.security.egd=file:/dev/.urandom -jar /app.jar" ], "State": { "OciVersion": "1.1.0-rc.1", "Status": "running", "Running": true, "Paused": false, "Restarting": false, "OOMKilled": false, "Dead": false, "Pid": 4072175, "ConmonPid": 4072164, "ExitCode": 0, "Error": "", "StartedAt": "2023-06-12T12:18:28.479863184-05:00", "FinishedAt": "0001-01-01T00:00:00Z", "Health": { "Status": "", "FailingStreak": 0, "Log": null }, "CgroupPath": "/user.slice/user-1001.slice/session-27437.scope", "CheckpointedAt": "0001-01-01T00:00:00Z", "RestoredAt": "0001-01-01T00:00:00Z" }, "Image": "1e871d881ea853ad65ca0c68afcc40137083563f01d547e3d4ccd86ba249304f", "ImageDigest": "sha256:d3c3ed047f3a322209803f9c7ae461270b121f7bb211c2e1b33f04cb5a16a139", "ImageName": "webservices:2023.04.5-SNAPSHOT", "Rootfs": "", "Pod": "", "RestartCount": 0, "Driver": "overlay", "MountLabel": "", "ProcessLabel": "", "AppArmorProfile": "", "EffectiveCaps": null, "BoundingCaps": [ "CAP_CHOWN", "CAP_DAC_OVERRIDE", "CAP_FOWNER", "CAP_FSETID", "CAP_KILL", "CAP_NET_BIND_SERVICE", "CAP_NET_RAW", "CAP_SETFCAP", "CAP_SETGID", "CAP_SETPCAP", "CAP_SETUID", "CAP_SYS_CHROOT" ], "ExecIDs": [], "Dependencies": [], "NetworkSettings": { "EndpointID": "", "Gateway": "", "IPAddress": "", "IPPrefixLen": 0, "IPv6Gateway": "", "GlobalIPv6Address": "", "GlobalIPv6PrefixLen": 0, "MacAddress": "", "Bridge": "", "SandboxID": "", "HairpinMode": false, "LinkLocalIPv6Address": "", "LinkLocalIPv6PrefixLen": 0, "Ports": { "8080/tcp": [ { "HostIp": "", "HostPort": "8493" } ], "8443/tcp": null }, }, "Namespace": "", "IsInfra": false, "IsService": false, "Config": { "Hostname": "efd56fd0f344", "Domainname": "", "User": "185:0", "AttachStdin": false, "AttachStdout": false, "AttachStderr": false, "Tty": false, "OpenStdin": false, "StdinOnce": false, "Env": [ "JAVA_DATA_DIR=/deployments/data", "maintainer": "Red Hat OpenJDK openjdk@redhat.com", "name": "ubi8/openjdk-11-runtime", "org.jboss.product": "openjdk", "org.jboss.product.openjdk.version": "11", "org.jboss.product.version": "11", "release": "12.1675788327", "summary": "Image for Red Hat OpenShift providing OpenJDK 11 runtime", "url": "https://access.redhat.com/containers/#/registry.access.redhat.com/ubi8/openjdk-11-runtime/images/1.14-12.1675788327", "vcs-ref": "1d6d54438b510cefbe66061c3cf846f0f071658b", "vcs-type": "git", "vendor": "Red Hat, Inc.", "version": "1.14" }, "Annotations": { "io.container.manager": "libpod", "org.opencontainers.image.stopSignal": "15" }, "StopSignal": 15, "Healthcheck": { "Test": [ "NONE" ], "Timeout": 30000000000, "Retries": 3 }, "HealthcheckOnFailureAction": "none", "CreateCommand": [ "podman", "container", "run", "--name", "container", "--detach=True", "--publish", "8493:8080", "--user", "185:0", "--healthcheck-command", "none", "--healthcheck-interval", "disable", ], "Umask": "0022", "Timeout": 0, "StopTimeout": 10, "Passwd": true, "sdNotifyMode": "container" }, "HostConfig": { "CgroupManager": "cgroupfs", "CgroupMode": "host", "ContainerIDFile": "", "LogConfig": { "Type": "k8s-file", "Config": null, "Tag": "", "Size": "0B" }, "NetworkMode": "slirp4netns", "PortBindings": { "8080/tcp": [ { "HostIp": "", "HostPort": "8493" } ] }, "RestartPolicy": { "Name": "", "MaximumRetryCount": 0 }, "AutoRemove": false, "VolumeDriver": "", "VolumesFrom": null, "CapAdd": [], "CapDrop": [], "Dns": [], "DnsOptions": [], "DnsSearch": [], "ExtraHosts": [], "GroupAdd": [], "IpcMode": "shareable", "Cgroup": "", "Cgroups": "default", "Links": null, "OomScoreAdj": 0, "PidMode": "private", "Privileged": false, "PublishAllPorts": false, "ReadonlyRootfs": false, "SecurityOpt": [], "Tmpfs": {}, "UTSMode": "private", "UsernsMode": "", "ShmSize": 65536000, "Runtime": "oci", "ConsoleSize": [ 0, 0 ], "Isolation": "", "CpuShares": 0, "Memory": 0, "NanoCpus": 0, "CgroupParent": "", "BlkioWeight": 0, "BlkioWeightDevice": null, "BlkioDeviceReadBps": null, "BlkioDeviceWriteBps": null, "BlkioDeviceReadIOps": null, "BlkioDeviceWriteIOps": null, "CpuPeriod": 0, "CpuQuota": 0, "CpuRealtimePeriod": 0, "CpuRealtimeRuntime": 0, "CpusetCpus": "", "CpusetMems": "", "Devices": [], "DiskQuota": 0, "KernelMemory": 0, "MemoryReservation": 0, "MemorySwap": 0, "MemorySwappiness": 0, "OomKillDisable": false, "PidsLimit": 0, "Ulimits": [], "CpuCount": 0, "CpuPercent": 0, "IOMaximumIOps": 0, "IOMaximumBandwidth": 0, "CgroupConf": null } } ]
@car51901 can you check please if #618 helps you?
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
exception thrown trying to process state of running container, when playbook trying to determine if the container needs to be created. Verified that this happens when the image declares "HEALTHCHECK none" in the dockerfile. Appears the module expects that there's a health check command.
Steps to reproduce the issue:
Create an image, that declares "HEALTHCHECK none" in the docker file, and create image.
Create playbook that uses the podman_container module, don't create/configure any healthcheck properties in the playook
Run the playbook to create container, then run playbook again with running container.
Describe the results you received:
playbook fails, Exception, list index out of range
Describe the results you expected:
expected on 2nd run, no configuration changes made, playbook doesn't change container, completes successfully
Additional information you deem important (e.g. issue happens only occasionally):
Happens when image defined with "healthcheck none". note podman doesn't seem to recognize this either, it creates a systemd healtcheck entry, even though there's actually no healthcheck.
Version of the
containers.podman
collection: Either git commit if installed from git:git show --summary
Or version fromansible-galaxy
if installed from galaxy:ansible-galaxy collection list | grep containers.podman
can't run from ansible tower, should be 1.10.1
Output of
ansible --version
:Output of
podman version
:Output of
podman info --debug
:Package info (e.g. output of
rpm -q podman
orapt list podman
):Playbok you run with ansible (e.g. content of
playbook.yaml
):Command line and output of ansible run with high verbosity
Please NOTE: if you submit a bug about idempotency, run the playbook with
--diff
option, like:ansible-playbook -i inventory --diff -vv playbook.yml
Additional environment details (AWS, VirtualBox, physical, etc.):
Ansible Tower, playbook run from an ansible execution environment, podman host is a rhel8 virtual machine (RHEL 8.5)