{"record":{"id":"bf424aa18db0d881","repo":"GoogleContainerTools/jib","slug":"timeout-reached-while-waiting-for-docker-info-ou","errorCode":null,"errorMessage":"Timeout reached while waiting for 'docker info' output","messagePattern":"Timeout reached while waiting for 'docker info' output","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"jib-core/src/main/java/com/google/cloud/tools/jib/docker/CliDockerClient.java","lineNumber":210,"sourceCode":"    this.processBuilderFactory = processBuilderFactory;\n  }\n\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) {","sourceCodeStart":192,"sourceCodeEnd":228,"githubUrl":"https://github.com/GoogleContainerTools/jib/blob/fb949e2676afbbd7dd7a1ef61e20251931325654/jib-core/src/main/java/com/google/cloud/tools/jib/docker/CliDockerClient.java#L192-L228","documentation":"CliDockerClient.info() runs 'docker info' and reads its JSON output on a separate thread with a fixed timeout (DOCKER_OUTPUT_TIMEOUT). If the reader thread does not finish within that window, the future is cancelled and an IOException is thrown. This guards against a hung or unresponsive Docker daemon.","triggerScenarios":"Running 'docker info' where the daemon is unresponsive, heavily loaded, or the process produces no/partial output before the timeout elapses; readerFuture.get(...) throws TimeoutException.","commonSituations":"Docker Desktop not fully started, daemon frozen, resource exhaustion on the host, slow VM/network filesystems, or a very large docker info output on a busy machine.","solutions":["Verify the Docker daemon is healthy: run 'docker info' manually and confirm it returns promptly","Restart Docker Desktop / the docker daemon and retry","Check host load and disk I/O; free resources if the machine is overloaded","If this recurs in CI, increase DOCKER_OUTPUT_TIMEOUT (it is a constant in CliDockerClient) or pre-warm the daemon before the build"],"exampleFix":"// before\nDockerInfoDetails details = dockerClient.info(); // hangs, then IOException\n// after\nif (!isDockerResponsive()) { // shell out to 'docker info' with your own generous timeout\n  throw new SkipBuildException(\"Docker daemon unresponsive\");\n}\nDockerInfoDetails details = dockerClient.info();","handlingStrategy":"retry","validationCode":"// Pre-check daemon responsiveness with a generous timeout\nProcess p = new ProcessBuilder(\"docker\", \"info\", \"--format\", \"ok\").start();\nboolean ok = p.waitFor(30, TimeUnit.SECONDS) && p.exitValue() == 0;","typeGuard":null,"tryCatchPattern":"try {\n  details = dockerClient.info();\n} catch (IOException e) {\n  if (e.getMessage().contains(\"Timeout reached\")) {\n    restartDockerDaemon(); // or retry after backoff\n  } else { throw e; }\n}","preventionTips":["Ensure Docker is fully started before CI builds (wait-for-docker step)","Monitor host load; timeouts correlate with resource starvation","Restart the daemon periodically in long-lived build agents"],"tags":["docker","timeout","cli","io"],"backgroundTag":"request-timeout","analyzedSha":"fb949e2676afbbd7dd7a1ef61e20251931325654","analyzedAt":"2026-09-06T14:04:09.491Z","contentChangedAt":"2026-09-06T14:04:09.491Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}