louislam/uptime-kuma · error · Error
${msg}
Error message
${msg} What it means
This is the terminal throwGeneralAxiosError(error) throw inside the base NotificationProvider class. It builds a single human-readable string from an axios/error: starts from error.message, appends (code=...) for error.code (e.g. ECONNREFUSED), (HTTP <status> <statusText>) when error.response exists, the response body (stringified if object), and expands AggregateError/cause chains (' - caused by: ...' / ' - cause: ...'). Nearly every provider's catch block calls this method, so this is the common funnel for all notification failures.
Source
Thrown at server/notification-providers/notification-provider.js:167
agg = error.cause;
}
if (agg) {
let causes = agg.errors
.map((e) => {
let m = e && e.message ? e.message : String(e);
if (e && e.code) {
m += ` (code=${e.code})`;
}
return m;
})
.join("; ");
msg += " - caused by: " + causes;
} else if (error && error.cause && error.cause.message) {
msg += " - cause: " + error.cause.message;
}
throw new Error(msg);
}
/**
* Returns axios config with proxy agent if proxy env is set.
* @param {object} axiosConfig - Axios config containing params
* @returns {object} Axios config
*/
getAxiosConfigWithProxy(axiosConfig = {}) {
const proxyEnv = process.env.notification_proxy || process.env.NOTIFICATION_PROXY;
if (proxyEnv) {
const proxyUrl = new URL(proxyEnv);
if (proxyUrl.protocol === "http:") {
axiosConfig.httpAgent = new HttpProxyAgent(proxyEnv);
axiosConfig.httpsAgent = new HttpsProxyAgent(proxyEnv);
} else if (proxyUrl.protocol === "https:") {
const agent = new HttpsProxyAgent(proxyEnv);
axiosConfig.httpAgent = agent;View on GitHub (pinned to 6b5ea01557)
Solutions
- Read the full message: a (code=...) suffix indicates a socket/DNS failure; an (HTTP <n>) suffix indicates the server responded but with an error status.
- For code=ENV... or proxy-related text, verify process.env.NOTIFICATION_PROXY / notification_proxy is a valid URL with a supported scheme (http, https, socks5).
- For HTTP 4xx, fix credentials/URL/payload for the specific provider; for 5xx, retry and check the provider's status.
- For TLS errors, ensure CA chain is valid on the host or correct the target URL scheme.
Defensive patterns
Strategy: try-catch
Validate before calling
const proxyEnv = process.env.notification_proxy || process.env.NOTIFICATION_PROXY;
if (proxyEnv) {
try { new URL(proxyEnv); } catch { throw new Error(`Invalid NOTIFICATION_PROXY URL: ${proxyEnv}`); }
} Type guard
/** @param {unknown} e */
function classifyAxiosError(e) {
if (!e) return "unknown";
if (e.response) return `http-${e.response.status}`;
if (e.code) return `transport-${e.code}`; // ECONNREFUSED, ENOTFOUND, ETIMEDOUT...
return "other";
} Try / catch
try {
await provider.send(notification, msg, monitorJSON, heartbeatJSON);
} catch (e) {
// throwGeneralAxiosError already aggregated context; classify for action
if (/\(code=ECONN(?:REFUSED|RESET)\)/.test(e.message)) { /* network - retry */ }
if (/\(HTTP 5\d\d\)/.test(e.message)) { /* server error - retry */ }
if (/\(HTTP 4\d\d\)/.test(e.message)) { /* client/config error - do not retry */ }
throw e;
} Prevention
- Parse the aggregated message: '(code=...)' = transport issue, '(HTTP <n>)' = server responded.
- Validate NOTIFICATION_PROXY URL at app startup.
- For 5xx/transport errors, retry with backoff; for 4xx, fix config.
When it happens
Trigger: Any provider that does this.throwGeneralAxiosError(error) in its catch routes here: network errors (ENOTFOUND, ECONNREFUSED, ETIMEDOUT, EAI_AGAIN), axios non-2xx rejections (error.response.status), TLS/cert errors, SOCKS/HTTP proxy errors (via getAxiosConfigWithProxy), or AggregateError from Promise.allSettled-style failures.
Common situations: Notification target unreachable; DNS failure for the provider hostname; self-signed/expired cert on the target; proxy env (notification_proxy / NOTIFICATION_PROXY) misconfigured; provider returned 4xx/5xx with a body that gets appended to the message.
Related errors
- ${error.response.data ? error.response.data : "Error without
- OneChat API Error: ${errorMessage}
- Invalid Docker response, is it Docker really a daemon?
- Connection to Docker daemon timed out.
- Packet size must be between ${PING_PACKET_SIZE_MIN} and ${PI
AI-assisted analysis of louislam/uptime-kuma@6b5ea01557 (2026-08-12).
Data as JSON: /api/errors/95b7001eb84f4730.
Report an issue: GitHub.