{"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":"exception","errorClass":null,"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/01e15490f04e29cfefe3896951f43db46994d8ee/ecc2/src/main.rs#L1503-L1539","documentation":"Runtime error from the Start command handler in ecc2/src/main.rs. When --from-session is supplied, the handler resolves the session id (resolve_session_id) and then calls db.get_session(&from_id); if that returns None it bails with \"Session not found: {from_id}\". The session is used as the source for a new session, so its absence is fatal to the operation.","triggerScenarios":"Invoking `start --from-session <id-or-prefix>` where the resolved id does not exist in the session database (db.get_session returns None). A prefix that resolves but then misses also triggers this.","commonSituations":"Typo or truncation in the session id; the session was deleted; running against the wrong project/workspace database; the id was copied from a different environment; stale entry in a script.","solutions":["List sessions for the current database and copy the exact id.","Confirm you are operating in the same project/workspace where the session was created.","If using a prefix, ensure it is unambiguous and resolves to an existing session.","Recreate the source session if it was deleted but is still needed."],"exampleFix":"# before\n$ ecc start --from-session abc123\nError: Session not found: abc123\n\n# after\n$ ecc sessions list\nSESSION_ID   TASK\nabc12345...  fix auth\n$ ecc start --from-session abc12345","handlingStrategy":"validation","validationCode":"// Confirm the session exists before starting from it.\nif db.get_session(&from_id)?.is_none() {\n    eprintln!(\"session {from_id} not found; known sessions:\");\n    for s in session::manager::list_sessions(&db)? { eprintln!(\"  {}\", s.id); }\n    return Ok(());\n}","typeGuard":"fn session_exists(db: &Db, id: &str) -> bool {\n    db.get_session(id).map(|o| o.is_some()).unwrap_or(false)\n}","tryCatchPattern":"let source = match db.get_session(&from_id)? {\n    Some(s) => s,\n    None => {\n        eprintln!(\"tip: run `ecc sessions list` to see valid ids\");\n        anyhow::bail!(\"Session not found: {from_id}\");\n    }\n};","preventionTips":["Always list sessions before copying an id by hand.","Prefer full ids over truncated prefixes.","Confirm you are in the correct project/workspace database.","Wrap scripted invocations in a check that the session exists."],"tags":["rust","session","cli","database"],"backgroundTag":null,"analyzedSha":"01e15490f04e29cfefe3896951f43db46994d8ee","analyzedAt":"2026-08-13T00:31:08.655Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}