{"record":{"id":"5fc55bd537f8836a","repo":"affaan-m/ECC","slug":"session-not-found-from-id","errorCode":null,"errorMessage":"Session not found: {from_id}","messagePattern":"Session not found: (.+?)","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"ecc2/src/main.rs","lineNumber":1521,"sourceCode":"                );\n            }\n        },\n        Some(Commands::Dashboard) | None => {\n            tui::app::run(db, cfg).await?;\n        }\n        Some(Commands::Start {\n            task,\n            agent,\n            profile,\n            worktree,\n            from_session,\n        }) => {\n            let use_worktree = worktree.resolve(&cfg);\n            let source = if let Some(from_session) = from_session.as_ref() {\n                let from_id = resolve_session_id(&db, from_session)?;\n                Some(\n                    db.get_session(&from_id)?\n                        .ok_or_else(|| anyhow::anyhow!(\"Session not found: {from_id}\"))?,\n                )\n            } else {\n                None\n            };\n            let grouping = session::SessionGrouping {\n                project: source.as_ref().map(|session| session.project.clone()),\n                task_group: source.as_ref().map(|session| session.task_group.clone()),\n            };\n            let session_id = if let Some(source) = source.as_ref() {\n                session::manager::create_session_from_source_with_profile_and_grouping(\n                    &db,\n                    &cfg,\n                    &task,\n                    agent.as_deref().unwrap_or(&cfg.default_agent),\n                    use_worktree,\n                    profile.as_deref(),\n                    &source.id,\n                    grouping,","sourceCodeStart":1503,"sourceCodeEnd":1539,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/ecc2/src/main.rs#L1503-L1539","documentation":"The `follow` command with an explicit source session resolves the given session reference to an ID via `resolve_session_id`, then loads it from the database with `db.get_session`. When the lookup returns no row, the code bails with this error. It means the referenced session does not exist (or was deleted) in the local database.","triggerScenarios":"Running `ecc2 follow <session-ref> ...` (with from_session set) where the resolved ID has no matching row in the sessions table.","commonSituations":"Referencing a session from a different project/database; the session was pruned or deleted; passing a stale short ID after the database was recreated; copying a session ID from another machine.","solutions":["List existing sessions (`ecc2 sessions` or equivalent) and copy the exact ID of the session you want to follow.","If you meant the most recent session, omit the explicit session reference so the default 'latest' resolution applies.","Check you are running ecc2 in the same project/data directory that contains the session.","If the session should exist, verify the database file was not deleted or relocated."],"exampleFix":"// before\nlet source = db.get_session(&from_id)?.ok_or_else(|| anyhow::anyhow!(\"Session not found: {from_id}\"))?;\n\n// after (guard earlier with a friendly hint)\nlet source = db.get_session(&from_id)?.ok_or_else(|| anyhow::anyhow!(\n    \"Session not found: {from_id} (run `ecc2 sessions` to list valid IDs)\"\n))?;","handlingStrategy":"validation","validationCode":"// shell: confirm the session exists before following\necc2 sessions --json | jq -e --arg id \"$FROM_ID\" 'map(.id) | index($id)' >/dev/null || { echo \"session $FROM_ID not found\"; exit 1; }","typeGuard":"fn session_exists(db: &Db, id: &str) -> anyhow::Result<bool> {\n    Ok(db.get_session(id)?.is_some())\n}","tryCatchPattern":"// match on the resolved row and give a listing hint\nmatch db.get_session(&from_id)? {\n    Some(s) => use_session(s),\n    None => eprintln!(\"session {from_id} not found; run `ecc2 sessions` to list IDs\"),\n}","preventionTips":["Always copy session IDs from the `sessions` list output, never from memory or other machines.","Omit the explicit source reference when you mean the latest session.","Pin your working directory before running session commands so the correct database is used.","Avoid deleting sessions that are still referenced by follow/fork workflows."],"tags":["sessions","database","rust","cli"],"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"}