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

parsing error networking aliases in JSON format #572

Closed
yuuyins opened this issue Oct 18, 2022 · 1 comment
Closed

parsing error networking aliases in JSON format #572

yuuyins opened this issue Oct 18, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@yuuyins
Copy link

yuuyins commented Oct 18, 2022

Describe the bug
parsing error networking aliases in JSON format (it works on docker-compose)

To Reproduce

{
  "version": "3",

  "networks": {
    "wnkp-backend-python": {
      "driver": "bridge"
    }
  },

  "volumes": {
    "wnkp-database-postgres": null
  },

  "services": {
    "wnkp-database-postgres": {
      "image": "docker.io/postgres:14-alpine3.16",
      "environment": {
        "POSTGRES_DB": "wnkp",
        "POSTGRES_USER": "wnkp",
        "POSTGRES_PASSWORD": "wnkppass"
      },
      "volumes": [
        "wnkp-database-postgres:/var/lib/postgres"
      ],
      "networks": {
        "wnkp-backend-python": {
          "aliases": [
            "wnkp-database-postgres--wnkp-backend-python"
          ]
        }
      },
      "ports": [
        "5252:5432"
      ],
      "hostname": "database.wnkp.test",
      "healthcheck": {
        "test": [
          "CMD",
          "pg_isready",
          "--dbname=wnkp",
          "--username=wnkp"
        ],
        "start_period": "60s",
        "interval": "10s",
        "timeout": "45s",
        "retries": 10
      }
    },

    "wnkp-backend-python": {
      "image": "wnkp-backend-python",
      "depends_on": {
        "wnkp-database-postgres": {
          "condition": "service_healthy"
        }
      },
      "environment": {
        "LANG": "en_US.UTF-8",
        "LD_LIBRARY_PATH": "/usr/lib:/lib:/usr/local/lib",
        "DATABASE_URL": "postgresql://wnkp:wnkppass@127.0.0.1:5432/wnkp"
      },
      "volumes": [
        "./backend:/wnkp/backend"
      ],
      "working_dir": "/wnkp/backend",
      "networks": [
        "wnkp-backend-python"
      ],
      "ports": [
        "6262:5000"
      ],
      "hostname": "backend.wnkp.test",
      "tty": true,
      "command": "sh -c 'python app.py'",
      "healthcheck": {
        "test": [
          "CMD",
          "curl",
          "--fail",
          "http://127.0.0.1:5000/",
          "||",
          "exit 1"
        ],
        "start_period": "60s",
        "interval": "10s",
        "timeout": "45s",
        "retries": 10
      }
    }
  }
}
  1. podman-compose --file "compose.json" up
['podman', '--version', '']
using podman version: 4.2.1
** excluding:  set()
podman volume inspect backend_wnkp-database-postgres || podman volume create backend_wnkp-database-postgres
['podman', 'volume', 'inspect', 'backend_wnkp-database-postgres']
Traceback (most recent call last):
  File "/nix/store/0kv417lywziccfly51v67950mlbn3bcn-podman-compose-1.0.3/bin/.podman-compose-wrapped", line 9, in <module>
    sys.exit(main())
  File "/nix/store/0kv417lywziccfly51v67950mlbn3bcn-podman-compose-1.0.3/lib/python3.10/site-packages/podman_compose.py", line 1775, in main
    podman_compose.run()
  File "/nix/store/0kv417lywziccfly51v67950mlbn3bcn-podman-compose-1.0.3/lib/python3.10/site-packages/podman_compose.py", line 1024, in run
    cmd(self, args)
  File "/nix/store/0kv417lywziccfly51v67950mlbn3bcn-podman-compose-1.0.3/lib/python3.10/site-packages/podman_compose.py", line 1248, in wrapped
    return func(*args, **kw)
  File "/nix/store/0kv417lywziccfly51v67950mlbn3bcn-podman-compose-1.0.3/lib/python3.10/site-packages/podman_compose.py", line 1415, in compose_up
    podman_args = container_to_args(compose, cnt, detached=args.detach)
  File "/nix/store/0kv417lywziccfly51v67950mlbn3bcn-podman-compose-1.0.3/lib/python3.10/site-packages/podman_compose.py", line 645, in container_to_args
    assert_cnt_nets(compose, cnt)
  File "/nix/store/0kv417lywziccfly51v67950mlbn3bcn-podman-compose-1.0.3/lib/python3.10/site-packages/podman_compose.py", line 558, in assert_cnt_nets
    net_desc = nets[net] or {}
KeyError: "wnkp-backend-python={'aliases': ['wnkp-database-postgres--wnkp-backend-python']}"

Actual behavior
What is the behavior you actually got and that should not happen.

Output

using podman version: 4.2.1
podman-composer version  1.0.3
...

Environment:

  • OS: Linux
  • podman version:
  • podman compose version: (git hex)

Additional context

Add any other context about the problem here.

@yuuyins yuuyins added the bug Something isn't working label Oct 18, 2022
@yuuyins
Copy link
Author

yuuyins commented Oct 20, 2022

#88

4557279

@yuuyins yuuyins closed this as completed Oct 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant