BigPizzaV3/CodexPlusPlus · error · anyhow::Error

unknown restore table: {table}

Error message

unknown restore table: {table}

What it means

Thrown by validate_restore_tables when the backup payload contains a table not in the restore allow-list (sessions, messages, threads, thread_* tables, stage1_outputs, agent_job_items, automation_runs, inbox_items, and __-prefixed internal tables). The offending input is the table name {table} in the untrusted backup JSON; restores are table-whitelisted to block arbitrary SQL targets.

Source

Thrown at crates/codex-plus-data/src/storage.rs:1008

fn validate_restore_tables(tables: &Map<String, Value>) -> anyhow::Result<()> {
    let allowed = [
        "sessions",
        "messages",
        "threads",
        "thread_dynamic_tools",
        "thread_goals",
        "thread_spawn_edges",
        "stage1_outputs",
        "agent_job_items",
        "automation_runs",
        "inbox_items",
        "__files",
        "__session_index",
    ];
    for table in tables.keys() {
        if !allowed.contains(&table.as_str()) {
            anyhow::bail!("unknown restore table: {table}");
        }
    }
    Ok(())
}

fn detect_restore_conflicts(db: &Connection, tables: &Map<String, Value>) -> anyhow::Result<()> {
    for (table, rows) in tables {
        if table.starts_with("__") {
            continue;
        }
        let Some(rows) = rows.as_array() else {
            continue;
        };
        for row in rows {
            let Some(row) = row.as_object() else {
                continue;
            };
            if restore_row_conflicts(db, table, row)? {

View on GitHub (pinned to f2074595a2)

Solutions

  1. 使用与当前版本兼容的备份文件
  2. 确认备份文件未被手工编辑加入未知表
  3. 为新表补充 allowed 列表与对应的 insert_row 逻辑
  4. 从备份 JSON 中移除不需要恢复的未知表后重试
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/codex-plus-data/src/storage.rs:1008 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of BigPizzaV3/CodexPlusPlus@f2074595a2 (2026-08-23). Data as JSON: /api/errors/c02af3c252ad6637. Report an issue: GitHub.