{"record":{"id":"794addda0d61cc0e","repo":"affaan-m/ECC","slug":"session-not-found-value","errorCode":null,"errorMessage":"Session not found: {value}","messagePattern":"Session not found: (.+?)","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"ecc2/src/main.rs","lineNumber":2918,"sourceCode":"        }) => {\n            session::manager::run_session(&cfg, &session_id, &task, &agent, &cwd).await?;\n        }\n    }\n\n    Ok(())\n}\n\nfn resolve_session_id(db: &session::store::StateStore, value: &str) -> Result<String> {\n    if value == \"latest\" {\n        return db\n            .get_latest_session()?\n            .map(|session| session.id)\n            .ok_or_else(|| anyhow::anyhow!(\"No sessions found\"));\n    }\n\n    db.get_session(value)?\n        .map(|session| session.id)\n        .ok_or_else(|| anyhow::anyhow!(\"Session not found: {value}\"))\n}\n\nfn sync_runtime_session_metrics(\n    db: &session::store::StateStore,\n    cfg: &config::Config,\n) -> Result<()> {\n    db.refresh_session_durations()?;\n    db.sync_cost_tracker_metrics(&cfg.cost_metrics_path())?;\n    db.sync_tool_activity_metrics(&cfg.tool_activity_metrics_path())?;\n    let _ = session::manager::enforce_session_heartbeats(db, cfg)?;\n    let _ = session::manager::enforce_budget_hard_limits(db, cfg)?;\n    Ok(())\n}\n\nfn sync_memory_connector(\n    db: &session::store::StateStore,\n    cfg: &config::Config,\n    name: &str,","sourceCodeStart":2900,"sourceCodeEnd":2936,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/ecc2/src/main.rs#L2900-L2936","documentation":"Also from `resolve_session_id`: when the provided value is not `\"latest\"`, the helper looks it up via `db.get_session(value)` and returns this error if no session with that ID exists. The `value` is interpolated into the message so you can see which identifier failed. Only exact, existing session IDs resolve successfully.","triggerScenarios":"Passing `--session <value>` with a mistyped, truncated, or already-deleted session ID; passing a session title/path instead of the ID; referencing a session from a different database/profile.","commonSituations":"Hand-copied IDs with missing characters; old IDs after a database reset; environment variable pointing at a stale session; confusing short session names with the canonical UUID-style ID.","solutions":["Run `ecc sessions list` and copy the exact session ID.","Check for typos/truncation in the ID (shell line-wrap copy errors are common).","Confirm you're using the right data directory/profile — IDs don't cross stores.","If the session was deleted, use `latest` or an existing session instead."],"exampleFix":"// before\n$ ecc graph show --session abc-12   # truncated\nerror: Session not found: abc-12\n// after\n$ ecc sessions list\n$ ecc graph show --session abc-1234-5678-...","handlingStrategy":"validation","validationCode":"# Resolve from the live list, never from memory\nSESSION_ID=$(ecc sessions list --json | jq -r '.[] | select(.id == \"'$WANT_ID'\") | .id // empty')\n[ -n \"$SESSION_ID\" ] || { echo \"session $WANT_ID not in this store\" >&2; exit 1; }","typeGuard":null,"tryCatchPattern":"match resolve_session_id(&db, value) {\n    Err(e) if e.to_string().starts_with(\"Session not found\") => {\n        eprintln!(\"'{value}' is not a session in this store; run 'ecc sessions list'\");\n    }\n    Err(e) => return Err(e),\n    Ok(id) => use_session(id),\n}","preventionTips":["Copy session IDs from `ecc sessions list` output, never retyped.","Watch for shell line-wrap truncation when copying long IDs.","Confirm the data directory/profile matches where the session was created."],"tags":["cli","database","not-found","sessions"],"backgroundTag":"record-not-found","analyzedSha":"8321021c54d670126ce3b2969d5deb880b4b0c2a","analyzedAt":"2026-09-16T10:08:13.343Z","contentChangedAt":"2026-09-16T10:08:13.343Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}