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

  1. Verify the Docker daemon is healthy: run 'docker info' manually and confirm it returns promptly
  2. Restart Docker Desktop / the docker daemon and retry
  3. Check host load and disk I/O; free resources if the machine is overloaded
  4. 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

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.

Related errors


AI-assisted analysis of GoogleContainerTools/jib@fb949e2676 (2026-09-06). Data as JSON: /api/errors/bf424aa18db0d881. Report an issue: GitHub.