libnyanpasu/clash-nyanpasu · error

failed to install service, exit code: {}, signal: {:?}

Error message

failed to install service, exit code: {}, signal: {:?}

What it means

install_service ran the privileged service installer (RunasCommand elevation on Windows, sudo helper on macOS) via spawn_blocking, and the child process exited with a non-zero status. The exit code/signal is surfaced so callers can diagnose why the nyanpasu service failed to install; it does not indicate a Rust-side failure, only that the elevated installer itself reported failure (e.g. user denied elevation or the installer errored).

Source

Thrown at backend/tauri/src/core/service/control.rs:80

    })
    .await??;
    if !child.success() {
        anyhow::bail!(
            "failed to install service, exit code: {}, signal: {:?}",
            child.code().unwrap_or(-1),
            {
                #[cfg(unix)]
                {
                    child.signal().unwrap_or(0)
                }
                #[cfg(not(unix))]
                {
                    0
                }
            }
        );
    }
    Ok(())
}

View on GitHub (pinned to f7dbce2997)

Solutions

  1. Re-run install_service and accept the OS elevation (UAC/sudo) prompt when it appears.
  2. Check the exit code: non-zero usually means the elevation prompt was denied or the service installer binary failed; run the service executable manually with the install argument to see its error output.
  3. Verify the service binary exists at SERVICE_PATH and is not blocked/quarantined by antivirus before retrying.
  4. On Windows, check that the user account is allowed to elevate; on macOS, verify sudo credentials are valid.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at backend/tauri/src/core/service/control.rs:80 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of libnyanpasu/clash-nyanpasu@f7dbce2997 (2026-09-08). Data as JSON: /api/errors/58f6822415a369bf. Report an issue: GitHub.