louislam/uptime-kuma · error · Error
Splunk notification failed with invalid response!
Error message
Splunk notification failed with invalid response!
What it means
Thrown by Splunk.checkResult when the axios response object has no status field at all (result.status == null, covering both null and undefined). A well-formed axios response always has a numeric status, so reaching this branch means the response object was synthesized, stripped, or came from a non-standard adapter/interceptor.
Source
Thrown at server/notification-providers/splunk.js:46
if (heartbeatJSON.status === DOWN) {
const title = "Uptime Kuma Monitor 🔴 Down";
return this.postNotification(notification, title, heartbeatJSON.msg, monitorJSON, "trigger");
}
} 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("Splunk notification failed with invalid response!");
}
if (result.status < 200 || result.status >= 300) {
throw new Error("Splunk notification failed with status code " + result.status);
}
}
/**
* Send the message
* @param {BeanModel} notification Message title
* @param {string} title Message title
* @param {string} body Message
* @param {object} monitorInfo Monitor details (For Up/Down only)
* @param {?string} eventAction Action event for PagerDuty (trigger, acknowledge, resolve)
* @returns {Promise<string>} Success state
*/
async postNotification(notification, title, body, monitorInfo, eventAction = "trigger") {
let monitorUrl;
if (monitorInfo.type === "port") {View on GitHub (pinned to 6b5ea01557)
Solutions
- Inspect the axios instance used by the Splunk provider for response interceptors that discard the status field.
- If testing, ensure the mock response includes status (e.g. {status:200, statusText:'OK', data:{}}).
- Check for an axios major-version mismatch that may have altered the response envelope.
- Log the raw result object before checkResult to identify what shape is actually arriving.
Example fix
// before
checkResult(result) {
if (result.status == null) {
throw new Error("Splunk notification failed with invalid response!");
}
}
// after (diagnose the unexpected shape)
checkResult(result) {
if (result == null || result.status == null) {
throw new Error(`Splunk notification failed with invalid response: ${JSON.stringify(result)}`);
}
} Defensive patterns
Strategy: type-guard
Validate before calling
// Guard against a non-axios response shape before checkResult is called
function isAxiosResponse(r) {
return r && typeof r === "object" && typeof r.status === "number";
}
if (!isAxiosResponse(result)) {
throw new Error(`Splunk returned a non-standard response: ${JSON.stringify(result)}`);
} Type guard
/** Narrows to a valid axios response with a numeric status. */
function isAxiosResponse(r) {
return r != null && typeof r === "object" && typeof r.status === "number";
} Try / catch
try {
const result = await axios.request(options);
if (result?.status == null) {
throw new Error(`Splunk notification failed with invalid response: ${JSON.stringify(result)}`);
}
if (result.status < 200 || result.status >= 300) {
throw new Error(`Splunk notification failed with status code ${result.status}`);
}
} catch (err) {
this.throwGeneralAxiosError(err);
} Prevention
- Review axios response interceptors that might strip the status field.
- In tests, build mock responses with status + statusText + data.
- Pin axios to a tested major version.
When it happens
Trigger: An axios response interceptor returns a non-response object, a custom adapter (mock/proxy) returns {data} only, the request was short-circuited by a transformRequest bug, or a library upgrade changed the response shape. Also reachable in tests that pass a partial mock.
Common situations: Custom axios instance with interceptors that return only data, MITM/proxy tools rewriting the response, or unit tests feeding checkResult a hand-built object without status.
Related errors
- PagerDuty notification failed with invalid response!
- PagerTree notification failed with invalid response!
- Splunk notification failed with status code ${result.status}
- user not found, have you installed?
- user not found, have you installed?
AI-assisted analysis of louislam/uptime-kuma@6b5ea01557 (2026-08-12).
Data as JSON: /api/errors/c41e66e33b7d19d4.
Report an issue: GitHub.