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

compose fails with depends_on:service_healthy with various errors.

Open az-z opened this issue 10 months ago • 4 comments

Describe the bug A clear and concise description of what the bug is. compose does not support(?) or failed to properly support

depends_on:
    <service>:
         condition: service_healthy

In addition, it produces

cannot open ......./exec.fifo' : No such file or directory"
Error: unable to start container .... : `/usr/bin/crun start ....

and yet the container starts.

To Reproduce Steps to reproduce the behavior:

cat /etc/redhat-release
Fedora release 40 (Forty)

cd /tmp
mkdir ./1

cat ./1.yml 
services:
  service1:
    image: nginx
    environment:
      - PORT=3000
    ports:
      - "3000:3000"
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:3004/ping"]
      interval: 2s
      timeout: 60s
      retries: 20
  service2:
    image: nginx
    environment:
      - PORT=3001
    ports:
      - "3001:3001"
    depends_on:
      service1:
        condition: service_healthy

The output:

podman-compose -f ./1.yml up
c2bc8480422f4928b89b1c3df0377400119c9b64e2887f194c191aae700c9973
392676cc1f8e24157f7d552dded36c13a78e1c55a5d3f5207459d98b4e38e5ff
040953219ede6b412713817b6b658d8f85f2da78978c49b933d9d0689c7f91e6
[service1] | cannot open `/run/user/1000/crun/392676cc1f8e24157f7d552dded36c13a78e1c55a5d3f5207459d98b4e38e5ff/exec.fifo`: No such file or directory
[service1] | Error: unable to start container 392676cc1f8e24157f7d552dded36c13a78e1c55a5d3f5207459d98b4e38e5ff: `/usr/bin/crun start 392676cc1f8e24157f7d552dded36c13a78e1c55a5d3f5207459d98b4e38e5ff` failed: exit status 1
[service2] | /docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
<cut off>
[service2] | 2025/01/24 01:42:11 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 524288:524288
[service2] | 2025/01/24 01:42:11 [notice] 1#1: start worker processes
[service2] | 2025/01/24 01:42:11 [notice] 1#1: start worker process 24
[service2] | 2025/01/24 01:42:11 [notice] 1#1: start worker process 25
[service2] | 2025/01/24 01:42:11 [notice] 1#1: start worker process 26
[service2] | 2025/01/24 01:42:11 [notice] 1#1: start worker process 27

Status check:

podman ps -a
CONTAINER ID  IMAGE                           COMMAND               CREATED         STATUS                    PORTS                           NAMES
30ab44b2f16b  docker.io/library/nginx:latest  nginx -g daemon o...  10 seconds ago  Up 10 seconds (starting)  0.0.0.0:3000->3000/tcp, 80/tcp  az_vault_service1_1
088926160b96  docker.io/library/nginx:latest  nginx -g daemon o...  10 seconds ago  Up 9 seconds              0.0.0.0:3001->3001/tcp, 80/tcp  az_vault_service2_1

< in a minute>
podman ps -a
CONTAINER ID  IMAGE                           COMMAND               CREATED             STATUS                         PORTS                           NAMES
30ab44b2f16b  docker.io/library/nginx:latest  nginx -g daemon o...  About a minute ago  Up About a minute (unhealthy)  0.0.0.0:3000->3000/tcp, 80/tcp  az_vault_service1_1
088926160b96  docker.io/library/nginx:latest  nginx -g daemon o...  About a minute ago  Up About a minute              0.0.0.0:3001->3001/tcp, 80/tcp  az_vault_service2_1

Expected behavior As per doc the service_2 should not be started until after service_1 is reported "healthy".

Actual behavior

podman ps -a
CONTAINER ID  IMAGE                           COMMAND               CREATED        STATUS                    PORTS                           NAMES
30ab44b2f16b  docker.io/library/nginx:latest  nginx -g daemon o...  2 minutes ago  Up 2 minutes (unhealthy)  0.0.0.0:3000->3000/tcp, 80/tcp  az_vault_service1_1
088926160b96  docker.io/library/nginx:latest  nginx -g daemon o...  2 minutes ago  Up 2 minutes              0.0.0.0:3001->3001/tcp, 80/tcp  az_vault_service2_1

service_2 is happily running.

Output

podman-compose -v
podman-compose version 1.2.0
podman version 5.3.1
...

Environment:

  • OS: Linux / WSL / Mac cat /etc/redhat-release Fedora release 40 (Forty)

Additional context

adding

version: '3.8'

or 3.20

at the top of the file, "fixes" the error issue. the "podman-compose up ":

podman-compose -f ./1.yml up
0c76caa9774ee833a68c9ad074ab47e230744b9975ce617d7c53f61371010912
d41f2733bdbe57458f109f1b7c450b151a94279316f61af879ea5fbedb8a19bb
96cbc4f5bb0940010535fb107a93cc518600ca74854b84395a572597e666417d
[service1] | /docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
[service1] | /docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/

Yet, it still starts both services at the same time.

Possible unrelated piece of information:

 podman compose -f ./1.yml up
>>>> Executing external compose provider "/usr/libexec/docker/cli-plugins/docker-compose". Please see podman-compose(1) for how to disable this message. <<<<

network az_vault_default was found but has incorrect label com.docker.compose.network set to "" (expected: "default")
Error: executing /usr/libexec/docker/cli-plugins/docker-compose -f ./1.yml up: exit status 1

Appears the issue is related to #1072 , #866

az-z avatar Jan 24 '25 02:01 az-z

the podman compose ( as in podman + docker's compose plugin) works as expected:

podman compose -f ./1.yml up
>>>> Executing external compose provider "/usr/libexec/docker/cli-plugins/docker-compose". Please see podman-compose(1) for how to disable this message. <<<<

[+] Running 3/3
 ✔ Network test_default       Created                                                                                                                              0.0s 
 ✔ Container test-service1-1  Created                                                                                                                              0.5s 
 ✔ Container test-service2-1  Created                                                                                                                              0.1s 
Attaching to service1-1, service2-1
service1-1  | /docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
<cut off>
service1-1  | 2025/01/24 16:03:43 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 524288:524288
service1-1  | 2025/01/24 16:03:43 [notice] 1#1: start worker processes
service1-1  | 2025/01/24 16:03:43 [notice] 1#1: start worker process 25
service1-1  | 2025/01/24 16:03:43 [notice] 1#1: start worker process 26
service1-1  | 2025/01/24 16:03:43 [notice] 1#1: start worker process 27
service1-1  | 2025/01/24 16:03:43 [notice] 1#1: start worker process 28
Gracefully stopping... (press Ctrl+C again to force)
[+] Stopping 2/2
 ✔ Container test-service2-1  Stopped                                                                                                                             10.2s 
 ✔ Container test-service1-1  Stopped   

az-z avatar Jan 24 '25 17:01 az-z

even though "podman compose" ( with docker compose plugin) addresses the bug described here, it doesn't allow any pod functionality. As such I can not list that as a potential workaround :<.

I'm surprised. I'm sure "Depends" worked as expected in my other projects. I'm not sure what to think, but clearly, it is a serious blocker for me atm.

az-z avatar Jan 25 '25 19:01 az-z

I also get the following error

[proxy]  | Error: unable to start container 0903cd817f1a72b1fc4fa7254e0e90de3a2a28138cb42f1776a5bf90ea1b936b: preparing container 0903cd817f1a72b1fc4fa7254e0e90de3a2a28138cb42f1776a5bf90ea1b936b for attach: generating dependency graph for container 0903cd817f1a72b1fc4fa7254e0e90de3a2a28138cb42f1776a5bf90ea1b936b: container 1fddf9866636ac9fec0d3f1ec7fa413ac4ac27a10ceb2856ffb8c78080266093 depends on container acf95ab3e65624f185b54e609025c6b668beb280e7d6cba6813847e24fc3b9ea not found in input list: no such container

If I apply service_started instead of service_healthy, I don't get the error.

phi-friday avatar Mar 04 '25 03:03 phi-friday

From what I remember they didn't implement that.

On Mon, Mar 3, 2025, 10:29 PM phi-friday @.***> wrote:

I also get the following error

[proxy] | Error: unable to start container 0903cd817f1a72b1fc4fa7254e0e90de3a2a28138cb42f1776a5bf90ea1b936b: preparing container 0903cd817f1a72b1fc4fa7254e0e90de3a2a28138cb42f1776a5bf90ea1b936b for attach: generating dependency graph for container 0903cd817f1a72b1fc4fa7254e0e90de3a2a28138cb42f1776a5bf90ea1b936b: container 1fddf9866636ac9fec0d3f1ec7fa413ac4ac27a10ceb2856ffb8c78080266093 depends on container acf95ab3e65624f185b54e609025c6b668beb280e7d6cba6813847e24fc3b9ea not found in input list: no such container

If I apply service_started instead of service_healthy, I don't get the error.

— Reply to this email directly, view it on GitHub https://github.com/containers/podman-compose/issues/1119#issuecomment-2696090741, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABGHHXJYHCJ2FTNVYRXQI3D2SUM2PAVCNFSM6AAAAABVYVOVXGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMOJWGA4TANZUGE . You are receiving this because you authored the thread.Message ID: @.***> [image: phi-friday]phi-friday left a comment (containers/podman-compose#1119) https://github.com/containers/podman-compose/issues/1119#issuecomment-2696090741

I also get the following error

[proxy] | Error: unable to start container 0903cd817f1a72b1fc4fa7254e0e90de3a2a28138cb42f1776a5bf90ea1b936b: preparing container 0903cd817f1a72b1fc4fa7254e0e90de3a2a28138cb42f1776a5bf90ea1b936b for attach: generating dependency graph for container 0903cd817f1a72b1fc4fa7254e0e90de3a2a28138cb42f1776a5bf90ea1b936b: container 1fddf9866636ac9fec0d3f1ec7fa413ac4ac27a10ceb2856ffb8c78080266093 depends on container acf95ab3e65624f185b54e609025c6b668beb280e7d6cba6813847e24fc3b9ea not found in input list: no such container

If I apply service_started instead of service_healthy, I don't get the error.

— Reply to this email directly, view it on GitHub https://github.com/containers/podman-compose/issues/1119#issuecomment-2696090741, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABGHHXJYHCJ2FTNVYRXQI3D2SUM2PAVCNFSM6AAAAABVYVOVXGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMOJWGA4TANZUGE . You are receiving this because you authored the thread.Message ID: @.***>

az-z avatar Mar 05 '25 00:03 az-z