{"record":{"id":"b53f9bdedaf86d6e","repo":"astral-sh/ruff","slug":"internalerror-b53f9b","errorCode":"InternalError","errorMessage":"uv was not found; is it installed and on the PATH?","messagePattern":"uv was not found; is it installed and on the PATH\\?","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/ruff_server/src/format.rs","lineNumber":315,"sourceCode":"        command.stdout(Stdio::piped());\n        command.stderr(Stdio::piped());\n\n        command\n    }\n\n    /// Execute the format command on the given source.\n    fn format(\n        &self,\n        source: &str,\n        path: &Path,\n        range_with_index: Option<(TextRange, &LineIndex)>,\n    ) -> crate::Result<FormatResult> {\n        let mut command =\n            self.build_command(path, range_with_index.map(|(r, idx)| (r, idx, source)));\n        let mut child = match command.spawn() {\n            Ok(child) => child,\n            Err(err) if err.kind() == std::io::ErrorKind::NotFound => {\n                anyhow::bail!(\"uv was not found; is it installed and on the PATH?\")\n            }\n            Err(err) => return Err(err).context(\"Failed to spawn uv\"),\n        };\n\n        let mut stdin = child\n            .stdin\n            .take()\n            .context(\"Failed to get stdin from format subprocess\")?;\n        stdin\n            .write_all(source.as_bytes())\n            .context(\"Failed to write to stdin\")?;\n        drop(stdin);\n\n        let result = child\n            .wait_with_output()\n            .context(\"Failed to get output from format subprocess\")?;\n\n        if !result.status.success() {","sourceCodeStart":297,"sourceCodeEnd":333,"githubUrl":"https://github.com/astral-sh/ruff/blob/d1087a4b9e03d253a88703f34e0869ee4b805456/crates/ruff_server/src/format.rs#L297-L333","documentation":"The ruff LSP server was configured to format via the external uv backend (FormatBackend::Uv) and tried to spawn a `uv` process, but the OS returned ENOENT: no executable named uv exists in the server process's PATH. Note the PATH seen by the server is the one inherited from how the editor was launched, which often differs from a terminal's PATH.","triggerScenarios":"Selecting the uv format backend in editor settings without uv installed; uv installed via a shell profile (export PATH=...) that GUI-launched editors never source; servers launched by systemd/containers with a minimal PATH.","commonSituations":"macOS: editor launched from Dock/Spotlight misses Homebrew/user-local PATH entries; remote development containers or devcontainers without uv; CI environments running the LSP harness without uv in the image.","solutions":["Install uv (e.g. `curl -LsSf https://astral.sh/uv/install.sh | sh`, `pip install uv`, or `brew install uv`)","Restart the editor completely after installing so it inherits the updated PATH (reloading the window is not enough)","Or switch the format backend setting back to the built-in `internal` formatter, which needs no external process"],"exampleFix":"# verify what the editor-side PATH contains, then install\nwhich uv || curl -LsSf https://astral.sh/uv/install.sh | sh\n# fully quit and reopen the editor, then format again","handlingStrategy":"validation","validationCode":"# check the editor-side PATH has uv before selecting the uv format backend\ncommand -v uv >/dev/null 2>&1 || echo \"uv missing on PATH — install it or use the internal backend\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Install uv before enabling the uv format backend","Launch editors from a shell (or ensure profile PATH) so the server process inherits a PATH containing uv","Keep the built-in `internal` backend as the default when you do not need uv-managed formatter versions"],"tags":["lsp","ruff-server","formatter","uv","path","subprocess"],"backgroundTag":"executable-not-found","analyzedSha":"d1087a4b9e03d253a88703f34e0869ee4b805456","analyzedAt":"2026-08-20T16:33:49.445Z","contentChangedAt":"2026-08-20T16:33:49.445Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}