Skip to content
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

Error: podman run says the container name is already in use #10

Open
ryanj opened this issue Sep 10, 2019 · 4 comments
Open

Error: podman run says the container name is already in use #10

ryanj opened this issue Sep 10, 2019 · 4 comments
Labels
wontfix This will not be worked on

Comments

@ryanj
Copy link
Owner

ryanj commented Sep 10, 2019

I ran into podman issue #2553, where "podman run says the container name is already in use but podman ps --all does not show any container with that name"

Found and cleaned up some leftover state to work around the issue:

Storage check and cleanup:

  1. podman rm --storage storage_id
  2. check /var/lib/containers/storage/overlay-containers/containers.json for invalid state
  3. leftover shm mounts can be found using mount and removed using umount

Net ns check and cleanup:

  1. podman network ls (slated for podman v1.5.2)
  2. check /var/lib/cni/networks/podman/last_reserved_ip.0 for invalid state
  3. leftover netns mounts can be found by running mount, or by checking in /var/run/netns. For cleanup, try ip netns list and ip netns delete netns_id

Issues to watch:

@zhuguoliang
Copy link

zhuguoliang commented Jan 14, 2020

Can you specify how you check state in step 2 and step 3? @ryanj

@penghon
Copy link

penghon commented May 12, 2020

Encountered this while using ansible to send podman rm {{ container_name }} -f via command module.
Left over in /var/lib/containers/storage/overlay-containers/containers.json. Removed it and it is good to go.

@jrevillard
Copy link

Encountered this while using ansible to send podman rm {{ container_name }} -f via command module.
Left over in /var/lib/containers/storage/overlay-containers/containers.json. Removed it and it is good to go.

I just faced the same issue. Is there anybody looking into this ?

Best.

@ryanj ryanj added the wontfix This will not be worked on label Sep 24, 2020
@ryanj
Copy link
Owner Author

ryanj commented Sep 24, 2020

@zhuguoliang, @jrevillard - This is definitely a "Won't Fix" issue for this project, but feel free to click through to the related issues for additional details (see "Issues to watch" above).

From the notes that I saw in the linked issues, updating to a newer release of podman and/or buildah may provide a solution for this. Definitely let me know if that works for you.

@zhuguoliang: Regarding steps 2 and 3:
step2: the storage check can be performed by running: cat /var/lib/containers/storage/overlay-containers/containers.json.
If your stale container info is listed in that file, update the file and remove the outdated container info/blob.
step3: check the output from mount for any leftover container volumes. If you find any, use umount VOLUMEPATH to unmount the leftover container volume.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

4 participants