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

compose fails with depends_on:service_healthy with various errors. #1119

Open
az-z opened this issue Jan 24, 2025 · 2 comments
Open

compose fails with depends_on:service_healthy with various errors. #1119

az-z opened this issue Jan 24, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@az-z
Copy link

az-z commented Jan 24, 2025

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 az-z added the bug Something isn't working label Jan 24, 2025
@az-z az-z changed the title compose fails with depends_on:service_healthy in various way compose fails with depends_on:service_healthy with various errors. Jan 24, 2025
@az-z
Copy link
Author

az-z commented Jan 24, 2025

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
Copy link
Author

az-z commented Jan 25, 2025

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.

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