Skip to content

network start: Docker launcher discards container output on premature exit (same as #597 for native) #677

Description

@lwshang

Problem

#597 / #675 / #676 fix the native launcher so that when it exits prematurely (e.g. a fixed gateway port is already taken) the user sees the actual cause instead of just exited prematurely with status 101.

The Docker launcher path has the identical bug and is untouched. When network start runs the launcher in a container — always on Windows, and on unix with autocontainerize=true or a docker-mode network — it goes through spawn_docker_launcher, not spawn_network_launcher. On premature exit it returns ContainerExitedPrematurely with only the exit status, and never surfaces the container's output — even though it attaches stdout/stderr (attach_stdout/attach_stderr: Some(true)).

Suggested fix

In the premature-exit arm of the select! in spawn_docker_launcher (mirroring premature_exit_detail from the native path), fetch the container log tail via bollard's logs() API and fold it into ContainerExitedPrematurely. Note this is a different mechanism from the native fix (no local stderr.log file; the daemon owns the stdio), so it does not reuse premature_exit_detail.

Notes

Discovered while reviewing #675 and implementing #676.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions