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

podman compose : incorrect label com.docker.compose.network #25114

Closed
az-z opened this issue Jan 24, 2025 · 3 comments
Closed

podman compose : incorrect label com.docker.compose.network #25114

az-z opened this issue Jan 24, 2025 · 3 comments
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@az-z
Copy link

az-z commented Jan 24, 2025

Issue Description

Hello,

I'm facing the following error:
network az_vault_default was found but has incorrect label com.docker.compose.network set to "" (expected: "default")

Steps to reproduce the issue

Steps to reproduce the issue
use the following yml:

services:
  service1:
    image: nginx
    environment:
      - PORT=3000
    ports:
      - "3000:3000"
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:3004/ping"]
      interval: 2s
      timeout: 60s
      retries: 20
  service2:
    image: nginx
    environment:
      - PORT=3001
    ports:
      - "3001:3001"
    depends_on:
      service1:
        condition: service_healthy
  1. execute :
podman compose -f 1.yml up service2
>>>> Executing external compose provider "/usr/libexec/docker/cli-plugins/docker-compose". Please see podman-compose(1) for how to disable this message. <<<<

network az_vault_default was found but has incorrect label com.docker.compose.network set to "" (expected: "default")
Error: executing /usr/libexec/docker/cli-plugins/docker-compose -f 1.yml up service2: exit status 1

or

podman compose -f 1.yml up 
>>>> Executing external compose provider "/usr/libexec/docker/cli-plugins/docker-compose". Please see podman-compose(1) for how to disable this message. <<<<

network az_vault_default was found but has incorrect label com.docker.compose.network set to "" (expected: "default")
Error: executing /usr/libexec/docker/cli-plugins/docker-compose -f 1.yml up: exit status 1
  1. Additional information:
    note the difference in "config" between "podman compose" and podman-compose":
 podman-compose -f 1.yml config
services:
  service1:
    environment:
      PORT: '3000'
    healthcheck:
      interval: 2s
      retries: 20
      test:
      - CMD
      - curl
      - -f
      - http://localhost:3004/ping
      timeout: 60s
    image: nginx
    ports:
    - 3000:3000
  service2:
    depends_on:
      service1:
        condition: service_healthy
    environment:
      PORT: '3001'
    image: nginx
    ports:
    - 3001:3001

and

podman compose -f 1.yml config
>>>> Executing external compose provider "/usr/libexec/docker/cli-plugins/docker-compose". Please see podman-compose(1) for how to disable this message. <<<<

name: az_vault
services:
  service1:
    environment:
      PORT: "3000"
    healthcheck:
      test:
        - CMD
        - curl
        - -f
        - http://localhost:3004/ping
      timeout: 1m0s
      interval: 2s
      retries: 20
    image: nginx
    networks:
      default: null
    ports:
      - mode: ingress
        target: 3000
        published: "3000"
        protocol: tcp
  service2:
    depends_on:
      service1:
        condition: service_healthy
        required: true
    environment:
      PORT: "3001"
    image: nginx
    networks:
      default: null
    ports:
      - mode: ingress
        target: 3001
        published: "3001"
        protocol: tcp
**networks:
  default:
    name: az_vault_default**

Describe the results you received

Describe the results you received
network az_vault_default was found but has incorrect label com.docker.compose.network set to "" (expected: "default")

Containers fail to start.

Describe the results you expected

I expect :

  1. service1 to start
  2. service 2 not to start due to a health check failing on service1.

podman info output

podman -v
podman version 5.3.1

podman-compose -v
podman-compose version 1.2.0
podman version 5.3.1

Podman in a container

No

Privileged Or Rootless

Rootless

Upstream Latest Release

No

Additional environment details

Environment configuration:

cat /etc/redhat-release
Fedora release 40 (Forty)

ls -l ~/.config/systemd/user/
total 4
drwxr-xr-x 2 az az 4096 Apr 12  2024 sockets.target.wants
[az@dell5000 az_vault]$ ls -l ~/.config/systemd/user/sockets.target.wants/
total 0
lrwxrwxrwx 1 az az 35 Apr 12  2024 podman.socket -> /usr/lib/systemd/user/podman.socket
[az@dell5000 az_vault]$ ls -al $XDG_RUNTIME_DIR/podman/podman.sock
srw-rw---- 1 az az 0 Jan 21 09:20 /run/user/1000/podman/podman.sock
[az@dell5000 az_vault]$ curl -H "Content-Type: application/json" --unix-socket /var/run/user/$UID/podman/podman.sock http://localhost/_ping
OK

Additional information

podman 5.3.2 (latest) was released 2 days ago. Fedora 40 doesn't have it available yet.

@az-z az-z added the kind/bug Categorizes issue or PR as related to a bug. label Jan 24, 2025
@az-z
Copy link
Author

az-z commented Jan 24, 2025

additional information:

podman network ls
NETWORK ID    NAME                     DRIVER
9ccaa5f94f26  aws-cognito-app_default  bridge
ae3fff6179ae  az_vault_default         bridge
3288cec2cb0d  dev_default              bridge
2f259bab93aa  podman                   bridge
a6493e062127  temporal-network         bridge


 podman network inspect az_vault_default
[
     {
          "name": "az_vault_default",
          "id": "ae3fff6179ae2f7efc5639f3510730d1dd4d1bd9ba59d66a26997fa9ee620ad0",
          "driver": "bridge",
          "network_interface": "podman4",
          "created": "2025-01-23T19:24:13.695961906-05:00",
          "subnets": [
               {
                    "subnet": "10.89.3.0/24",
                    "gateway": "10.89.3.1"
               }
          ],
          "ipv6_enabled": false,
          "internal": false,
          "dns_enabled": true,
          "labels": {
               "com.docker.compose.project": "az_vault",
               "io.podman.compose.project": "az_vault"
          },
          "ipam_options": {
               "driver": "host-local"
          },
          "containers": {}
     }
]

If I move the 1.yml to a new directory (../test) and execute podman compose -f 1.yml up the error goes away and the new default network (test_default) is created:

 podman network inspect test_default 
[
     {
          "name": "test_default",
          "id": "b5f5815268fc1d709c6613740d8e6dc6140436f34b0d8808a48d3396ccf0b530",
          "driver": "bridge",
          "network_interface": "podman5",
          "created": "2025-01-24T11:03:41.978086944-05:00",
          "subnets": [
               {
                    "subnet": "10.89.4.0/24",
                    "gateway": "10.89.4.1"
               }
          ],
          "ipv6_enabled": false,
          "internal": false,
          "dns_enabled": true,
          "labels": {
               "com.docker.compose.config-hash": "9249072f9a36c8cd63522e8a3177ecf163cc7124b1363f30244cf06748d5ecd5",
               "com.docker.compose.network": "default",
               "com.docker.compose.project": "test",
               "com.docker.compose.version": "2.32.1"
          },
          "options": {
               "isolate": "true"
          },
          "ipam_options": {
               "driver": "host-local"
          },
          "containers": {}
     }
]

@Luap99
Copy link
Member

Luap99 commented Jan 24, 2025

Note podman compose as the warning mentions is just a wrapper that calls docker-compose or podman-compose depending on how you configure it

Executing external compose provider "/usr/libexec/docker/cli-plugins/docker-compose". Please see podman-compose(1) for how to disable this message. <<<<

So it calls docker-compose.

It sounds like you are mixing podman-compose with docker-compose and they seems to behave different and I doubt they can/want to be compatible.

@Luap99 Luap99 closed this as not planned Won't fix, can't repro, duplicate, stale Jan 24, 2025
@az-z
Copy link
Author

az-z commented Jan 24, 2025

podman-compose has issues that prevent me from using it. It does not support dependency with healthcheck between services. I filed the ticket with the project already.
As such I wanted to check the next best option - podman + (docker) compose plugin. Looks like this combination works as intended ( healthcheck + dependency ), but there is the reported issue with networks.

This cannot be justified as a true bug.
Thank you for checking into this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

2 participants