podman: podman run says the container name is already in use but podman ps --all does not show any container with that name
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
I have this bug after a power outage.
podman run --name nextcloud fedora
error creating container storage: the container name "nextcloud" is already in use by "31d772490bd4f63019908d896a8d5d62ce4f7db78162db4c8faab60725dbd4e1". You have to remove that container to be able to reuse that name.: that name is already in use
podman ps --all | grep nextcloud has not output
Steps to reproduce the issue:
Dunno how to reproduce it, it appeared after a power outage and it’s abrupt shutdown
Output of podman version:
host:
BuildahVersion: 1.6-dev
Conmon:
package: podman-1.0.0-1.git82e8011.fc29.x86_64
path: /usr/libexec/podman/conmon
version: 'conmon version 1.12.0-dev, commit: 49780a1cf10d572edc4e1ea3b8a8429ce391d47d'
Distribution:
distribution: fedora
version: "29"
MemFree: 374931456
MemTotal: 8241008640
OCIRuntime:
package: runc-1.0.0-67.dev.git12f6a99.fc29.x86_64
path: /usr/bin/runc
version: |-
runc version 1.0.0-rc6+dev
commit: d164d9b08bf7fc96a931403507dd16bced11b865
spec: 1.0.1-dev
SwapFree: 8262250496
SwapTotal: 8380215296
arch: amd64
cpus: 4
hostname: asheville.intranet.zokormazo.info
kernel: 4.20.6-200.fc29.x86_64
os: linux
rootless: false
uptime: 12h 27m 2.91s (Approximately 0.50 days)
insecure registries:
registries: []
registries:
registries:
- docker.io
- registry.fedoraproject.org
- quay.io
- registry.access.redhat.com
- registry.centos.org
store:
ConfigFile: /etc/containers/storage.conf
ContainerStore:
number: 6
GraphDriverName: overlay
GraphOptions: null
GraphRoot: /var/lib/containers/storage
GraphStatus:
Backing Filesystem: extfs
Native Overlay Diff: "true"
Supports d_type: "true"
ImageStore:
number: 8
RunRoot: /var/run/containers/storage
Output of podman info --debug:
debug:
compiler: gc
git commit: '"49780a1cf10d572edc4e1ea3b8a8429ce391d47d"'
go version: go1.11.4
podman version: 1.0.0
host:
BuildahVersion: 1.6-dev
Conmon:
package: podman-1.0.0-1.git82e8011.fc29.x86_64
path: /usr/libexec/podman/conmon
version: 'conmon version 1.12.0-dev, commit: 49780a1cf10d572edc4e1ea3b8a8429ce391d47d'
Distribution:
distribution: fedora
version: "29"
MemFree: 374919168
MemTotal: 8241008640
OCIRuntime:
package: runc-1.0.0-67.dev.git12f6a99.fc29.x86_64
path: /usr/bin/runc
version: |-
runc version 1.0.0-rc6+dev
commit: d164d9b08bf7fc96a931403507dd16bced11b865
spec: 1.0.1-dev
SwapFree: 8262250496
SwapTotal: 8380215296
arch: amd64
cpus: 4
hostname: asheville.intranet.zokormazo.info
kernel: 4.20.6-200.fc29.x86_64
os: linux
rootless: false
uptime: 12h 27m 32.11s (Approximately 0.50 days)
insecure registries:
registries: []
registries:
registries:
- docker.io
- registry.fedoraproject.org
- quay.io
- registry.access.redhat.com
- registry.centos.org
store:
ConfigFile: /etc/containers/storage.conf
ContainerStore:
number: 6
GraphDriverName: overlay
GraphOptions: null
GraphRoot: /var/lib/containers/storage
GraphStatus:
Backing Filesystem: extfs
Native Overlay Diff: "true"
Supports d_type: "true"
ImageStore:
number: 8
RunRoot: /var/run/containers/storage
Additional environment details (AWS, VirtualBox, physical, etc.): Bare metal f29
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 5
- Comments: 31 (14 by maintainers)
Try a ‘podman rm --storage’.
On Wed, Jul 10, 2019, 07:48 Ed Santiago notifications@github.com wrote:
I have the same issue on Fedora 31 with
podman-1.4.4-1.fc30.x86_64. There are no references of this container incontainers.jsonso not sure how to clean it up manually.That did it. Since this seems to be a common problem, should the podman-run message perhaps be amended to include this hint?
Oh, you’re on 1.0 - damn. We added that to
rm -fin 1.1If you have Buildah installed, it should be able to remove the container in the meantime - it operates at a lower level than us, and as such can see these containers.
@Zokormazo I’m no podman dev, but maybe try adding
sudoto your command:sudo podman ps --all@BBBosp if you have removed all containers, you could remove the bolt_state.db
rm /home/dwalsh/.local/share/containers/storage/libpod/bolt_state.db
This will remove the database but leave your images, The next run of podman will recreate the database.
podman rm --storage <id>doesn’t seem to work for me with the zfs driver though:The only issue with recommending it unconditionally is that it will quite happily destroy containers from Buildah/CRI-O as well.
The overall recommendation works something like this: Check CRI-O and Buildah to see if it’s a container running there. If it is, we recommend deleting them through
crictlandbuildah. If it’s not there, it’s probably an orphan container - hit it with--storage.That container is probably a relic from a partially failed container delete, or was made by Buildah or CRI-O. You should be able to force it’s removal, even if we don’t see it, with Podman rm -f
On Wed, Mar 6, 2019, 05:48 Julen Landa Alustiza notifications@github.com wrote:
Some more info:
My containers.json on /var/lib/containers/storage/overlay-containers has a reference to this container:
But podman doesn’t know about it. podman prune doesn not help neither