{"record":{"id":"5456ca5b7ed42353","repo":"zed-industries/zed","slug":"working-dir-is-not-a-valid-uri","errorCode":null,"errorMessage":"{working_dir:?} is not a valid URI","messagePattern":"(.+?) is not a valid URI","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/lsp/src/lsp.rs","lineNumber":530,"sourceCode":"    /// Starts a language server process.\n    /// A request_timeout of zero or Duration::MAX indicates an indefinite timeout.\n    pub fn new(\n        stderr_capture: Arc<Mutex<Option<String>>>,\n        server_id: LanguageServerId,\n        server_name: LanguageServerName,\n        binary: LanguageServerBinary,\n        root_path: &Path,\n        code_action_kinds: Option<Vec<CodeActionKind>>,\n        workspace_folders: Option<Arc<Mutex<BTreeSet<Uri>>>>,\n        cx: &mut AsyncApp,\n    ) -> Result<Self> {\n        let working_dir = if root_path.is_dir() {\n            root_path\n        } else {\n            root_path.parent().unwrap_or_else(|| Path::new(\"/\"))\n        };\n        let root_uri = Uri::from_file_path(&working_dir)\n            .map_err(|()| anyhow!(\"{working_dir:?} is not a valid URI\"))?;\n        log::info!(\n            \"starting language server process. binary path: \\\n            {:?}, working directory: {:?}, args: {:?}\",\n            binary.path,\n            working_dir,\n            binary.arguments\n        );\n        let mut command = util::command::new_command(&binary.path);\n        command\n            .current_dir(working_dir)\n            .args(&binary.arguments)\n            .envs(binary.env.clone().unwrap_or_default())\n            .stdin(Stdio::piped())\n            .stdout(Stdio::piped())\n            .stderr(Stdio::piped())\n            .kill_on_drop(true);\n\n        let mut server = command","sourceCodeStart":512,"sourceCodeEnd":548,"githubUrl":"https://github.com/zed-industries/zed/blob/9d272b036335401f339d024ea94968fd51016c40/crates/lsp/src/lsp.rs#L512-L548","documentation":"Setup guard in lsp::Client::new: the resolved working directory (root_path, or its parent when root_path is not a directory) could not be converted into a valid URI, so the language server process cannot be started with a workspace root.","triggerScenarios":"Thrown at crates/lsp/src/lsp.rs:445 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Open the project from a valid local directory path","Check for unusual characters/encodings in the project path","Report if a valid path is rejected (path-to-Url conversion bug)"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9d272b036335401f339d024ea94968fd51016c40","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}