Skip to content
Latchkey

sccache "Timed out waiting for server" / cannot connect in CI

The sccache client launched or looked for the server and it did not respond within the timeout. Either the server is slow to initialize its backend or it crashed on startup and left no listener.

What this error means

Builds fail with "sccache: error: Timed out waiting for server startup" or "error: couldn't connect to server", often intermittently under load.

sccache
sccache: error: Timed out waiting for server startup.
Maybe the remote storage is unreachable?

Common causes

The backend is slow or unreachable at startup

The server blocks while probing remote storage; a slow S3/GCS/Redis endpoint pushes startup past the client timeout.

The server crashed and left no listener

A failed backend init kills the server, so the client keeps trying to connect until it times out.

How to fix it

Start the server first and raise the timeout

  1. Start sccache before the build so initialization is not on the critical path.
  2. Raise SCCACHE_STARTUP_TIMEOUT if the backend is legitimately slow.
  3. Check the error log if the server exited instead of started.
Terminal
export SCCACHE_STARTUP_TIMEOUT=30
sccache --start-server
sccache --show-stats

Verify backend reachability

Confirm the storage endpoint and creds work; an unreachable backend is the most common cause of a startup timeout.

Terminal
export SCCACHE_LOG=debug
sccache --start-server 2>&1 | tail -n 20

How to prevent it

  • Start the sccache server before the build, not lazily on first compile.
  • Raise SCCACHE_STARTUP_TIMEOUT for slow remote backends.
  • Monitor backend reachability so timeouts are caught early.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →