louislam/uptime-kuma · warning · Error
PagerTree notification failed with invalid response!
Error message
PagerTree notification failed with invalid response!
What it means
PagerTree's checkResult(result) guard fires when result.status == null — the response object exists but has no numeric status. Mirror of the PagerDuty pattern: a defensive check for an unexpected/empty response before the 2xx range test.
Source
Thrown at server/notification-providers/pagertree.js:47
if (heartbeatJSON.status === DOWN) {
const title = `Uptime Kuma Monitor "${monitorJSON.name}" is DOWN`;
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";View on GitHub (pinned to 6b5ea01557)
Solutions
- Log the raw result object to identify why status is null.
- Fix/remove custom axios interceptors or adapters on this request path.
- Ensure any proxy in front of PagerTree preserves the HTTP status line.
- Set status explicitly in any mocked responses.
Defensive patterns
Strategy: type-guard
Type guard
/** @param {unknown} r */
function hasHttpStatus(r) {
return typeof r === "object" && r !== null &&
typeof r.status === "number" && r.status >= 100 && r.status < 600;
} Try / catch
if (!hasHttpStatus(result)) {
throw new Error("PagerTree returned a malformed response (no HTTP status)");
} Prevention
- Always set status on mocked responses.
- Do not run axios interceptors that strip the status field.
- Ensure proxies preserve the status line.
When it happens
Trigger: A custom axios adapter/interceptor or an intermediary proxy returned a response object without a status field; mocked responses in tests omit status; the PagerTree response was malformed in transit.
Common situations: Misbehaving reverse proxy; axios response transformer that drops status; tests with incomplete mocks.
Related errors
- PagerDuty notification failed with invalid response!
- Your JSON body is invalid. ${e.message}
- Headers must be valid JSON: ${e.message}
- Accepted status codes must be valid JSON: ${e.message}
- PagerTree notification failed with status code ${result.stat
AI-assisted analysis of louislam/uptime-kuma@6b5ea01557 (2026-08-12).
Data as JSON: /api/errors/40b31bd5577b54f6.
Report an issue: GitHub.