Skip to content

process-compose up returns 0 even when it fails to start due to busy socket #424

@mkenigs

Description

@mkenigs

Defect

  • Included the relevant configuration snippet
  • Included the relevant process-compose log (log location: process-compose info)
  • Included a [Minimal, Complete, and Verifiable example] (https://stackoverflow.com/help/mcve)

Version of process-compose:

1.75.2

OS environment:

macOS Sequoia

Steps or code to reproduce the issue:

I have process-compose.yaml with

version: "0.5"

processes:
  sleep:
    command: sleep infinity

I start one instance of process-compose successfully:

> process-compose up --detached --tui=false --log-file /tmp/log1
Starting Process Compose in detached mode. Use 'process-compose attach' to connect to it or 'process-compose down' to stop it
> cat /tmp/log1
25-12-08 13:59:36.904 INF Process Compose v1.75.2
25-12-08 13:59:36.904 INF Loaded project from /Users/matthew/flox/main/process-compose.yaml
25-12-08 13:59:36.904 INF Global shell command: bash -c
25-12-08 13:59:36.904 INF start http server listening :8080
25-12-08 13:59:36.906 INF Started command=["bash","-c","sleep infinity"] process=sleep

Then I add a second service to process-compose.yaml and run process-compose up:

> cat process-compose.yaml
version: "0.5"

processes:
  sleep:
    command: sleep infinity
  sleep2:
    command: sleep infinity
> process-compose up --detached --tui=false --log-file /tmp/log2
Starting Process Compose in detached mode. Use 'process-compose attach' to connect to it or 'process-compose down' to stop it
> echo $?
0
> process-compose list
sleep
> cat /tmp/log2
25-12-08 14:00:05.413 INF Process Compose v1.75.2
25-12-08 14:00:05.413 INF Loaded project from /Users/matthew/flox/main/process-compose.yaml
25-12-08 14:00:05.413 INF Global shell command: bash -c
25-12-08 14:00:05.414 INF start http server listening :8080
25-12-08 14:00:05.414 FTL start http server on :8080 failed error="listen tcp :8080: bind: address already in use"

Expected result:

The 0 return code makes me think that both services should be running, when the 2nd service isn't. I would expect process-compose up to return nonzero if process-compose was not successfully started. Since I'm detaching, obviously process-compose could hit a fatal error at some point after the process-compose up command exits, but I would expect that if the detached process-compose never completes successful startup, the process-compose up command exits nonzero

Granted I shouldn't be running process-compose up twice in a row, but I've accidentally been doing that and never caught the issue because the 2nd process-compose up was returning 0

Actual result:

0 returned

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions