Skip to content

Podman Compose 1.3.0 up -d command never returns/finishes/ends #1178

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

Open
ArthoPacini opened this issue Apr 7, 2025 · 2 comments
Open

Podman Compose 1.3.0 up -d command never returns/finishes/ends #1178

ArthoPacini opened this issue Apr 7, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@ArthoPacini
Copy link

Describe the bug
When running podman-compose up -d the command never returns, it stalls / freezes

To Reproduce

  1. docker-compose.yaml:
services:
  service_a:
    image: docker.io/crccheck/hello-world
    container_name: "service_a"
    depends_on:
      service_b:
        condition: service_healthy
    healthcheck:
      test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:8000"]
      interval: 10s
      start_interval: 15s
      timeout: 5s
      retries: 3

  service_b:
    image: docker.io/crccheck/hello-world
    container_name: "service_b"
    healthcheck:
      test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:8000"]
      interval: 10s
      start_interval: 15s
      timeout: 5s
      retries: 3

networks:
  default:
    driver: bridge
  1. Run docker-compose up -d:
podman-compose up -d
9a61f6744544dd5343a3e497579e2aadfbac156936d735e89749d95b520832f2
8d43c893be1ddbda564692e8e7e28f27f8a04c559ac1d38a121cf6b6736e4d29
7a350b27a718f4bda86977f51ef32ae75da0b78c38b7d5c84a1e3a62ad767254

Expected behavior
The command should end

Actual behavior
It requires CTRL-C to be called to terminate the program in which it outputs:

^CTraceback (most recent call last):
  File "/usr/lib/python3.11/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/usr/local/bin/podman-compose", line 3707, in async_main
    await podman_compose.run()
  File "/usr/local/bin/podman-compose", line 1861, in run
    retcode = await cmd(self, args)
              ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/bin/podman-compose", line 2705, in compose_up
    await run_container(compose, cnt["name"], cnt["_deps"], ([], "start", [cnt["name"]]))
  File "/usr/local/bin/podman-compose", line 2654, in run_container
    await check_dep_conditions(compose, deps)
  File "/usr/local/bin/podman-compose", line 2643, in check_dep_conditions
    await asyncio.sleep(1)
  File "/usr/lib/python3.11/asyncio/tasks.py", line 639, in sleep
    return await future
           ^^^^^^^^^^^^
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/podman-compose", line 3715, in <module>
    main()
  File "/usr/local/bin/podman-compose", line 3711, in main
    asyncio.run(async_main())
  File "/usr/lib/python3.11/asyncio/runners.py", line 190, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/runners.py", line 123, in run
    raise KeyboardInterrupt()
KeyboardInterrupt

Output

$ podman-compose version
podman-compose version 1.3.0
podman version 4.3.1

podman --version
podman version 4.3.1

$ podman-compose up -d
...

Environment:

  • OS: Debian 12
  • podman version: 4.3.1
  • podman compose version: 1.3.0
@schnell18
Copy link

schnell18 commented Apr 13, 2025

This seems to be related to the podman version. I can run your example successfully w/ a more recent podman:

❯ podman-compose -f docker-compose.yml up -d
0e02d346cfd19d2fee3c5a60caaff6bc32aef82395b40c4cf644d70102dee358
9e16fbcbdcd87f16bffc34186db47e329ddf9518c9082a80a2229726ee6861de
service_b
65bc84d794f06496cbf9605243aca2abca532b535513f1168da2f5b8bc6d6f01
service_a
❯ podman-compose -f docker-compose.yml ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
9e16fbcbdcd8 docker.io/crccheck/hello-world:latest /bin/sh -c echo "... 3 seconds ago Up 3 seconds (healthy) service_b
65bc84d794f0 docker.io/crccheck/hello-world:latest /bin/sh -c echo "... 3 seconds ago Up 3 seconds (healthy) service_a
❯ podman-compose -f docker-compose.yml down
service_a
service_b
service_a
service_b
0e02d346cfd19d2fee3c5a60caaff6bc32aef82395b40c4cf644d70102dee358
foo_default

The podman-compose and podman versoins are as follows:

❯ podman-compose --version
podman-compose version 1.3.0
podman version 5.4.1

So you may try to work around this issue by upgrade to podman 5.x. Hope this helps!

@schnell18
Copy link

Just to supply additional findings regarding this issue. It is indeed bug which fails to take into account the fact that podman prior to 4.6.0 doesn't support "podman wait --conditioni=healthy" and enters a dead loop. This bug is fixed by the PR #1184.

@ArthoPacini, do you have any chance to validate the PR #1184? Thanks!

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

2 participants