louislam/uptime-kuma · error · Error

System Service monitoring is not supported on ${process.plat

Error message

System Service monitoring is not supported on ${process.platform}

What it means

Thrown by SystemServiceMonitorType.check() when process.platform is neither 'win32' nor 'linux'. The implementation only ships systemd-based and PowerShell/Get-Service-based checkers, so any other platform (darwin, freebsd, aix, etc.) is explicitly rejected rather than running a meaningless command.

Source

Thrown at server/monitor-types/system-service.js:30

     * Detects OS and dispatches to the appropriate check method.
     * @param {object} monitor The monitor object containing monitor.system_service_name.
     * @param {object} heartbeat The heartbeat object to update.
     * @returns {Promise<void>} Resolves when check is complete.
     */
    async check(monitor, heartbeat) {
        const serviceName = (monitor.system_service_name || "").trim();

        if (!serviceName) {
            throw new Error("Service Name is required.");
        }

        if (process.platform === "win32") {
            return this.checkWindows(serviceName, heartbeat);
        } else if (process.platform === "linux") {
            return this.checkLinux(serviceName, heartbeat);
        }

        throw new Error(`System Service monitoring is not supported on ${process.platform}`);
    }

    /**
     * Linux Check (Systemd)
     * @param {string} serviceName The name of the service to check.
     * @param {object} heartbeat The heartbeat object.
     * @returns {Promise<void>}
     */
    async checkLinux(serviceName, heartbeat) {
        return new Promise((resolve, reject) => {
            // SECURITY: Prevent Argument Injection
            // Only allow alphanumeric, dots, dashes, underscores, and @
            if (!serviceName || !/^[a-zA-Z0-9._\-@]+$/.test(serviceName)) {
                reject(new Error("Invalid service name. Please use the internal Service Name (no spaces)."));
                return;
            }

            execFile("systemctl", ["is-active", serviceName], { timeout: 5000 }, (error, stdout, stderr) => {

View on GitHub (pinned to 6b5ea01557)

Solutions

  1. Run system-service monitors only on Linux or Windows hosts; on other platforms, disable or remove the monitor.
  2. If you need macOS/BSD support, implement a new check method (e.g. launchd) and add its platform branch.
  3. Confirm the deployment target platform is reported correctly (process.platform) and matches expectations.
Defensive patterns

Strategy: validation

Validate before calling

function isSupportedPlatform() { return ["linux", "win32"].includes(process.platform); }

Type guard

function platformHasChecker() { return typeof this[`check${process.platform === "win32" ? "Windows" : "Linux"}`] === "function"; }

Try / catch

if (!isSupportedPlatform()) { heartbeat.status = DOWN; heartbeat.msg = `Unsupported platform: ${process.platform}`; return; }

Prevention

When it happens

Trigger: Produced when the Uptime-Kuma process runs on macOS (darwin), a BSD, or any non-Windows/non-Linux OS and a monitor of type 'system-service' is evaluated.

Common situations: Developer running Uptime-Kuma locally on macOS and adding a system-service monitor; container host reporting a platform value the code does not recognise; deployment on FreeBSD/solaris.

Related errors


AI-assisted analysis of louislam/uptime-kuma@6b5ea01557 (2026-08-12). Data as JSON: /api/errors/bb1725311e85cf28. Report an issue: GitHub.