{"record":{"id":"29a7cfd8f41fbe6d","repo":"BoundaryML/baml","slug":"playground-server-error-e","errorCode":null,"errorMessage":"Playground server error: {e}","messagePattern":"Playground server error: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"baml_language/crates/baml_lsp_server/src/playground_server.rs","lineNumber":812,"sourceCode":"        seam,\n        broadcast_tx,\n        env_state,\n        io_state,\n        run_store,\n        playground_dir_override,\n        lsp_out_tx,\n        lsp_runtime,\n        doc_mirror,\n        workspace_roots.into(),\n        access_guard,\n        current_open_target,\n    )?;\n\n    tracing::info!(\"Playground: http://localhost:{}\", local_addr.port());\n\n    axum::serve(listener, app)\n        .await\n        .map_err(|e| anyhow::anyhow!(\"Playground server error: {e}\"))\n}\n\n#[allow(clippy::too_many_arguments)]\nfn build_router(\n    seam: Arc<PlaygroundSeam>,\n    broadcast_tx: broadcast::Sender<WsOutMessage>,\n    env_state: Arc<PlaygroundEnvState>,\n    io_state: Arc<PlaygroundIoState>,\n    run_store: Arc<InMemoryRunStore>,\n    playground_dir_override: Option<PathBuf>,\n    lsp_out_tx: broadcast::Sender<crate::OutboundFrame>,\n    lsp_runtime: Arc<crate::lsp_runtime::LspRuntime>,\n    doc_mirror: DocMirror,\n    workspace_roots: Arc<[PathBuf]>,\n    access_guard: PlaygroundAccessGuard,\n    current_open_target: crate::playground_sender::SharedOpenTarget,\n) -> anyhow::Result<Router> {\n    let value_store = Arc::new(Mutex::new(LiveValueCache::with_max_bytes(","sourceCodeStart":794,"sourceCodeEnd":830,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/baml_language/crates/baml_lsp_server/src/playground_server.rs#L794-L830","documentation":"The run function starts the axum HTTP/WebSocket server for the playground; if axum::serve itself returns an error while accepting/serving connections, it is wrapped in this anyhow error. This is a runtime server failure after successful binding, not a configuration problem.","triggerScenarios":"axum::serve(listener, app).await returning Err — typically the accept loop failing, e.g. the listener socket being closed under the server, EMFILE (too many open files), or an OS-level socket error mid-serve.","commonSituations":"File-descriptor exhaustion under many WebSocket connections; system suspend/resume breaking the socket; the process hitting ulimit -n; abnormal termination of the network stack in containers.","solutions":["Check server logs for the underlying axum/io error to identify the socket failure.","Raise the file-descriptor limit (ulimit -n) if EMFILE occurred.","Restart the playground/LSP server to recreate the listener.","Update axum/tokio if the failure traces to a known framework bug."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"match run(...).await {\n    Err(e) if e.to_string().starts_with(\"Playground server error\") => {\n        tracing::error!(\"playground crashed: {e:#}; restarting\");\n        restart_server();\n    }\n    Err(e) => return Err(e),\n    Ok(()) => {}\n}","preventionTips":["Raise the file-descriptor ulimit for long-running LSP processes","Monitor accept-loop failures and restart the server automatically","Keep axum/tokio versions current"],"tags":["rust","axum","http-server","network"],"backgroundTag":"http-request-failed","analyzedSha":"bd85ce9dee1463ff04d27efd20531013a4ff46c1","analyzedAt":"2026-09-12T03:38:25.718Z","contentChangedAt":"2026-09-12T03:38:25.718Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}