openai/codex · error · anyhow::Error

timed out waiting for state db backfill at

Error message

timed out waiting for state db backfill at {} after {:?} (status: {})

What it means

Raised in wait_for_backfill_gate when the state DB backfill has not reached Complete status within the allotted wait window; the current status is included. Fires when rollout backfill is stalled or slower than the gate timeout allows.

Solutions

  1. Increase the backfill wait timeout
  2. Let the backfill finish by keeping a Codex process running, then retry
  3. Investigate which rollout file is stalling the backfill worker
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at codex-rs/rollout/src/state_db.rs:170 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


AI-assisted analysis of openai/codex@339751715c (2026-08-25). Data as JSON: /api/errors/98b145502f027993. Report an issue: GitHub.

Appendix: source

Thrown at codex-rs/rollout/src/state_db.rs:170

                codex_home,
                default_model_provider_id,
                backfill_lease_seconds,
            )
            .await;
        } else {
            metadata::backfill_sessions(runtime, codex_home, default_model_provider_id).await;
        }
        let backfill_state = runtime.get_backfill_state().await.map_err(|err| {
            anyhow::anyhow!(
                "failed to read backfill state at {} after startup backfill: {err}",
                codex_home.display()
            )
        })?;
        if backfill_state.status == codex_state::BackfillStatus::Complete {
            return Ok(());
        }
        if wait_started.elapsed() >= STARTUP_BACKFILL_WAIT_TIMEOUT {
            return Err(anyhow::anyhow!(
                "timed out waiting for state db backfill at {} after {:?} (status: {})",
                codex_home.display(),
                STARTUP_BACKFILL_WAIT_TIMEOUT,
                backfill_state.status.as_str()
            ));
        }

        let message = format!(
            "state db backfill is {} at {}; waiting up to {:?} before retrying startup initialization",
            backfill_state.status.as_str(),
            codex_home.display(),
            STARTUP_BACKFILL_WAIT_TIMEOUT,
        );
        if reported_wait {
            info!("{message}");
        } else {
            emit_startup_warning(&message);
            reported_wait = true;

View on GitHub (pinned to 339751715c)