zeroclaw-labs/zeroclaw · error

Refusing to replace existing migrated JSONL session {}

Error message

Refusing to replace existing migrated JSONL session {}

What it means

Error "Refusing to replace existing migrated JSONL session {}" thrown in zeroclaw-labs/zeroclaw.

Source

Thrown at crates/zeroclaw-infra/src/session_sqlite.rs:529

            let candidate_may_have_committed_receipt = staged && has_committed_import;
            if staged {
                if live_path.exists() {
                    bail!(
                        "Refusing ambiguous JSONL migration with both {} and {}",
                        live_path.display(),
                        staged_path.display()
                    );
                }
            } else {
                if staged_path.exists() {
                    bail!(
                        "Refusing ambiguous JSONL migration with both {} and {}",
                        live_path.display(),
                        staged_path.display()
                    );
                }
                if migrated_path.exists() {
                    bail!(
                        "Refusing to replace existing migrated JSONL session {}",
                        migrated_path.display()
                    );
                }
                std::fs::rename(&live_path, &staged_path)
                    .with_context(|| format!("Failed to stage JSONL session {name} for import"))?;
            }

            let prepared_source = (|| -> Result<(String, i64)> {
                Self::sync_staged_jsonl(&staged_path, &name)?;
                Self::sync_parent_directory(&staged_path)?;
                fingerprint(&staged_path, &name)
            })();
            let (source_hash, source_len) = match prepared_source {
                Ok(fingerprint) => fingerprint,
                Err(import_error) => {
                    if candidate_may_have_committed_receipt {
                        return Err(self.reconcile_failed_import(

View on GitHub (pinned to 88bb9c8533)

Solutions

  1. Delete or archive the existing migrated JSONL session before re-importing.

When it happens

Trigger: Thrown at crates/zeroclaw-infra/src/session_sqlite.rs:529 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of zeroclaw-labs/zeroclaw@88bb9c8533 (2026-08-23). Data as JSON: /api/errors/4051047ffe9afbe0. Report an issue: GitHub.