{"record":{"id":"696abade43da35f1","repo":"spring-projects/spring-boot","slug":"connection-to-the-docker-daemon-at-failed-wit","errorCode":null,"errorMessage":"Connection to the Docker daemon at '{}' failed with error \"{}\"; ensure the Docker daemon is running and accessible","messagePattern":"Connection to the Docker daemon at '(.+?)' failed with error \"(.+?)\"; ensure the Docker daemon is running and accessible","errorType":"exception","errorClass":"DockerConnectionException","httpStatus":null,"severity":"critical","filePath":"buildpack/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/transport/HttpClientTransport.java","lineNumber":176,"sourceCode":"\t}\n\n\tprivate Response execute(HttpUriRequest request) {\n\t\ttry {\n\t\t\tbeforeExecute(request);\n\t\t\tClassicHttpResponse response = this.client.executeOpen(this.host, request, null);\n\t\t\tint statusCode = response.getCode();\n\t\t\tif (statusCode >= 400 && statusCode <= 500) {\n\t\t\t\tbyte[] content = readContent(response);\n\t\t\t\tresponse.close();\n\t\t\t\tErrors errors = (statusCode != 500) ? deserializeErrors(content) : null;\n\t\t\t\tMessage message = deserializeMessage(content);\n\t\t\t\tthrow new DockerEngineException(this.host.toHostString(), request.getUri(), statusCode,\n\t\t\t\t\t\tresponse.getReasonPhrase(), errors, message, content);\n\t\t\t}\n\t\t\treturn new HttpClientResponse(response);\n\t\t}\n\t\tcatch (IOException | URISyntaxException ex) {\n\t\t\tthrow new DockerConnectionException(this.host.toHostString(), ex);\n\t\t}\n\t}\n\n\tprotected void beforeExecute(HttpRequest request) {\n\t}\n\n\tprivate byte @Nullable [] readContent(ClassicHttpResponse response) throws IOException {\n\t\tHttpEntity entity = response.getEntity();\n\t\tif (entity == null) {\n\t\t\treturn null;\n\t\t}\n\t\ttry (InputStream stream = entity.getContent()) {\n\t\t\treturn (stream != null) ? stream.readAllBytes() : null;\n\t\t}\n\t}\n\n\tprivate @Nullable Errors deserializeErrors(byte @Nullable [] content) {\n\t\tif (content == null) {","sourceCodeStart":158,"sourceCodeEnd":194,"githubUrl":"https://github.com/spring-projects/spring-boot/blob/270dfe353fb830fd69b823a8a859287ff103854b/buildpack/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/transport/HttpClientTransport.java#L158-L194","documentation":"HttpClientTransport.execute caught IOException | URISyntaxException from client.executeOpen (or request.getUri()) and threw DockerConnectionException. The message is built by DockerConnectionException.buildMessage: 'Connection to the Docker daemon at <host> failed with error \"<cause message>\"; ensure the Docker daemon is running and accessible'. A JNA LastErrorException in the cause chain is unwrapped specially. This fires whenever the daemon cannot be reached at all, as opposed to a daemon that responds with an error (which is error 73).","triggerScenarios":"client.executeOpen(host, request, null) at line 163 throws IOException (connection refused, socket not found, timeout, TLS handshake failure, unknown host) or request.getUri() throws URISyntaxException because DOCKER_HOST is malformed.","commonSituations":"Local Docker Desktop not started; DOCKER_HOST=unix:///var/run/docker.sock but the socket is missing or owned by root with no group access; remote DOCKER_HOST behind a firewall or wrong port; DOCKER_HOST typo (e.g. tcp:/docker:2375 with a single slash); TLS cert mismatch against a tcp:// daemon.","solutions":["Confirm the daemon is reachable with the same DOCKER_HOST: `docker info` or `docker version`.","Start the daemon: Docker Desktop, or `sudo systemctl start docker` on Linux.","Fix socket access: `sudo usermod -aG docker $USER` then log out/in, or chmod the socket.","Correct the DOCKER_HOST value (scheme://host:port for tcp, unix:///path for sockets)."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Health-check the daemon before invoking the build\nProcess p = new ProcessBuilder(\"docker\", \"info\").redirectErrorStream(true).start();\nif (p.waitFor() != 0) {\n    throw new IllegalStateException(\n        \"Docker daemon is not reachable. Start Docker and verify DOCKER_HOST=\"\n        + System.getenv().getOrDefault(\"DOCKER_HOST\", \"(default)\"));\n}","typeGuard":null,"tryCatchPattern":"try {\n    transport.get(uri);\n} catch (DockerConnectionException ex) {\n    // ex.getMessage() already names the host and underlying error;\n    // surface a hint to start the daemon / fix DOCKER_HOST / socket permissions\n    throw ex;\n}","preventionTips":["Add a `docker info` healthcheck at the start of CI pipelines.","Validate the DOCKER_HOST format (unix:///path or tcp://host:port).","On Linux, ensure the build user is in the docker group or the socket is readable."],"tags":["docker","network","connection","daemon","buildpack"],"backgroundTag":null,"analyzedSha":"270dfe353fb830fd69b823a8a859287ff103854b","analyzedAt":"2026-08-11T19:42:06.541Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}