{"record":{"id":"218a0c586f246cca","repo":"louislam/uptime-kuma","slug":"pagertree-notification-failed-with-status-code-r","errorCode":null,"errorMessage":"PagerTree notification failed with status code ${result.status}","messagePattern":"PagerTree notification failed with status code (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"server/notification-providers/pagertree.js","lineNumber":50,"sourceCode":"                return this.postNotification(notification, title, monitorJSON, heartbeatJSON);\n            }\n        } catch (error) {\n            this.throwGeneralAxiosError(error);\n        }\n    }\n\n    /**\n     * Check if result is successful, result code should be in range 2xx\n     * @param {object} result Axios response object\n     * @returns {void}\n     * @throws {Error} The status code is not in range 2xx\n     */\n    checkResult(result) {\n        if (result.status == null) {\n            throw new Error(\"PagerTree notification failed with invalid response!\");\n        }\n        if (result.status < 200 || result.status >= 300) {\n            throw new Error(\"PagerTree notification failed with status code \" + result.status);\n        }\n    }\n\n    /**\n     * Send the message\n     * @param {BeanModel} notification Message title\n     * @param {string} title Message title\n     * @param {object} monitorJSON Monitor details (For Up/Down only)\n     * @param {object} heartbeatJSON Heartbeat details (For Up/Down only)\n     * @param {?string} eventAction Action event for PagerTree (create, resolve)\n     * @returns {Promise<string>} Success state\n     */\n    async postNotification(notification, title, monitorJSON, heartbeatJSON, eventAction = \"create\") {\n        if (eventAction == null) {\n            return \"No action required\";\n        }\n\n        const options = {","sourceCodeStart":32,"sourceCodeEnd":68,"githubUrl":"https://github.com/louislam/uptime-kuma/blob/6b5ea0155793e666666745fb8d6fef1e829543a2/server/notification-providers/pagertree.js#L32-L68","documentation":"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.","triggerScenarios":"PagerTree returns 400 (bad payload / missing fields), 401/403 (bad or missing Integration API token), 404 (wrong URL/endpoint), 429 (rate limit), or 5xx.","commonSituations":"PagerTree Integration API token wrong/revoked; the PagerTree endpoint URL misconfigured; event_action value not in the supported set (create/resolve); PagerTree outage.","solutions":["Verify the PagerTree Integration URL and API token are current and the integration is enabled.","Ensure the posted body matches PagerTree's expected fields (event, incident_key, etc.).","On 429, back off; on 5xx, retry and check PagerTree status.","Log PagerTree's response body for the specific error detail on 4xx."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if (!notification.pagertreeIntegrationUrl || !notification.pagertreeIntegrationKey) {\n    throw new Error(\"PagerTree endpoint and Integration key are required\");\n}","typeGuard":"/** @param {{status:number}} r */\nfunction is2xx(r) {\n    return typeof r.status === \"number\" && r.status >= 200 && r.status < 300;\n}","tryCatchPattern":"try {\n    const result = await axios.post(url, payload, config);\n    if (!is2xx(result)) {\n        throw new Error(`PagerTree HTTP ${result.status}: ${JSON.stringify(result.data)}`);\n    }\n} catch (e) {\n    if (e.response?.status === 429 || e.response?.status >= 500) { /* retryable */ }\n    throw e;\n}","preventionTips":["Confirm the PagerTree Integration URL/token are current.","Retry only on 5xx/429; treat 4xx as config errors.","Log PagerTree's response body on 4xx for specifics."],"tags":["pagertree","http","status-code","integration-api"],"backgroundTag":null,"analyzedSha":"6b5ea0155793e666666745fb8d6fef1e829543a2","analyzedAt":"2026-08-12T23:42:12.959Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}