openai/codex · error · anyhow::Error
rollout migration state has incomplete last checked thread
Error message
rollout migration state has incomplete last checked thread
What it means
The rollout migration state row in the SQLite state DB has only one half of the last-checked-thread cursor: either last_checked_thread_created_at or last_checked_thread_id is NULL while the other is present. try_from_row expects these columns to be either both set (forming a RolloutMigrationCursor) or both NULL, so a partially-written or manually-edited row is rejected.
Solutions
- Restore both cursor columns to consistent values (both NULL or both set) in the state DB
- Delete the corrupt migration-state row so the migration restarts from the beginning
- Recreate the state database from rollouts if consistency cannot be repaired
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at codex-rs/state/src/model/rollout_migration_state.rs:38 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of openai/codex@339751715c (2026-08-25).
Data as JSON: /api/errors/ec37092ed260f715.
Report an issue: GitHub.
Appendix: source
Thrown at codex-rs/state/src/model/rollout_migration_state.rs:38
/// Persisted progress for one rollout migration.
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct RolloutMigrationState {
pub last_checked_thread: Option<RolloutMigrationCursor>,
}
impl RolloutMigrationState {
pub(crate) fn try_from_row(row: &SqliteRow) -> Result<Self> {
let thread_created_at = row.try_get("last_checked_thread_created_at")?;
let thread_id = row.try_get("last_checked_thread_id")?;
let last_checked_thread = match (thread_created_at, thread_id) {
(Some(thread_created_at), Some(thread_id)) => Some(RolloutMigrationCursor {
thread_created_at,
thread_id,
}),
(None, None) => None,
_ => {
return Err(anyhow::anyhow!(
"rollout migration state has incomplete last checked thread"
));
}
};
Ok(Self {
last_checked_thread,
})
}
}
/// An unchanged rollout that one migration can safely skip.
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct RolloutMigrationSkippedRollout {
pub rollout_path: String,
pub rollout_size_bytes: i64,
pub rollout_modified_at_ns: i64,
pub skip_reason: String,
}View on GitHub (pinned to 339751715c)