{"record":{"id":"f554c8434fd2b8b1","repo":"vectordotdev/vector","slug":"docker-host-is-not-a-socket-path","errorCode":null,"errorMessage":"$DOCKER_HOST is not a socket path","messagePattern":"\\$DOCKER_HOST is not a socket path","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"vdev/src/testing/docker.rs","lineNumber":42,"sourceCode":"            .stdout(Stdio::null())\n            .stderr(Stdio::null())\n            .spawn()\n            .and_then(|mut child| child.wait())\n            .is_ok_and(|status| status.success())\n        {\n            return OsString::from(String::from(tool));\n        }\n    }\n    fatal!(\"No container tool could be detected.\");\n}\n\nfn detect_docker_socket() -> PathBuf {\n    match env::var_os(\"DOCKER_HOST\") {\n        Some(host) => host\n            .into_string()\n            .expect(\"Invalid value in $DOCKER_HOST\")\n            .strip_prefix(\"unix://\")\n            .expect(\"$DOCKER_HOST is not a socket path\")\n            .into(),\n        None => \"/var/run/docker.sock\".into(),\n    }\n}\n","sourceCodeStart":24,"sourceCodeEnd":47,"githubUrl":"https://github.com/vectordotdev/vector/blob/bdb87aeaa4c4ff27c0ba643c1c77b21bf2ef4013/vdev/src/testing/docker.rs#L24-L47","documentation":"vdev's detect_docker_socket() resolves the Docker socket path. If DOCKER_HOST is set, it must be a Unix domain socket URL with the unix:// prefix; any other scheme (tcp://, npipe://, ssh://, or a bare path) causes this panic because strip_prefix(\"unix://\") returns None. The tool only supports local socket-based Docker endpoints.","triggerScenarios":"Running any vdev command that touches Docker (integration tests, container management) with DOCKER_HOST set to a non-unix:// value, e.g. DOCKER_HOST=tcp://127.0.0.1:2375, DOCKER_HOST=ssh://user@host, or DOCKER_HOST=/var/run/docker.sock (missing prefix).","commonSituations":"Developers using Docker over TCP or a remote Docker context (docker context use to a remote/TCP host), Docker Desktop on Windows/macOS exporting npipe:// or unix:// variants, or CI environments exporting DOCKER_HOST pointing at a remote daemon (e.g. dind over TCP).","solutions":["Unset DOCKER_HOST so the default /var/run/docker.sock is used, provided Docker runs locally","Rewrite DOCKER_HOST to the unix socket form, e.g. DOCKER_HOST=unix:///var/run/docker.sock","For a remote/TCP daemon, start a local Docker daemon or expose the remote socket locally (e.g. via SSH tunnel to a unix socket) since vdev only supports unix:// sockets","Verify with `echo $DOCKER_HOST` and `docker context show` that the active context is a local unix-socket endpoint"],"exampleFix":"// before\nexport DOCKER_HOST=tcp://127.0.0.1:2375\ncargo vdev int start aws\n// after\nunset DOCKER_HOST\ncargo vdev int start aws","handlingStrategy":"validation","validationCode":"if [[ -n \"$DOCKER_HOST\" && \"$DOCKER_HOST\" != unix://* ]]; then echo \"DOCKER_HOST must start with unix:// (got: $DOCKER_HOST)\"; exit 1; fi","typeGuard":"function isUnixSocketHost(host: string): boolean { return host.startsWith('unix://'); }","tryCatchPattern":null,"preventionTips":["Leave DOCKER_HOST unset when using the local default daemon","Never export DOCKER_HOST with tcp:// or ssh:// for vdev work","Check `docker context inspect` to confirm the active context uses a unix socket","Add an env guard in CI scripts before invoking vdev"],"tags":["docker","environment","configuration"],"backgroundTag":"invalid-env-var-value","analyzedSha":"bdb87aeaa4c4ff27c0ba643c1c77b21bf2ef4013","analyzedAt":"2026-09-16T02:53:35.741Z","contentChangedAt":"2026-09-16T02:53:35.741Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}