{"record":{"id":"65291e3ab1a5d229","repo":"xai-org/grok-build","slug":"no-lsp-servers-are-running","errorCode":null,"errorMessage":"No LSP servers are running.","messagePattern":"No LSP servers are running\\.","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/codegen/xai-grok-tools/src/implementations/lsp/manager.rs","lineNumber":579,"sourceCode":"            LspOperation::DocumentSymbol => {\n                let Some(ref file_path) = input.file_path else {\n                    return err(\"Required: file_path (string).\".into());\n                };\n                let path = PathBuf::from(file_path);\n                let Some(client) = self.client_for_file_mut(&path) else {\n                    return err(format!(\"No LSP server configured for {}\", path.display()));\n                };\n                client\n                    .document_symbols(&path)\n                    .await\n                    .map(|s| format_symbols(&s))\n            }\n            LspOperation::WorkspaceSymbol => {\n                let Some(ref query) = input.query else {\n                    return err(\"Required: query (string).\".into());\n                };\n                if self.clients.is_empty() {\n                    return err(\"No LSP servers are running.\".into());\n                }\n                let mut all_symbols = Vec::new();\n                let mut last_err = None;\n                for client in self.clients.values_mut() {\n                    match client.workspace_symbols(query).await {\n                        Ok(symbols) => all_symbols.extend(symbols),\n                        Err(e) => {\n                            last_err = Some(e);\n                        }\n                    }\n                }\n                if all_symbols.is_empty() {\n                    match last_err {\n                        Some(e) => Err(e),\n                        None => Ok(format_symbols(&[])),\n                    }\n                } else {\n                    Ok(format_symbols(&all_symbols))","sourceCodeStart":561,"sourceCodeEnd":597,"githubUrl":"https://github.com/xai-org/grok-build/blob/bc7f02eddd3d84085849dc19ed216f11c23b0571/crates/codegen/xai-grok-tools/src/implementations/lsp/manager.rs#L561-L597","documentation":"workspace_symbol needs at least one live LSP client to query. The manager checks self.clients.is_empty() before iterating and returns this message when no language servers are running at all. Unlike error 761 (wrong file type), this means the manager has zero servers, usually because none were started or all failed/exited.","triggerScenarios":"Calling workspace_symbol before any LSP server has been spawned; all clients exited after crashes; the manager was constructed with an empty client set (no languages configured).","commonSituations":"Calling the tool before opening/initializing any files (lazy server start means no clients yet); language servers failed to install or launch; workspace initialized without server configuration.","solutions":["Open or touch a file of a supported language first so the manager starts an LSP client, then retry workspace_symbol.","Check language-server installation/startup logs; fix spawn failures (missing binary, bad command path).","Ensure the manager is configured with at least one language server before accepting workspace queries.","Add a readiness check (clients non-empty) in caller code before issuing workspace-wide requests."],"exampleFix":"// before — no servers started\nawait manager.dispatch({ operation: \"workspace_symbol\", query: \"main\" })\n// after — start a server first\nawait manager.start_client(\"src/main.rs\");\nawait manager.dispatch({ operation: \"workspace_symbol\", query: \"main\" })","handlingStrategy":"try-catch","validationCode":"async function ensureClientsReady(manager, sampleFile) {\n  if (!(await manager.clientCount() > 0)) {\n    await manager.start_client(sampleFile); // spin up at least one server\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  symbols = await lspTool({ operation: 'workspace_symbol', query: q });\n} catch (e) {\n  if (String(e).includes('No LSP servers are running')) {\n    await startDefaultLanguageServers();\n    symbols = await lspTool({ operation: 'workspace_symbol', query: q });\n  } else { throw e; }\n}","preventionTips":["Initialize at least one LSP server during startup or on first file open.","Monitor language server processes; restart crashed clients automatically.","Gate workspace-wide operations behind a clients-non-empty readiness check."],"tags":["lsp","configuration","no-servers-running"],"backgroundTag":"lsp-server-not-running","analyzedSha":"bc7f02eddd3d84085849dc19ed216f11c23b0571","analyzedAt":"2026-08-31T04:59:42.031Z","schemaVersion":2},"datasetVersion":"2026-08-31T09:17:48.483Z"}