zeroclaw-labs/zeroclaw · error

Refusing to import receipt-less JSONL session {name} over ex

Error message

Refusing to import receipt-less JSONL session {name} over existing SQLite session state for {key}

What it means

Error "Refusing to import receipt-less JSONL session {name} over existing SQLite session state for {key}" thrown in zeroclaw-labs/zeroclaw.

Source

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

                    }
                    tx.commit().with_context(|| {
                        format!("Failed to finish JSONL receipt check for {name}")
                    })?;
                    return Ok(());
                }

                let existing_state: bool = tx
                    .query_row(
                        "SELECT EXISTS(SELECT 1 FROM sessions WHERE session_key = ?1) \
                         OR EXISTS(SELECT 1 FROM session_metadata WHERE session_key = ?1)",
                        params![key],
                        |row| row.get(0),
                    )
                    .with_context(|| {
                        format!("Failed to inspect existing SQLite session state for {key}")
                    })?;
                if existing_state {
                    bail!(
                        "Refusing to import receipt-less JSONL session {name} over existing SQLite session state for {key}"
                    );
                }

                let file = std::fs::File::open(&staged_path)
                    .with_context(|| format!("Failed to open staged JSONL session {name}"))?;
                let now = Utc::now().to_rfc3339();
                let mut inserted = 0_i64;
                let mut has_non_whitespace_source = false;
                {
                    let mut insert = tx
                        .prepare(
                            "INSERT INTO sessions (session_key, role, content, created_at) \
                             VALUES (?1, ?2, ?3, ?4)",
                        )
                        .with_context(|| format!("Failed to prepare JSONL import for {name}"))?;
                    for line in io::BufReader::new(file).split(b'\n') {
                        let line = line.with_context(|| {

View on GitHub (pinned to 88bb9c8533)

Solutions

  1. Provide the import receipt for the JSONL session, or remove the existing SQLite session state before importing.

When it happens

Trigger: Thrown at crates/zeroclaw-infra/src/session_sqlite.rs:623 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/995217381d6e13ba. Report an issue: GitHub.