{"record":{"id":"6e96ad44d62fe4ed","repo":"libnyanpasu/clash-nyanpasu","slug":"error-6e96ad","errorCode":null,"errorMessage":"{}","messagePattern":"\\{\\}","errorType":"exception","errorClass":"std::io::Error (Other)","httpStatus":null,"severity":"error","filePath":"backend/tauri/src/utils/sudo.rs","lineNumber":58,"sourceCode":"            )])\n            .status();\n        match status {\n            Ok(status) if status.success() => Ok(()),\n            Ok(status) => {\n                // read the output file\n                let output = std::fs::read_to_string(out)\n                    .unwrap_or_else(|e| format!(\"failed to read output file: {}\", e));\n                Err(std::io::Error::new(\n                    std::io::ErrorKind::Other,\n                    format!(\n                        \"exit code: {:?}, signal: {:?}, output: {}\",\n                        status.code(),\n                        status.signal(),\n                        output\n                    ),\n                ))\n            }\n            Err(e) => Err(std::io::Error::new(\n                std::io::ErrorKind::Other,\n                e.to_string(),\n            )),\n        }\n    }\n}\n\n#[cfg(target_os = \"macos\")]\npub use macos::sudo;\n","sourceCodeStart":40,"sourceCodeEnd":68,"githubUrl":"https://github.com/libnyanpasu/clash-nyanpasu/blob/f7dbce2997c633e484f54788035e770b3ee99773/backend/tauri/src/utils/sudo.rs#L40-L68","documentation":"In the same `sudo` helper, when spawning/waiting on the privileged process itself fails (the `Err(e)` arm of the status match), the underlying error is rewrapped verbatim as an `Other` io::Error with just `e.to_string()` as the message.","triggerScenarios":"Calling `sudo` when the sudo backend cannot start the child process at all — the helper binary is missing, spawning fails due to permissions or resource limits, or the backend returns an OS-level error.","commonSituations":"sudo-prompt helper not present/allowed on macOS, Windows UAC service unavailable, PATH issues, or system resource exhaustion preventing process spawn.","solutions":["Inspect the message for the underlying spawn error (missing helper, permission denied).","Reinstall/repair the app so the privilege-escalation helper is present.","Check that the process can spawn executables (security software, seccomp/sandbox policies).","Retry; transient spawn failures can be caused by resource exhaustion."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// spawn errors are environmental; retry with backoff\nfor _ in 0..2 { if sudo(cmd).is_ok() { break; } }","typeGuard":null,"tryCatchPattern":"match sudo(cmd) {\n    Err(e) if e.kind() == std::io::ErrorKind::Other => {\n        log::error!(\"sudo spawn failed: {e}\");\n        // surface reinstall guidance to user\n    }\n    other => other?,\n}","preventionTips":["Ensure the privilege-escalation helper is bundled and intact","Check sandbox/security software that blocks process spawning","Retry transient spawn failures with backoff"],"tags":["sudo","process","spawn","privileges"],"backgroundTag":"command-failed","analyzedSha":"f7dbce2997c633e484f54788035e770b3ee99773","analyzedAt":"2026-09-08T01:24:59.197Z","contentChangedAt":"2026-09-08T01:24:59.197Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}