podman-compose icon indicating copy to clipboard operation
podman-compose copied to clipboard

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

Open tmaus opened this issue 11 months ago • 1 comments

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:

  • OS: Mac / Ventura 13.6.1
  • podman version: 4.9.3
  • podman compose version: 1.0.6

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: - db - redis_db extends: file: ./docker-compose/services/backend.yml service: backend links: - db:database environment: ETHEREUM_JSONRPC_HTTP_URL: http://nitro:8449/ ETHEREUM_JSONRPC_TRACE_URL: http://nitro:8449/ INDEXER_DISABLE_PENDING_TRANSACTIONS_FETCHER: "true"

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

sig-provider: extends: file: ./docker-compose/services/sig-provider.yml service: sig-provider

frontend: depends_on: - backend extends: file: ./docker-compose/services/frontend.yml service: frontend environment: NEXT_PUBLIC_NETWORK_NAME: "Arbitrum Local" NEXT_PUBLIC_NETWORK_SHORT_NAME: "Arbitrum Local" NEXT_PUBLIC_AD_BANNER_PROVIDER: "none" NEXT_PUBLIC_NETWORK_RPC_URL: http://nitro:8449/

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

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

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

proxy: depends_on: - backend - frontend - stats extends: file: ./docker-compose/services/nginx.yml service: proxy

nitro: image: offchainlabs/nitro-node:v2.3.0-3e14543 ports: - "127.0.0.1:8449:8449" volumes: - "./config:/home/user/.arbitrum" command: --conf.file /home/user/.arbitrum/nodeConfig.json

das-server: image: offchainlabs/nitro-node:v2.3.0-3e14543 entrypoint: [ "/bin/bash", "/das-server.sh" ] volumes: - "./config:/home/user/.arbitrum" - "./das-server.sh:/das-server.sh" - "./das-data:/home/user/das-data" ports: - "9876:9876" - "9877:9877"

tmaus avatar Mar 01 '24 09:03 tmaus

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

tmaus avatar Mar 01 '24 15:03 tmaus