containers / containers/podman-compose

compose fails with depends_on:service_healthy with various errors.

Open
#1,119 4 comments 8 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
6.2k
Forks
622
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
A clear and concise description of what the bug is.
compose does not support(?) or failed to properly support
```
depends_on:
:
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

[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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.