{"record":{"id":"b9b7a4224daa9ddd","repo":"docker/cli","slug":"command-v-has-exited-with-v-make-sure-the-url-i","errorCode":null,"errorMessage":"command %v has exited with %v, make sure the URL is valid, and Docker 18.09 or later is installed on the remote host: stderr=%s","messagePattern":"command (.+?) has exited with (.+?), make sure the URL is valid, and Docker 18\\.09 or later is installed on the remote host: stderr=(.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/connhelper/commandconn/commandconn.go","lineNumber":161,"sourceCode":"\t\tselect {\n\t\tcase werr = <-werrCh:\n\t\t\tc.cmdWaitErr = werr\n\t\t\tc.cmdExited.Store(true)\n\t\tcase <-time.After(10 * time.Second):\n\t\t\tc.stderrMu.Lock()\n\t\t\tstderr := c.stderr.String()\n\t\t\tc.stderrMu.Unlock()\n\t\t\treturn fmt.Errorf(\"command %v did not exit after %v: stderr=%q\", c.cmd.Args, err, stderr)\n\t\t}\n\t}\n\n\tif werr == nil {\n\t\treturn err\n\t}\n\tc.stderrMu.Lock()\n\tstderr := c.stderr.String()\n\tc.stderrMu.Unlock()\n\treturn fmt.Errorf(\"command %v has exited with %v, make sure the URL is valid, and Docker 18.09 or later is installed on the remote host: stderr=%s\", c.cmd.Args, werr, stderr)\n}\n\nfunc ignorableCloseError(err error) bool {\n\treturn strings.Contains(err.Error(), os.ErrClosed.Error())\n}\n\nfunc (c *commandConn) Read(p []byte) (int, error) {\n\tn, err := c.stdout.Read(p)\n\t// check after the call to Read, since\n\t// it is blocking, and while waiting on it\n\t// Close might get called\n\tif c.closing.Load() {\n\t\t// If we're currently closing the connection\n\t\t// we don't want to call onEOF\n\t\treturn n, err\n\t}\n\n\treturn n, c.handleEOF(err)","sourceCodeStart":143,"sourceCodeEnd":179,"githubUrl":"https://github.com/docker/cli/blob/4f84911bfe8811e9b028e4b1fee8e7510be79387/cli/connhelper/commandconn/commandconn.go#L143-L179","documentation":"Raised by commandConn.handleEOF (commandconn.go:155-161) when io.EOF was received on the stream, cmd.Wait() returned within 10s, and Wait returned a non-nil error. The message includes the command args, the wait error, and captured stderr, and explicitly reminds the user the remote host needs Docker 18.09+ with a valid URL.","triggerScenarios":"A commandConn backing an HTTP transport (typically `ssh ... docker system dial-stdio`) exits non-zero. handleEOF wraps the wait error and stderr. The original failure is usually visible in stderr — e.g. `docker: command not found`, `Cannot connect to the Docker daemon`, or ssh auth failure.","commonSituations":"Remote host lacks Docker or has it not in PATH for the non-login ssh session; the remote dockerd socket path is wrong (DOCKER_HOST socket path in the URL); ssh key/auth issues; remote Docker older than 18.09 so `docker system dial-stdio` is an unknown subcommand. The message bundles all of these and points at the version requirement.","solutions":["Read the embedded stderr in the error — it names the real cause (e.g. 'docker: command not found', 'permission denied').","Ensure Docker 18.09+ is installed on the remote host and the docker CLI is on PATH for non-interactive ssh.","Confirm the remote docker.sock path matches the DOCKER_HOST ssh URL (default /var/run/docker.sock).","Verify ssh authentication works non-interactively: `ssh <user>@<host> docker version`.","If the remote daemon needs root/group permissions, ensure the ssh user is in the docker group."],"exampleFix":"# before — wrong socket path / missing docker on remote\nexport DOCKER_HOST=ssh://user@host\n# after — verify docker present and socket path\ncmd\nssh user@host 'docker version; ls -l /var/run/docker.sock'\n# then set the correct path in the URL if needed\nexport DOCKER_HOST=ssh://user@host/var/run/docker.sock","handlingStrategy":"validation","validationCode":"// Pre-flight: confirm docker CLI and socket exist on the remote host.\ncmd := exec.Command(\"ssh\", \"-o\", \"ConnectTimeout=30\", \"-T\", userHost, \"sh\", \"-c\", \"command -v docker && test -S /var/run/docker.sock\")\nif out, err := cmd.CombinedOutput(); err != nil {\n    return fmt.Errorf(\"remote docker not ready: %v: %s\", err, out)\n}","typeGuard":null,"tryCatchPattern":"conn, err := helper.Dialer(ctx, \"tcp\", \"\")\nif err != nil {\n    return fmt.Errorf(\"remote docker dial failed (need Docker 18.09+?): %w\", err)\n}","preventionTips":["Verify `docker version` runs over ssh non-interactively.","Ensure the ssh user is in the docker group or use a correct socket path.","Add the socket path to DOCKER_HOST when it's not the default."],"tags":["connhelper","commandconn","ssh","docker-daemon","remote"],"backgroundTag":null,"analyzedSha":"4f84911bfe8811e9b028e4b1fee8e7510be79387","analyzedAt":"2026-08-07T12:15:29.814Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}