louislam/uptime-kuma · error · Error
Bark notification failed with invalid response!
Error message
Bark notification failed with invalid response!
What it means
bark.js:78-86 (checkResult). A defensive guard: if the Axios response object has no `status` at all (null/undefined) the response is unusable, so the provider refuses to guess and throws 'invalid response'. Distinct from the status-out-of-range error.
Source
Thrown at server/notification-providers/bark.js:82
// picked a sound, this should follow system's mute status when arrival
if (notification.barkSound != null) {
params += "&sound=" + notification.barkSound;
} else {
// default sound
params += "&sound=" + "telegraph";
}
return params;
}
/**
* Check if result is successful
* @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("Bark notification failed with invalid response!");
}
if (result.status < 200 || result.status >= 300) {
throw new Error("Bark notification failed with status code " + result.status);
}
}
/**
* Send the message
* @param {BeanModel} notification Notification to send
* @param {string} title Message title
* @param {string} subtitle Message
* @param {string} endpoint Endpoint to send request to
* @returns {Promise<string>} Success message
*/
async postNotification(notification, title, subtitle, endpoint) {
let result;
let config = this.getAxiosConfigWithProxy({});
if (notification.apiVersion === "v1" || notification.apiVersion == null) {View on GitHub (pinned to 6b5ea01557)
Solutions
- Confirm the Bark endpoint URL is correct and the server is up.
- Test the endpoint directly: `curl -i https://api.day.app/<key>/<title>/<body>`.
- If self-hosting Bark, upgrade to a version that returns proper HTTP status codes.
- Remove any Axios response interceptors that overwrite the status field.
Defensive patterns
Strategy: type-guard
Validate before calling
// Verify the response shape before calling checkResult
function isUsableResponse(r) { return r != null && typeof r.status === 'number'; } Type guard
function hasBarkStatus(r) { return r != null && (typeof r.status === 'number' || r.status == null); } Try / catch
try { provider.checkResult(result); }
catch (e) {
if (/invalid response/.test(e.message)) log.error('Bark returned a response with no HTTP status — endpoint malformed');
} Prevention
- Self-hosted Bark servers should return proper HTTP status lines — keep them updated.
- Avoid Axios interceptors that mutate the response shape.
When it happens
Trigger: Axios returned a response with status unset (rare — usually means a network layer swallowed the HTTP layer), the Bark server returned a non-HTTP/empty byte stream, or a proxy returned an opaque object lacking status.
Common situations: Custom Bark-compatible self-hosted server returning malformed responses; intermediary that strips the status field; Axios interceptor mutating the response object.
Related errors
- Bark notification failed with status code ${result.status}
- FlashDuty notification failed with invalid response!
- Received unexpected status code ${result.status} from notifi
- Unexpected status code: ${result.status}
- Could not connect to Cellsynt, please try again.
AI-assisted analysis of louislam/uptime-kuma@6b5ea01557 (2026-08-12).
Data as JSON: /api/errors/f79679777d484519.
Report an issue: GitHub.