{"record":{"id":"a322814f8b72c8a0","repo":"Kuberwastaken/claurst","slug":"lsp-server-not-running","errorCode":null,"errorMessage":"LSP server '{}' not running","messagePattern":"LSP server '(.+?)' not running","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src-rust/crates/core/src/lsp.rs","lineNumber":1117,"sourceCode":"    pub async fn hover(\r\n        &mut self,\r\n        file_path: &str,\r\n        root_dir: &Path,\r\n        line: u32,\r\n        character: u32,\r\n    ) -> anyhow::Result<Option<String>> {\r\n        let uri = path_to_uri(file_path);\r\n        let server_name = self\r\n            .server_name_for_file(file_path)\r\n            .ok_or_else(|| {\r\n                anyhow::anyhow!(\"No LSP server configured for '{}'\", file_path)\r\n            })?\r\n            .to_string();\r\n        self.ensure_started(file_path, root_dir).await?;\r\n        let client = self\r\n            .clients\r\n            .get(&server_name)\r\n            .ok_or_else(|| anyhow::anyhow!(\"LSP server '{}' not running\", server_name))?;\r\n        client.hover(&uri, line, character).await\r\n    }\r\n\r\n    /// Get definition locations for `file_path` at the given 1-based position.\r\n    pub async fn definition(\r\n        &mut self,\r\n        file_path: &str,\r\n        root_dir: &Path,\r\n        line: u32,\r\n        character: u32,\r\n    ) -> anyhow::Result<Vec<String>> {\r\n        let uri = path_to_uri(file_path);\r\n        let server_name = self\r\n            .server_name_for_file(file_path)\r\n            .ok_or_else(|| {\r\n                anyhow::anyhow!(\"No LSP server configured for '{}'\", file_path)\r\n            })?\r\n            .to_string();\r","sourceCodeStart":1099,"sourceCodeEnd":1135,"githubUrl":"https://github.com/Kuberwastaken/claurst/blob/b0637c97ec34144387cbf2f74f65df6d16a6cef1/src-rust/crates/core/src/lsp.rs#L1099-L1135","documentation":"Thrown in `LspManager::hover` when the resolved server name has no entry in `self.clients` even after `ensure_started`. ensure_started silently continues when a server fails to spawn or fail to initialize (it only logs a warning), so the subsequent clients.get() finds nothing. It indicates the language server process is not running.","triggerScenarios":"hover() where ensure_started failed to spawn the server binary (command not found) or the initialize handshake failed, leaving clients without the named entry.","commonSituations":"Server binary not installed or not on PATH; server crashed during startup; initialize failed due to bad rootUri or initializationOptions; startup raced with the request in an async context.","solutions":["Verify the server binary is installed and on PATH (e.g. `which rust-analyzer`).","Inspect logs for the preceding \"Failed to start/initialize LSP server\" warnings to find the root cause.","Call ensure_started / reopen the manager and retry; add explicit startup error propagation instead of warn-and-continue.","Validate root_dir exists and initializationOptions are accepted by the server."],"exampleFix":"// before: assume startup succeeded\nmanager.ensure_started(path, root).await?;\nlet hover = manager.hover(path, root, line, col).await?;\n// after: surface startup failures before feature calls\nmanager.ensure_started(path, root).await.map_err(|e| {\n    anyhow::anyhow!(\"LSP startup failed for {}: {e}\", path)\n})?;\nlet hover = manager.hover(path, root, line, col).await?;","handlingStrategy":"retry","validationCode":"// ensure the server binary is invocable before feature calls\nlet ok = std::process::Command::new(&config.command).arg(\"--version\").output().is_ok();\nif !ok { bail!(\"LSP server '{}' unavailable\", config.name); }","typeGuard":"fn server_running(manager: &LspManager, name: &str) -> bool {\n    manager.clients.contains_key(name)\n}","tryCatchPattern":"let hover = match manager.hover(path, root, line, col).await {\n    Ok(h) => h,\n    Err(e) if e.to_string().contains(\"not running\") => {\n        manager.ensure_started(path, root).await?;\n        manager.hover(path, root, line, col).await.unwrap_or(None)\n    }\n    Err(e) => return Err(e),\n};","preventionTips":["Install and PATH-verify all configured language servers during setup.","Make ensure_started failures loud (propagate instead of warn-and-continue).","Retry-once with a fresh ensure_started when 'not running' is reported."],"tags":["lsp","process-startup","rust"],"backgroundTag":"entity-not-found","analyzedSha":"b0637c97ec34144387cbf2f74f65df6d16a6cef1","analyzedAt":"2026-09-10T00:24:58.650Z","contentChangedAt":"2026-09-10T00:24:58.650Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}