-
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
[macOS] podman logs --tail #
value not interpreted correctly when used against restarted containers
#13098
Comments
Hi, I am using The |
@petr-ujezdsky Thanks for the feedback. Naturally I would prefer to use the built-in health check functionality. Unfortunately, few containers actually implement it. So it might be possible in some situations, but definitely not all. I'll look into your Having |
I think you should be able to create your own Or you might use time restriction instead of lines restriction (here) as a workaround. However note that this solution (and maybe even yours) has a pitfall that when the postgres initializes before you start parsing the log you will end up waiting indefinitely. This might seems unreasonable, but it actually can happen in highly loaded server, you simply never know :) |
A friendly reminder that this issue had no activity for 30 days. |
I ran into this issue too on Fedora 35 -- I'm not using healthchecks. Here's a minimal example.
|
PS additional debug info:
|
A friendly reminder that this issue had no activity for 30 days. |
This seems to be only an error with the journald log driver. $ podman run --log-driver=k8s-file --name test --detach alpine sh -c 'echo hello; echo world; sleep infinity' |
--tail=1 is not working f you restart a container with journald logging. We see the exit status and then call into the logging a second time causing all of the logs to print. Removing the tail log on exited seems to fix the problem. Fixes: containers#13098 Signed-off-by: Daniel J Walsh <[email protected]>
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
Steps to reproduce the issue:
Describe the results you received:
First logs call
Second logs call
Describe the results you expected:
I would expect
--tail
to not be affected by container restarts.Additional information you deem important (e.g. issue happens only occasionally):
The reason I am filing this bug report, is because I am relying on things like this:
This works fine when creating a new container. But restarting an existing container will break this, since the
logs -f --tail 0
will very likely already containdatabase system is ready to accept connections
, which makes the whole thing fire while its not ready yet.As a workaround, I'm resorting to this:
Output of
podman version
:Output of
podman info --debug
:Package info (e.g. output of
rpm -q podman
orapt list podman
):Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/main/troubleshooting.md)
Yes
The text was updated successfully, but these errors were encountered: