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

docker buildx ls / docker builder ls output for failures could use some TLC #764

Open
thaJeztah opened this issue Sep 9, 2021 · 2 comments · May be fixed by #830
Open

docker buildx ls / docker builder ls output for failures could use some TLC #764

thaJeztah opened this issue Sep 9, 2021 · 2 comments · May be fixed by #830

Comments

@thaJeztah
Copy link
Member

For testing-purposes I had various "broken" contexts on my machine. As a result, trying to run docker buildx ls (or docker builder ls) produces a very "messy" / "confusing" output. While this may not be a standard scenario, I think we should try to make this more elegant.

docker buildx ls
WARN[0020] commandConn.CloseWrite: commandconn: failed to wait: signal: killed
WARN[0020] commandConn.CloseWrite: commandconn: failed to wait: signal: killed
WARN[0020] commandConn.CloseWrite: commandconn: failed to wait: signal: killed
WARN[0020] commandConn.CloseRead: commandconn: failed to wait: signal: killed
WARN[0020] commandConn.CloseWrite: commandconn: failed to wait: signal: killed
WARN[0020] commandConn.CloseWrite: commandconn: failed to wait: signal: killed
WARN[0020] commandConn.CloseRead: commandconn: failed to wait: signal: killed
WARN[0020] commandConn.CloseWrite: commandconn: failed to wait: signal: killed
WARN[0020] commandConn.CloseWrite: commandconn: failed to wait: signal: killed
WARN[0020] commandConn.CloseWrite: commandconn: failed to wait: signal: killed
WARN[0020] commandConn.CloseRead: commandconn: failed to wait: signal: killed
WARN[0020] commandConn.CloseWrite: commandconn: failed to wait: signal: killed
WARN[0020] commandConn.CloseWrite: commandconn: failed to wait: signal: killed
NAME/NODE         DRIVER/ENDPOINT             STATUS   PLATFORMS
serene_mcnulty    docker-container
  serene_mcnulty0 unix:///var/run/docker.sock inactive
broken-ssh        docker-container
  broken-ssh      broken-ssh                  Get "http://docker.example.com/v1.24/containers/buildx_buildkit_broken-ssh/json": context deadline exceeded
desktop-linux     docker
  desktop-linux   desktop-linux               running linux/amd64, linux/arm64, linux/riscv64, linux/ppc64le, linux/s390x, linux/386, linux/arm/v7, linux/arm/v6
dind              docker-container
  dind            dind                        Cannot connect to the Docker daemon at tcp://localhost:2375. Is the docker daemon running?
hackdoor1         docker-container
  hackdoor1       hackdoor1                   error during connect: Get "http://docker.example.com/v1.24/containers/buildx_buildkit_hackdoor1/json": command [ssh -- old-prod.corp1.citigroup.com docker system dial-stdio] has exited with exit status 255, please make sure the URL is valid, and Docker 18.09 or later is installed on the remote host: stderr=ssh: Could not resolve hostname old-prod.corp1.citigroup.com: nodename nor servname provided, or not known

master             docker-container
  master           master           Cannot connect to the Docker daemon at tcp://localhost:2375. Is the docker daemon running?
minecraft-test     docker
  minecraft-test   minecraft-test   running linux/amd64, linux/386
my-context         docker-container
  my-context       my-context       error during connect: Get "http://myserver:2376/v1.24/containers/buildx_buildkit_my-context/json": dial tcp: lookup myserver on 8.8.8.8:53: no such host
my-remote-engine   docker
  my-remote-engine my-remote-engine running linux/amd64, linux/arm64, linux/riscv64, linux/ppc64le, linux/s390x, linux/386, linux/arm/v7, linux/arm/v6
swarm-test-01      docker
  swarm-test-01    swarm-test-01    running linux/amd64, linux/arm64, linux/riscv64, linux/ppc64le, linux/s390x, linux/386, linux/arm/v7, linux/arm/v6
default *          docker
  default          default          running linux/amd64, linux/arm64, linux/riscv64, linux/ppc64le, linux/s390x, linux/386, linux/arm/v7, linux/arm/v6

There also looks to be a really long timeout in place (this may be in the docker cli, not sure):

time docker buildx ls
...
________________________________________________________
Executed in   21.12 secs   fish           external
   usr time  438.13 millis  144.00 micros  437.99 millis
   sys time  526.49 millis  936.00 micros  525.55 millis

Wondering if we would be able to print information "when it arrives". Currently, no output is generated until the command times out. Perhaps we can either;

  • print the builder once we're able to connect (adding lines to the output when they arrive)
  • print all builders, but show "pending" (e.g.) and refresh the lines once we were able to connect.

So something like:

NAME/NODE         DRIVER/ENDPOINT             STATUS   PLATFORMS
serene_mcnulty    docker-container
  serene_mcnulty0 unix:///var/run/docker.sock inactive
broken-ssh        docker-container
  broken-ssh      broken-ssh                  pending
desktop-linux     docker
  desktop-linux   desktop-linux               running linux/amd64, linux/arm64, linux/riscv64, linux/ppc64le, linux/s390x, linux/386, linux/arm/v7, linux/arm/v6
dind              docker-container
  dind            dind                        pending

...

NAME/NODE         DRIVER/ENDPOINT             STATUS   PLATFORMS
serene_mcnulty    docker-container
  serene_mcnulty0 unix:///var/run/docker.sock inactive
broken-ssh        docker-container
  broken-ssh      broken-ssh                  unknown
desktop-linux     docker
  desktop-linux   desktop-linux               running linux/amd64, linux/arm64, linux/riscv64, linux/ppc64le, linux/s390x, linux/386, linux/arm/v7, linux/arm/v6
dind              docker-container
  dind            dind                        unknown


Failed to get status for 'broken-ssh': Get "http://docker.example.com/v1.24/containers/buildx_buildkit_broken-ssh/json": context deadline exceeded
Failed to get status for 'dind': Cannot connect to the Docker daemon at tcp://localhost:2375. Is the docker daemon running?
@thaJeztah
Copy link
Member Author

/cc @crazy-max

@crazy-max
Copy link
Member

I started to revisit ls cmd and will come with a PR soon.

About WARN[0020] commandConn.CloseWrite: commandconn: failed to wait: signal: killed, that seems linked to docker/cli while using an ssh:// remote: https://github.com/docker/cli/blob/3fb4fb83dfb5db0c0753a8316f21aea54dab32c5/cli/connhelper/commandconn/commandconn.go#L203-L214

Seems compose has the same issue docker/compose#8544

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants