containers / podman-compose

a script to run docker-compose.yml using podman
GNU General Public License v2.0
5.01k stars 477 forks source link

can't merge value of depends_on of type <class 'dict'> and <class 'list'> #859

Open tmaus opened 7 months ago

tmaus commented 7 months ago

Describe the bug validating docker-compose.yaml throws the error as stated in title

To Reproduce

  1. Running podman-compose on Mac installed by brew
  2. Download repo from https://github.com/OffchainLabs/orbit-setup-script OR use docker-compose.yaml
  3. execute podman-compose -f docker-compose.yaml config

Expected behavior As per https://docs.arbitrum.io/launch-orbit-chain/orbit-quickstart description, the container should start up.

Actual behavior Error message: Traceback (most recent call last): File "/opt/homebrew/bin/podman-compose", line 8, in sys.exit(main()) ^^^^^^ File "/opt/homebrew/Cellar/podman-compose/1.0.6/libexec/lib/python3.12/site-packages/podman_compose.py", line 2941, in main podman_compose.run() File "/opt/homebrew/Cellar/podman-compose/1.0.6/libexec/lib/python3.12/site-packages/podman_compose.py", line 1421, in run self._parse_compose_file() File "/opt/homebrew/Cellar/podman-compose/1.0.6/libexec/lib/python3.12/site-packages/podman_compose.py", line 1536, in _parse_compose_file resolve_extends(services, service_names, self.environ) File "/opt/homebrew/Cellar/podman-compose/1.0.6/libexec/lib/python3.12/site-packages/podman_compose.py", line 1310, in resolve_extends new_service = rec_merge({}, from_service, service) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/podman-compose/1.0.6/libexec/lib/python3.12/site-packages/podman_compose.py", line 1278, in rec_merge ret = rec_merge_one(target, source) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/podman-compose/1.0.6/libexec/lib/python3.12/site-packages/podman_compose.py", line 1249, in rec_merge_one raise ValueError( ValueError: can't merge value of depends_on of type <class 'dict'> and <class 'list'>

Output

podman-compose -f docker-compose.yaml config
podman-compose version: 1.0.6
['podman', '--version', '']
using podman version: 4.9.3

Traceback (most recent call last):
  File "/opt/homebrew/bin/podman-compose", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/opt/homebrew/Cellar/podman-compose/1.0.6/libexec/lib/python3.12/site-packages/podman_compose.py", line 2941, in main
    podman_compose.run()
  File "/opt/homebrew/Cellar/podman-compose/1.0.6/libexec/lib/python3.12/site-packages/podman_compose.py", line 1421, in run
    self._parse_compose_file()
  File "/opt/homebrew/Cellar/podman-compose/1.0.6/libexec/lib/python3.12/site-packages/podman_compose.py", line 1536, in _parse_compose_file
    resolve_extends(services, service_names, self.environ)
  File "/opt/homebrew/Cellar/podman-compose/1.0.6/libexec/lib/python3.12/site-packages/podman_compose.py", line 1310, in resolve_extends
    new_service = rec_merge({}, from_service, service)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/podman-compose/1.0.6/libexec/lib/python3.12/site-packages/podman_compose.py", line 1278, in rec_merge
    ret = rec_merge_one(target, source)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/podman-compose/1.0.6/libexec/lib/python3.12/site-packages/podman_compose.py", line 1249, in rec_merge_one
    raise ValueError(
ValueError: can't merge value of depends_on of type <class 'dict'> and <class 'list'>

Environment:

Additional context

docker-compose.yaml

version: '3.9' services: redis_db: extends: file: ./docker-compose/services/redis.yml service: redis_db

db-init: extends: file: ./docker-compose/services/db.yml service: db-init

db: extends: file: ./docker-compose/services/db.yml service: db

backend: depends_on:

tmaus commented 7 months ago

dug a bit deeper. looking at the docker-compose/stats.yml file revealed some more insights:

stats-db: depends_on: stats-db-init: condition: service_completed_successfully

In this case the depends_on is identified as dictionary instead of list !!!

hope that helps