{"record":{"id":"ed6bcec5e9f75473","repo":"GoogleContainerTools/jib","slug":"failed-to-read-output-of-docker-info-message","errorCode":null,"errorMessage":"Failed to read output of 'docker info': <message>","messagePattern":"Failed to read output of 'docker info': <message>","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"jib-core/src/main/java/com/google/cloud/tools/jib/docker/CliDockerClient.java","lineNumber":212,"sourceCode":"\n  @Override\n  public boolean supported(Map<String, String> parameters) {\n    return true;\n  }\n\n  @Override\n  public DockerInfoDetails info() throws IOException, InterruptedException {\n    // Runs 'docker info'.\n    ExecutorService executor = Executors.newSingleThreadExecutor();\n    Future<DockerInfoDetails> readerFuture = executor.submit(this::fetchInfoDetails);\n    try {\n      DockerInfoDetails details = readerFuture.get(DOCKER_OUTPUT_TIMEOUT, TimeUnit.MILLISECONDS);\n      return details;\n    } catch (TimeoutException e) {\n      readerFuture.cancel(true); // Interrupt the reader thread\n      throw new IOException(\"Timeout reached while waiting for 'docker info' output\");\n    } catch (ExecutionException e) {\n      throw new IOException(\"Failed to read output of 'docker info': \" + e.getMessage());\n    } finally {\n      executor.shutdownNow();\n    }\n  }\n\n  @Override\n  public String load(ImageTarball imageTarball, Consumer<Long> writtenByteCountListener)\n      throws InterruptedException, IOException {\n    // Runs 'docker load'.\n    Process dockerProcess = docker(\"load\");\n\n    try (NotifyingOutputStream stdin =\n        new NotifyingOutputStream(dockerProcess.getOutputStream(), writtenByteCountListener)) {\n      imageTarball.writeTo(stdin);\n\n    } catch (IOException ex) {\n      // Tries to read from stderr. Not using getStderrOutput(), as we want to show the error\n      // message from the tarball I/O write failure when reading from stderr fails.","sourceCodeStart":194,"sourceCodeEnd":230,"githubUrl":"https://github.com/GoogleContainerTools/jib/blob/fb949e2676afbbd7dd7a1ef61e20251931325654/jib-core/src/main/java/com/google/cloud/tools/jib/docker/CliDockerClient.java#L194-L230","documentation":"CliDockerClient.info() submits fetchInfoDetails() to an executor; if that task itself throws (any Exception wrapped in ExecutionException), the error is rethrown as IOException 'Failed to read output of 'docker info': <message>'. This means reading or parsing the 'docker info' output failed, not that it timed out.","triggerScenarios":"fetchInfoDetails() throws internally — e.g. the 'docker info' process exits nonzero (see the 'docker info' command failed error), reading stdout fails with an IOException, or JSON parsing of the output fails.","commonSituations":"Broken/partial Docker installation, docker CLI printing non-JSON error text, daemon down so 'docker info' exits with an error, or I/O errors on the pipe between Jib and the docker process.","solutions":["Look at the embedded <message> (and its cause) to see the underlying failure","Run 'docker info' manually; fix any daemon/CLI error it reports","Verify 'docker info' emits valid JSON (docker info --format '{{json .}}'); upgrade Docker if the CLI is very old","If the daemon is down, start Docker Desktop / the docker service before running the build"],"exampleFix":"// before\nDockerInfoDetails details = dockerClient.info(); // IOException: Failed to read output...\n// after\ntry {\n  DockerInfoDetails details = dockerClient.info();\n} catch (IOException e) {\n  logger.warn(\"docker info failed: {} — check the daemon is running\", e.getMessage());\n  throw e;\n}","handlingStrategy":"try-catch","validationCode":"// Run 'docker info' yourself first and check it succeeds and prints JSON\nProcess p = new ProcessBuilder(\"docker\", \"info\").start();\nif (p.waitFor() != 0) throw new IllegalStateException(\"docker daemon unavailable\");","typeGuard":null,"tryCatchPattern":"try {\n  details = dockerClient.info();\n} catch (IOException e) {\n  // message: Failed to read output of 'docker info': <cause>\n  logger.error(\"docker info failed: {}\", e.getMessage(), e.getCause());\n  throw new UnhealthyDockerException(e);\n}","preventionTips":["Health-check the docker daemon at pipeline start","Keep the docker CLI reasonably up to date","Capture the cause chain when logging to preserve the underlying error"],"tags":["docker","cli","io","process"],"backgroundTag":"docker-command-failed","analyzedSha":"fb949e2676afbbd7dd7a1ef61e20251931325654","analyzedAt":"2026-09-06T14:04:09.491Z","contentChangedAt":"2026-09-06T14:04:09.491Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}