docker / docker/cli

CLI hangs on interactive run when container fails to attach to network

Open
#5,235 2 comments 0 reactions 1 assignee View on GitHub

@laurazard is already working on this.

Since Jul 27, 2024.

kind/bug status/0-triage
Dominant language
Go
Stars
6.1k
Forks
2.2k
Avg merge
1d 15h
Merged PRs (30d)
43

Description

Description
Reproduce
$ docker swarm init
$ docker network create \
  --driver overlay \
  --ipv6 \
  --opt encrypted \
  --subnet "10.0.100.0/24" \
  --subnet "fd14:8656:a32e:100::/64" \
  --attachable \
  test
$ docker run --rm -it --network test alpine
Expected behavior

The CLI should handle SIGINTs and not hang.

docker version
Happens on recent builds:

Client:
 Version:           27.0.1-45-g4029dbc129
 API version:       1.46
 Go version:        go1.22.1
 Git commit:        4029dbc129
 Built:             Fri Jul  5 10:31:39 2024
 OS/Arch:           darwin/arm64
 Context:           desktop-linux

But also already happens as far back 25.0 (maybe more).

Additional Info

From Slack (@akerouanton):

[...]
adding this subnet makes the docker run command send a ContainerStart request to the daemon, then the daemon makes a gRPC call to swarmkit and things hangs there for 30s. Until the CLI's stdin/out/err are attached to the container, maybe the right behavior should be to cancel the request?
[...]

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.