Skip to content

Conversation

@TomSweeneyRedHat
Copy link
Member

@TomSweeneyRedHat TomSweeneyRedHat commented Mar 19, 2018

Signed-off-by: TomSweeneyRedHat tsweeney@redhat.com

If we receive a storage.ErrImageUsedByContainer error, it's likely that the image has a container associated with it via Buildah doing a 'buildah from image' and the user will see 'image is in use by a container'. Yet if the do a 'podman ps --all' no containers will be seen.

This change is probably a short term fix until we can get a snazzier solution together via the container/storage. This calls 'buildah rmi" to do the dirty work. The one hiccup with this is if you do a 'podman rmi -a' and there's a buildah container associated with the image, you'll get a double error message, one from Buildah, the other from Podman.

# podman rmi -a
Could not remove image "3fd9065eaf02feaf94d68376da52541925650b81698c53c6824d92ff63f98353" (must force) - container "c39c25ebd002e534b7419ac1a812747955d380848d257fc2a7975908a65a4946" is using its reference image: image is in use by a container
A container created with Buildah may be associated with this image.
Remove the container with Buildah or retry using the --force option.
Image used by c39c25ebd002e534b7419ac1a812747955d380848d257fc2a7975908a65a4946: image is in use by a container

podman rmi -a --force
3fd9065eaf02feaf94d68376da52541925650b81698c53c6824d92ff63f98353

Addresses #174 at least temporarily.

@TomSweeneyRedHat
Copy link
Member Author

@edsantiago FYI

@edsantiago
Copy link
Member

Curious. My full log is long since gone, but my recollection was that buildah rmi was of no use: only buildah rm helped. I'll take another look tomorrow. Thanks for this work and again many many thanks for saving me time today.

Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
@mheon
Copy link
Member

mheon commented Mar 19, 2018

On the side of a much simpler, but potentially less safe solution... What bad things would happen if we did a check for containers using the image in c/storage, and force-unmounted all those containers?

@rhatdan
Copy link
Member

rhatdan commented Mar 20, 2018

I would prefer to not move buildah support any further into podman, I think the hack that Matt is suggesting is better then just adding additional execs of the buildah command.

The thing we should be working on is getting buildah to properly register itself with libpod.

@TomSweeneyRedHat
Copy link
Member Author

I put this patch together as I knew it was quick and relatively safe and we'd probably remove it in the not to distant future. The issue is currently not intuitive when you run across it, it jammed me up for a bit and Ed up yesterday. I was just thinking about mushing this through to keep others from spinning until we could get this done more properly.

@TomSweeneyRedHat
Copy link
Member Author

bot, retest this please

@TomSweeneyRedHat
Copy link
Member Author

FWIW, I restarted the tests to see if the previous failure was a flake or not. This morning I'm ripping out the buildah exec and trying to remove directly via container storage.

@TomSweeneyRedHat
Copy link
Member Author

TomSweeneyRedHat commented Mar 24, 2018

Per discussions here and off-line, we're going forward with #522 and are not adding an exec here.

@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 27, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants