louislam/uptime-kuma · error · Error

PagerTree notification failed with status code ${result.stat

Error message

PagerTree notification failed with status code ${result.status}

What it means

PagerTree's checkResult(result) range guard: once status is known, any value outside 200-299 throws 'PagerTree notification failed with status code <status>'. This is the normal non-2xx failure for the PagerTree integration API call that posts an incident event.

Source

Thrown at server/notification-providers/pagertree.js:50

                return this.postNotification(notification, title, monitorJSON, heartbeatJSON);
            }
        } catch (error) {
            this.throwGeneralAxiosError(error);
        }
    }

    /**
     * Check if result is successful, result code should be in range 2xx
     * @param {object} result Axios response object
     * @returns {void}
     * @throws {Error} The status code is not in range 2xx
     */
    checkResult(result) {
        if (result.status == null) {
            throw new Error("PagerTree notification failed with invalid response!");
        }
        if (result.status < 200 || result.status >= 300) {
            throw new Error("PagerTree notification failed with status code " + result.status);
        }
    }

    /**
     * Send the message
     * @param {BeanModel} notification Message title
     * @param {string} title Message title
     * @param {object} monitorJSON Monitor details (For Up/Down only)
     * @param {object} heartbeatJSON Heartbeat details (For Up/Down only)
     * @param {?string} eventAction Action event for PagerTree (create, resolve)
     * @returns {Promise<string>} Success state
     */
    async postNotification(notification, title, monitorJSON, heartbeatJSON, eventAction = "create") {
        if (eventAction == null) {
            return "No action required";
        }

        const options = {

View on GitHub (pinned to 6b5ea01557)

Solutions

  1. Verify the PagerTree Integration URL and API token are current and the integration is enabled.
  2. Ensure the posted body matches PagerTree's expected fields (event, incident_key, etc.).
  3. On 429, back off; on 5xx, retry and check PagerTree status.
  4. Log PagerTree's response body for the specific error detail on 4xx.
Defensive patterns

Strategy: try-catch

Validate before calling

if (!notification.pagertreeIntegrationUrl || !notification.pagertreeIntegrationKey) {
    throw new Error("PagerTree endpoint and Integration key are required");
}

Type guard

/** @param {{status:number}} r */
function is2xx(r) {
    return typeof r.status === "number" && r.status >= 200 && r.status < 300;
}

Try / catch

try {
    const result = await axios.post(url, payload, config);
    if (!is2xx(result)) {
        throw new Error(`PagerTree HTTP ${result.status}: ${JSON.stringify(result.data)}`);
    }
} catch (e) {
    if (e.response?.status === 429 || e.response?.status >= 500) { /* retryable */ }
    throw e;
}

Prevention

When it happens

Trigger: PagerTree returns 400 (bad payload / missing fields), 401/403 (bad or missing Integration API token), 404 (wrong URL/endpoint), 429 (rate limit), or 5xx.

Common situations: PagerTree Integration API token wrong/revoked; the PagerTree endpoint URL misconfigured; event_action value not in the supported set (create/resolve); PagerTree outage.

Related errors


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