GoogleContainerTools/jib · error · IOException
Timeout reached while waiting for 'docker info' output
Error message
Timeout reached while waiting for 'docker info' output
What it means
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.
Source
Thrown at jib-core/src/main/java/com/google/cloud/tools/jib/docker/CliDockerClient.java:210
this.processBuilderFactory = processBuilderFactory;
}
@Override
public boolean supported(Map<String, String> parameters) {
return true;
}
@Override
public DockerInfoDetails info() throws IOException, InterruptedException {
// Runs 'docker info'.
ExecutorService executor = Executors.newSingleThreadExecutor();
Future<DockerInfoDetails> readerFuture = executor.submit(this::fetchInfoDetails);
try {
DockerInfoDetails details = readerFuture.get(DOCKER_OUTPUT_TIMEOUT, TimeUnit.MILLISECONDS);
return details;
} catch (TimeoutException e) {
readerFuture.cancel(true); // Interrupt the reader thread
throw new IOException("Timeout reached while waiting for 'docker info' output");
} catch (ExecutionException e) {
throw new IOException("Failed to read output of 'docker info': " + e.getMessage());
} finally {
executor.shutdownNow();
}
}
@Override
public String load(ImageTarball imageTarball, Consumer<Long> writtenByteCountListener)
throws InterruptedException, IOException {
// Runs 'docker load'.
Process dockerProcess = docker("load");
try (NotifyingOutputStream stdin =
new NotifyingOutputStream(dockerProcess.getOutputStream(), writtenByteCountListener)) {
imageTarball.writeTo(stdin);
} catch (IOException ex) {View on GitHub (pinned to fb949e2676)
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
Example fix
// before
DockerInfoDetails details = dockerClient.info(); // hangs, then IOException
// after
if (!isDockerResponsive()) { // shell out to 'docker info' with your own generous timeout
throw new SkipBuildException("Docker daemon unresponsive");
}
DockerInfoDetails details = dockerClient.info(); Defensive patterns
Strategy: retry
Validate before calling
// Pre-check daemon responsiveness with a generous timeout
Process p = new ProcessBuilder("docker", "info", "--format", "ok").start();
boolean ok = p.waitFor(30, TimeUnit.SECONDS) && p.exitValue() == 0; Try / catch
try {
details = dockerClient.info();
} catch (IOException e) {
if (e.getMessage().contains("Timeout reached")) {
restartDockerDaemon(); // or retry after backoff
} else { throw e; }
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Understand the failure class
Background: Request timed out: what client-side request timeouts mean across libraries (Request timed out, TIMED_OUT, APITimeoutError) — this error's family across 39 libraries.
- Timeouts: ETIMEDOUT, deadlines, and hung requests — what actually expires when a request times out.
Related errors
- Failed to read output of 'docker info': <message>
- 'docker load' command failed with error: + error
- The input JAR (${jarPath}) is compiled with Java ${jarJavaVe
- Please set the app root of the container with `--app-root` w
- The class file (${jarEntry}) is of an invalid format.
AI-assisted analysis of GoogleContainerTools/jib@fb949e2676 (2026-09-06).
Data as JSON: /api/errors/bf424aa18db0d881.
Report an issue: GitHub.