{"record":{"id":"e583ecd41a21bf4a","repo":"libnyanpasu/clash-nyanpasu","slug":"failed-to-stop-service-exit-code-signal","errorCode":null,"errorMessage":"failed to stop service, exit code: {}, signal: {:?}","messagePattern":"failed to stop service, exit code: (.+?), signal: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"backend/tauri/src/core/service/control.rs","lineNumber":242,"sourceCode":"    })\n    .await??;\n    if !child.success() {\n        anyhow::bail!(\n            \"failed to stop service, exit code: {}, signal: {:?}\",\n            child.code().unwrap_or(-1),\n            {\n                #[cfg(unix)]\n                {\n                    child.signal().unwrap_or(0)\n                }\n                #[cfg(not(unix))]\n                {\n                    0\n                }\n            }\n        );\n    }\n    Ok(())\n}","sourceCodeStart":224,"sourceCodeEnd":260,"githubUrl":"https://github.com/libnyanpasu/clash-nyanpasu/blob/f7dbce2997c633e484f54788035e770b3ee99773/backend/tauri/src/core/service/control.rs#L224-L260","documentation":"stop_service ran the service stopper with elevated privileges (RunasCommand on Windows, sudo on macOS) and the child process exited non-zero, so the nyanpasu service was not stopped. The check fires when the privileged stop command returns failure — typically a denied elevation prompt or the service manager refusing/still holding the service.","triggerScenarios":"Thrown at backend/tauri/src/core/service/control.rs:242 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry and accept the elevation prompt.","Check the service's current state with status(); it may already be stopped or stuck.","Stop the underlying core process manually if the service is hung, then retry stop_service.","Run the service binary manually with the `stop` argument as administrator to see detailed error output; reinstall the service if it remains unresponsive."],"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"}