{"record":{"id":"c069dc7c18916cb8","repo":"zed-industries/zed","slug":"could-not-find-session","errorCode":null,"errorMessage":"Could not find session: {:?}","messagePattern":"Could not find session: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/project/src/debugger/dap_store.rs","lineNumber":743,"sourceCode":"\n    pub fn shutdown_sessions(&mut self, cx: &mut Context<Self>) -> Task<()> {\n        let mut tasks = vec![];\n        for session_id in self.sessions.keys().cloned().collect::<Vec<_>>() {\n            tasks.push(self.shutdown_session(session_id, cx));\n        }\n\n        cx.background_executor().spawn(async move {\n            futures::future::join_all(tasks).await;\n        })\n    }\n\n    pub fn shutdown_session(\n        &mut self,\n        session_id: SessionId,\n        cx: &mut Context<Self>,\n    ) -> Task<Result<()>> {\n        let Some(session) = self.sessions.remove(&session_id) else {\n            return Task::ready(Err(anyhow!(\"Could not find session: {:?}\", session_id)));\n        };\n\n        let shutdown_children = session\n            .read(cx)\n            .child_session_ids()\n            .iter()\n            .map(|session_id| self.shutdown_session(*session_id, cx))\n            .collect::<Vec<_>>();\n\n        let shutdown_parent_task = if let Some(parent_session) = session\n            .read(cx)\n            .parent_id(cx)\n            .and_then(|session_id| self.session_by_id(session_id))\n        {\n            let shutdown_id = parent_session.update(cx, |parent_session, _| {\n                parent_session.remove_child_session_id(session_id);\n\n                if parent_session.child_session_ids().is_empty() {","sourceCodeStart":725,"sourceCodeEnd":761,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/project/src/debugger/dap_store.rs#L725-L761","documentation":"shutdown_session was asked to stop a session id that is not present in the sessions map — it was already shut down, never existed, or was removed by a concurrent shutdown. The guard prevents double-shutdown work; callers treating it as fatal usually raced with another shutdown path.","triggerScenarios":"Thrown at crates/project/src/debugger/dap_store.rs:743 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Treat as benign if concurrent shutdowns are possible (e.g. app close plus explicit stop)","Check for stale session ids held by UI state after a session ended"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}