Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
Steps to reproduce the issue:
1.podman pod create --name postgresql -p 5432 -p 9187
observed that it was in created state.
podman rm postgres has nothing to delete
Describe the results you received:
i see this instead
f0a2f60cb4ba k8s.gcr.io/pause:3.2 About an hour ago Created 0.0.0.0:5432->5432/tcp 1a2aef4a0748-infra
Describe the results you expected:
just works
Additional information you deem important (e.g. issue happens only occasionally):
Output of podman version:
Version: 1.9.1
RemoteAPI Version: 1
Go Version: go1.14.2
OS/Arch: linux/amd64
(paste your output here)
Output of podman info --debug:
(paste your output here)
Package info (e.g. output of rpm -q podman or apt list podman):
(paste your output here)
debug:
compiler: gc
gitCommit: ""
goVersion: go1.14.2
podmanVersion: 1.9.1
host:
arch: amd64
buildahVersion: 1.14.8
cgroupVersion: v1
conmon:
package: conmon-2.0.15-1.fc32.x86_64
path: /usr/bin/conmon
version: 'conmon version 2.0.15, commit: 33da5ef83bf2abc7965fc37980a49d02fdb71826'
cpus: 8
distribution:
distribution: fedora
version: "32"
eventLogger: file
hostname: server.marafa.vm
idMappings:
gidmap: null
uidmap: null
kernel: 5.6.10-300.fc32.x86_64
memFree: 9315561472
memTotal: 16474722304
ociRuntime:
name: crun
package: crun-0.13-2.fc32.x86_64
path: /usr/bin/crun
version: |-
crun version 0.13
commit: e79e4de4ac16da0ce48777afb72c6241de870525
spec: 1.0.0
+SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +YAJL
os: linux
rootless: false
slirp4netns:
executable: ""
package: ""
version: ""
swapFree: 8325689344
swapTotal: 8325689344
uptime: 33m 37.32s
registries:
search:
- docker.io
store:
configFile: /etc/containers/storage.conf
containerStore:
number: 9
paused: 0
running: 8
stopped: 1
graphDriverName: overlay
graphOptions:
overlay.mountopt: nodev,metacopy=on
graphRoot: /var/lib/containers/storage
graphStatus:
Backing Filesystem: xfs
Native Overlay Diff: "false"
Supports d_type: "true"
Using metacopy: "true"
imageStore:
number: 14
runRoot: /var/run/containers/storage
volumePath: /var/lib/containers/storage/volumes
Additional environment details (AWS, VirtualBox, physical, etc.):
physical
Error: can only stop created or running containers. f0a2f60cb4baa19a1f3a7f4b4cd5f95af2683ca12fc5dfc0a0dd66bebf2834ac is in state configured: container state improper
Error: container f0a2f60cb4baa19a1f3a7f4b4cd5f95af2683ca12fc5dfc0a0dd66bebf2834ac is the infra container of pod 1a2aef4a07481c677ed1f88b39fbde92e36902da36e6ea644f84e93fb79e5467 and cannot be removed without removing the pod
Error: error removing image 80d28bedfe5dec59da9ebf8e6260224ac9008ab5c11dbbe16ee3ba3e4439ac2c: container f0a2f60cb4baa19a1f3a7f4b4cd5f95af2683ca12fc5dfc0a0dd66bebf2834ac using image could not be removed: container f0a2f60cb4baa19a1f3a7f4b4cd5f95af2683ca12fc5dfc0a0dd66bebf2834ac is the infra container of pod 1a2aef4a07481c677ed1f88b39fbde92e36902da36e6ea644f84e93fb79e5467 and cannot be removed without removing the pod
1a2aef4a0748-infra
Error: refusing to remove "1a2aef4a0748-infra" as it exists in libpod as container f0a2f60cb4baa19a1f3a7f4b4cd5f95af2683ca12fc5dfc0a0dd66bebf2834ac: container already exists
Error: container f0a2f60cb4baa19a1f3a7f4b4cd5f95af2683ca12fc5dfc0a0dd66bebf2834ac is the infra container of pod 1a2aef4a07481c677ed1f88b39fbde92e36902da36e6ea644f84e93fb79e5467 and cannot be removed without removing the pod
Error: no container with name or ID 1a2aef4a07481c677ed1f88b39fbde92e36902da36e6ea644f84e93fb79e5467 found: no such container
some of these results after a reboot , which did not clear things up in any way
Please use podman pod commands to stop and remove pods. podman pod rm -f will remove the pod in question. We deliberately do not allow infra containers to be removed without removing the pod that contains them.
i had done that but missed it in the report
podman pod rm -f 1a2aef4a0748-infra
Error: 1a2aef4a0748-infra is a container, not a pod: no such pod
what do u know!
聽podman pod rm -f 1a2aef4a0748
1a2aef4a07481c677ed1f88b39fbde92e36902da36e6ea644f84e93fb79e5467
thank you!
~The error message could clarify that this error occurs because the container is used in a pod and you have to delete the pod first.~ This is not correct.
Would you like to open a PR to make that happen?
Try do the following commands
$ podman pod list
$ podman pod rm -f CONTAINER_ID
$ podman images
$ podman rmi -f IMAGE_ID
Most helpful comment
Please use
podman podcommands to stop and remove pods.podman pod rm -fwill remove the pod in question. We deliberately do not allow infra containers to be removed without removing the pod that contains them.