{"record":{"id":"5f243fd58966e199","repo":"libnyanpasu/clash-nyanpasu","slug":"failed-to-query-service-status-exit-code-sig","errorCode":null,"errorMessage":"failed to query service status, exit code: {}, signal: {:?}","messagePattern":"failed to query service status, exit code: (.+?), signal: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"backend/tauri/src/core/service/control.rs","lineNumber":311,"sourceCode":"pub async fn status<'a>() -> anyhow::Result<nyanpasu_ipc::types::StatusInfo<'a>> {\n    let mut cmd = tokio::process::Command::new(SERVICE_PATH.as_path());\n    cmd.args([\"status\", \"--json\"]);\n    #[cfg(windows)]\n    cmd.creation_flags(0x08000000); // CREATE_NO_WINDOW\n    let output = cmd.output().await?;\n    if !output.status.success() {\n        anyhow::bail!(\n            \"failed to query service status, exit code: {}, signal: {:?}\",\n            output.status.code().unwrap_or(-1),\n            {\n                #[cfg(unix)]\n                {\n                    output.status.signal().unwrap_or(0)\n                }\n                #[cfg(not(unix))]\n                {\n                    0\n                }\n            }\n        );\n    }","sourceCodeStart":293,"sourceCodeEnd":329,"githubUrl":"https://github.com/libnyanpasu/clash-nyanpasu/blob/f7dbce2997c633e484f54788035e770b3ee99773/backend/tauri/src/core/service/control.rs#L293-L329","documentation":"status spawns the service binary directly (no elevation; CREATE_NO_WINDOW on Windows) with `status --json` and this guard fires when that query process exits non-zero. It means the service could not be queried — commonly because the service is not installed, its binary is missing, or the service manager refused the request — so no StatusInfo can be returned.","triggerScenarios":"Thrown at backend/tauri/src/core/service/control.rs:311 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["If the service is not installed, treat this as 'service absent' and install it via install_service rather than retrying the query.","Verify SERVICE_PATH exists and is executable; a stale path after an update causes the query to fail.","Run the service binary with `status --json` manually to see its error output.","Check OS service registration (sc query / launchctl list) to confirm the service exists."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}