-
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
'podman stop' does not thoroughly clean up, resulting in 'the container name \"autotests\" is already in use' #22852
Comments
I just managed to capture something on the command line while the Jenkins job was running:
After that |
While this is definitely a bug, I will note that you should be able to work around it by adding Also: is there a potential something is killing processes in the background? My read on this is that the cleanup process launched when the container exits is probably being killed by Jenkins before it can completely remove the container. |
Agreed, also if you want the container gone you can just use And in general if you have a problem in RHEL you should contact the RHEL support not upstream as we only support the latest version upstream. |
#23670 should fix |
This started off as an attempt to make `podman stop` on a container started with `--rm` actually remove the container, instead of just cleaning it up and waiting for the cleanup process to finish the removal. In the process, I realized that `podman run --rmi` was rather broken. It was only done as part of the Podman CLI, not the cleanup process (meaning it only worked with attached containers) and the way it was wired meant that I was fairly confident that it wouldn't work if I did a `podman stop` on an attached container run with `--rmi`. I rewired it to use the same mechanism that `podman run --rm` uses, so it should be a lot more durable now, and I also wired it into `podman inspect` so you can tell that a container will remove its image. Tests have been added for the changes to `podman run --rmi`. No tests for `stop` on a `run --rm` container as that would be racy. Fixes containers#22852 Fixes RHEL-39513 For this branch Backport of: [458ba5a](containers@458ba5a) Fixes: https://issues.redhat.com/browse/RHEL-61667 Signed-off-by: Matt Heon <mheon@redhat.com> Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
Issue Description
I am not sure if this issue belongs here, or perhaps should be filed to Jenkins. I'm a bit at a loss here as to why this happens, so I'll give it a try here first.
There is a Jenkins job that builds a container, starts it and performs some tests inside the container. Once the tests are done, the container is stopped with
podman stop autotests
Occasionally, the container fails to start with the message
The command to start the container is
The Jenkins job that that initializes this is a 'Execute Shell' with
And the contents of
./runtests.sh
This has been working fine for some years, but since 2024-05-23 it sporadically would fail with
Output of
podman ps
for when this happens:However,
podman ps -a
shows the container stuck at Removing:(Sometimes it has been in Removing state for over 18 hours)
The only way to recover is to manually doing a
podman rm autotests
which will make the Job run again for a while, until it happens next time.I managed to capture some more information with
podman stop--log-level=debug autotests
for when the previous (Sucessfull) job finished:And here is the log from the next run, that fails:
I've also tried to reproduce this issue manually from the command-line, executing
podman run --rm ...
andpodman stop
, numerous times, but so far, been unable to reproduce it.As mentioned, this started on and after 2025-05-23, the system received RHEL updates to
Steps to reproduce the issue
Steps to reproduce the issue
1.
2.
3.
Describe the results you received
Error: creating container storage: the container name "autotests" is already in use by cbcbe2f2b3e60e8292a2e87f655787858fe67b1d912bebee71ef098ad87f4372. You have to remove that container to be able to reuse that name: that name is already in use, or use --replace to instruct Podman to do so.
Describe the results you expected
The container should start successfully
podman info output
Podman in a container
No
Privileged Or Rootless
Privileged
Upstream Latest Release
No
Additional environment details
Podman executed through Jenkins 2.452.1
Additional information
No response
The text was updated successfully, but these errors were encountered: