{"record":{"id":"c02af3c252ad6637","repo":"BigPizzaV3/CodexPlusPlus","slug":"unknown-restore-table-table","errorCode":null,"errorMessage":"unknown restore table: {table}","messagePattern":"unknown restore table: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/codex-plus-data/src/storage.rs","lineNumber":1008,"sourceCode":"\nfn validate_restore_tables(tables: &Map<String, Value>) -> anyhow::Result<()> {\n    let allowed = [\n        \"sessions\",\n        \"messages\",\n        \"threads\",\n        \"thread_dynamic_tools\",\n        \"thread_goals\",\n        \"thread_spawn_edges\",\n        \"stage1_outputs\",\n        \"agent_job_items\",\n        \"automation_runs\",\n        \"inbox_items\",\n        \"__files\",\n        \"__session_index\",\n    ];\n    for table in tables.keys() {\n        if !allowed.contains(&table.as_str()) {\n            anyhow::bail!(\"unknown restore table: {table}\");\n        }\n    }\n    Ok(())\n}\n\nfn detect_restore_conflicts(db: &Connection, tables: &Map<String, Value>) -> anyhow::Result<()> {\n    for (table, rows) in tables {\n        if table.starts_with(\"__\") {\n            continue;\n        }\n        let Some(rows) = rows.as_array() else {\n            continue;\n        };\n        for row in rows {\n            let Some(row) = row.as_object() else {\n                continue;\n            };\n            if restore_row_conflicts(db, table, row)? {","sourceCodeStart":990,"sourceCodeEnd":1026,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/f2074595a281bc057525c748175c8eb9805b0673/crates/codex-plus-data/src/storage.rs#L990-L1026","documentation":"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.","triggerScenarios":"Thrown at crates/codex-plus-data/src/storage.rs:1008 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["使用与当前版本兼容的备份文件","确认备份文件未被手工编辑加入未知表","为新表补充 allowed 列表与对应的 insert_row 逻辑","从备份 JSON 中移除不需要恢复的未知表后重试"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f2074595a281bc057525c748175c8eb9805b0673","analyzedAt":"2026-08-23T12:52:24.489Z","contentChangedAt":"2026-08-23T12:52:24.489Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}