Skip to content
Latchkey

Statsig "initialize timed out" in CI

The Statsig SDK started initialization and could not finish downloading its configuration specs before the init timeout elapsed. The network to the Statsig endpoint is slow or blocked, so gates and dynamic configs return their defaults. In CI a short timeout makes this intermittent.

What this error means

Statsig logs an initialize timeout or "Failed to fetch initialize response", and checkGate / getConfig return default values because specs never loaded.

Statsig
[Statsig] Initialize timed out after 3000ms. Falling back to default values
until config specs are available.

Common causes

Egress to the Statsig endpoint is slow or blocked

The runner cannot reach the Statsig config endpoint quickly, so the specs download does not complete in the timeout.

The init timeout is too short for cold CI runners

A short initTimeoutMs that suits a warm machine expires before the first download finishes on CI.

How to fix it

Raise the init timeout and check the result

Give initialization more time and inspect the outcome so the run does not silently proceed on defaults.

statsig.js
await Statsig.initialize(secretKey, { initTimeoutMs: 10000 });

Bootstrap from a data adapter for offline tests

Provide config specs from a local source so evaluation is deterministic and needs no live download.

statsig.test.js
await Statsig.initialize(secretKey, {
  dataAdapter: new FileBasedDataAdapter('statsig-specs.json'),
});

How to prevent it

  • Allow egress to the Statsig config endpoint on CI networks.
  • Size initTimeoutMs for cold runners, not local machines.
  • Bootstrap specs from a data adapter in tests to remove the network dependency.

Frequently asked questions

What causes "Statsig "initialize timed out""?
The runner cannot reach the Statsig config endpoint quickly, so the specs download does not complete in the timeout.
How do I fix Statsig "initialize timed out"?
Give initialization more time and inspect the outcome so the run does not silently proceed on defaults.

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card