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 adding pod to state: name root is in use: pod already exists #72

Open
peterwillcn opened this issue Nov 2, 2019 · 2 comments
Open

Comments

@peterwillcn
Copy link

peterwillcn commented Nov 2, 2019

error adding pod to state: name root is in use: pod already exists

version: "2"

services:
s1:
hostname: s1
.....
s2:
hostname: s2
.....

# podman-compose -f /root/1234.yml up -d
podman pod create --name=root --share net -p 1234:4321/udp -p 1234:4321/tcp
podman run --name=root_s1_1 -d --pod=root --label io.podman.compose.config-hash=123 --label io.podman.compose.project=root --label io.podman.compose.version=0.0.1 --label com.docker.compose.container-number=1 --label com.docker.compose.service=s1 ..... --hostname s1 

# podman-compose -f /root/2345.yml up -d
podman pod create --name=root --share net -p 2345:4321/udp -p 2345:4321/tcp
error adding pod to state: name root is in use: pod already exists
125
podman run --name=root_s2_1 -d --pod=root --label io.podman.compose.config-hash=123 --label io.podman.compose.project=root --label io.podman.compose.version=0.0.1 --label com.docker.compose.container-number=1 --label com.docker.compose.service=s2 ..... --hostname s2
```
@runephilosof-abtion
Copy link

You have to run podman-compose down between up.
It is annoying and not the same behavior as docker-compose.

@alec-w
Copy link

alec-w commented Jul 24, 2024

Is there anything that can be done about this?

Since we don't have health checks yet either (see #866, #23 and #921) I was going to work around that by running

podman compose up -d service1

while [ "$(podman compose ps -f json | jq '.[] | select(.Labels."com.docker.compose.service"=="service1").Status | contains("healthy")')" == "false" ]; do
    :
done

podman compose up -d service2

However, this issue prevents that as well. Seems the only options would be to have 2 separate compose files and use the script workaround or drop podman-compose and switch to docker-compose instead (which I'd been hoping to avoid).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants