BigPizzaV3/CodexPlusPlus · critical

; rollout rollback failed

Error message

{error}; rollout rollback failed: {restore_error}

What it means

During a bulk session (rollout file) rewrite in provider_sync.rs, if applying a change fails, the code attempts to roll back all previously applied writes via restore_bulk_session_rewrites. When that rollback itself fails, this error is raised chaining the original apply error and the rollback error so neither is lost; the files may now be in a partially restored state.

Solutions

  1. Read both chained causes: `{error}` is why apply failed, `{restore_error}` is why rollback failed — fix the rollback cause (permissions, locks, changed files) first
  2. Close any process (Codex client) holding the rollout files, then re-run sync to rebuild consistent state
  3. Restore from the nearest backup taken before the sync; the bulk rewrite keeps pre-images precisely so restores are possible
  4. Re-run the sync with the conflicting sessions skipped to isolate the failing rollout file
Defensive patterns

Strategy: try-catch

Validate before calling

// Before bulk rewrite: ensure target files are writable and not locked
for p in &paths { assert!(p.exists()); assert!(!is_locked(p)); }

Try / catch

match result {
    Err(e) => {
        eprintln!("apply failed: {e:#}; check chained rollback cause for the real blocker");
        // restore from external backup before retrying
    }
    Ok(_) => {}
}

Prevention

When it happens

Trigger: A bulk session rewrite applies N changes, one write fails, and restore_bulk_session_rewrites also fails while undoing earlier changes — e.g. because a rollout file was modified after being rewritten, or a later restore step in the loop errors.

Common situations: Rollout files being locked or edited by the Codex client during sync; disk-full or permission errors surfacing mid-rollback; crashes/concurrency corrupting the rewritten_sha256 baseline.

Understand the failure class

Background: "failed to write file", "Could not save figure", "Error saving remote file" — file write failed: causes and fixes across languages and libraries — this error's family across 38 libraries.

Related errors


AI-assisted analysis of BigPizzaV3/CodexPlusPlus@b1ed92e5e4 (2026-09-19). Data as JSON: /api/errors/1e31b6282e8ce7a1. Report an issue: GitHub.

Appendix: source

Thrown at crates/codex-plus-data/src/provider_sync.rs:3540

            Ok(None) => applied.skipped_locked_rollout_files.push(plan.path.clone()),
            Err(error) if is_locked_anyhow_error(&error) => {
                applied.skipped_locked_rollout_files.push(plan.path.clone());
            }
            Err(error) => {
                if !applied.changes.is_empty() {
                    report_provider_sync_progress(
                        report_progress,
                        ProviderSyncProgressPhase::RollingBack,
                        total_rollout_files,
                        total_rollout_files,
                        rewrite_plans.len(),
                        applied.changes.len(),
                        scanned_skipped_rollout_files
                            + applied.skipped_locked_rollout_files.len(),
                    );
                }
                if let Err(restore_error) = restore_bulk_session_rewrites(&applied.changes) {
                    return Err(anyhow::anyhow!(
                        "{error}; rollout rollback failed: {restore_error}"
                    ));
                }
                return Err(error);
            }
        }
        report_bulk_rewrite_progress(
            report_progress,
            total_rollout_files,
            rewrite_plans.len(),
            index + 1,
            applied.changes.len(),
            scanned_skipped_rollout_files + applied.skipped_locked_rollout_files.len(),
        );
    }
    Ok(applied)
}

View on GitHub (pinned to b1ed92e5e4)