-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run container in a system without syslog plus debug log level, the exit will time out #19075
Comments
For people who are looking into workaround, such as running podman in alpine, an easy way is to simply install openrc or s6-overlay with a syslog running when the container starts, like this: FROM alpine
RUN apk add s6-overlay s6-overlay-syslogd podman fuse fuse-overlayfs
RUN sed -e 's|^#mount_program|mount_program|g' /usr/share/containers/storage.conf > /etc/containers/storage.conf
ENTRYPOINT ["/init"] This way, when you run with debug log level, syslog can be found and the exit won't timeout docker run --privileged -i my-image podman --log-level=debug run -i alpine echo hi |
What is the error message when you run something like: |
docker run --privileged --entrypoint=/bin/sh -i alpine:3.18.2 \
-c "apk add podman fuse fuse-overlayfs && \
sed -e 's|^#mount_program|mount_program|g' /usr/share/containers/storage.conf > /etc/containers/storage.conf && \
podman --syslog info" and the result:
|
Podman will always pass down --syslog to conmon since 13c2aca. However there systems without syslog running, likely in container setups. As reported in this was already a problem before when debug level is used. Then conmon will pass down --syslog back to the podman container cleanup command causing it to fail without doing anything. Given that I think it is better to just ignore the error and log it on debug level, we need to make sure cleanup works consistently. [NO NEW TESTS NEEDED] Fixes containers#19075 Signed-off-by: Paul Holzinger <[email protected]>
Podman will always pass down --syslog to conmon since 13c2aca. However there systems without syslog running, likely in container setups. As reported in this was already a problem before when debug level is used. Then conmon will pass down --syslog back to the podman container cleanup command causing it to fail without doing anything. Given that I think it is better to just ignore the error and log it on debug level, we need to make sure cleanup works consistently. [NO NEW TESTS NEEDED] Fixes containers#19075 Signed-off-by: Paul Holzinger <[email protected]>
Issue Description
I ran into a problem, when you run the podman command in an environment where syslog is not available with a
debug
log level, the container exit is going to timeout. For example, in an Alpine docker container withpodman
package installed, then you ran thispodman --log-level=debug run -it alpine echo hi
Then you will see after
hi
shows, it takes 20 seconds until the timeout waiting for container errorAfter tracing into the code I now understand why. The first would be, when
debug
log level is provided,--syslog
will be added to the conmon exit command arguments from herepodman/pkg/specgenutil/util.go
Lines 304 to 306 in 82af41c
Then syslog enabled or not is from here
podman/libpod/oci_conmon_common.go
Line 1111 in 82af41c
As you can see the part
However, when the command runs, it sees the syslog flag is set, it will try to use it.
podman/cmd/podman/syslog_common.go
Lines 20 to 24 in 82af41c
But then it will fail because syslog was not available on my Alpine environment. So it exits with code
1
. And that's the cleanup command exits without even doing anything at all. As a result, the parent podman process will wait for the result updates set by cleanup but it will never happen.Steps to reproduce the issue
Steps to reproduce the issue
Describe the results you received
Describe the results you expected
The cleanup should finish without timeout error i.e, make clean up command not fail when syslog is not available. If syslog is necessary for running with
debug
log level (I saw somewhere it mentions some communications are done with syslog?), it should display an error instead of run the command and wait until timeout.podman info output
The text was updated successfully, but these errors were encountered: