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

KeyError to network name #552

Open
DevDorrejo opened this issue Sep 8, 2022 · 0 comments
Open

KeyError to network name #552

DevDorrejo opened this issue Sep 8, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@DevDorrejo
Copy link

DevDorrejo commented Sep 8, 2022

Describe the bug
Trying to execute the next composer code give "KeyError: 'postgres'":

version: "3"

services:
  postgres:
    container_name: PostgresSQL
    image: postgres
    environment:
      POSTGRES_HOST_AUTH_METHOD: trust
      PGDATA: /data/postgresql
    volumes:
      - postgresql:/data/postgresql
    ports:
      - "5432:5432"
    networks:
      - postgres
    restart: unless-stopped

  pgadmin:
    container_name: PgAdmin4
    image: dpage/pgadmin4
    environment:
      PGADMIN_DEFAULT_EMAIL:
      PGADMIN_DEFAULT_PASSWORD:
    volumes:
      - pgadmin:/var/lib.pgadmin
    ports:
      - "${PGADMIN_PORT:-5050}:80"
    networks:
      - postgres
    restart: unless-stopped

  networks:
    postgres:
      driver: bridge

  volumes:
    postgresql:
    pgadmin:

To Reproduce
Steps to reproduce the behavior:

  1. podman-compose -f postgresql.yml up (code above)

Output

$ podman-compose version
['podman', '--version', '']
using podman version: 4.2.0
podman-composer version  1.0.3
podman --version
podman version 4.2.0

$ podman-compose up
...
['podman', '--version', '']
using podman version: 4.2.0
** excluding:  set()
podman volume inspect db_postgresql || podman volume create db_postgresql
['podman', 'volume', 'inspect', 'db_postgresql']
Traceback (most recent call last):
File "/usr/bin/podman-compose", line 33, in <module>
sys.exit(load_entry_point('podman-compose==1.0.3', 'console_scripts', 'podman-compose')())
File "/usr/lib/python3.10/site-packages/podman_compose.py", line 1774, in main
podman_compose.run()
File "/usr/lib/python3.10/site-packages/podman_compose.py", line 1023, in run
cmd(self, args)
File "/usr/lib/python3.10/site-packages/podman_compose.py", line 1247, in wrapped
return func(*args, **kw)
File "/usr/lib/python3.10/site-packages/podman_compose.py", line 1414, in compose_up
podman_args = container_to_args(compose, cnt, detached=args.detach)
File "/usr/lib/python3.10/site-packages/podman_compose.py", line 644, in container_to_args
assert_cnt_nets(compose, cnt)
File "/usr/lib/python3.10/site-packages/podman_compose.py", line 557, in assert_cnt_nets
net_desc = nets[net] or {}
KeyError: 'postgres'

With 1.0.4 (pip3 install git+https://github.com/containers/podman-compose.git@9d5b2559274819e3b47230da85d4d306807bb4bf)

podman-compose version: 1.0.4
['podman', '--version', '']
using podman version: 4.2.0
Traceback (most recent call last):
File "/home/wedc/bin/DevTools/pipenv/bin/podman-compose", line 33, in <module>
sys.exit(load_entry_point('podman-compose==1.0.4', 'console_scripts', 'podman-compose')())
File "/home/wedc/bin/DevTools/pipenv/lib64/python3.10/site-packages/podman_compose.py", line 2852, in main
podman_compose.run()
File "/home/wedc/bin/DevTools/pipenv/lib64/python3.10/site-packages/podman_compose.py", line 1383, in run
self._parse_compose_file()
File "/home/wedc/bin/DevTools/pipenv/lib64/python3.10/site-packages/podman_compose.py", line 1530, in _parse_compose_file
raise RuntimeError(f"missing networks: {missing_nets_str}")
RuntimeError: missing networks: postgres

Environment:

  • OS: Linux / WSL / Mac: GNU/Linux openSUSE Tumbleweed
  • podman version: 4.2.0
  • podman compose version: (git hex) 1.0.3
@DevDorrejo DevDorrejo added the bug Something isn't working label Sep 8, 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