{"record":{"id":"7b03d7005fe4b308","repo":"louislam/uptime-kuma","slug":"error-message","errorCode":null,"errorMessage":"${error.message}","messagePattern":"\\$\\{error\\.message\\}","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"server/monitor-types/rabbitmq.js","lineNumber":106,"sourceCode":"                `[${monitor.name}] Axios Response: status=${res.status} body=${JSON.stringify(res.data)}`\n            );\n\n            if (res.status === 200) {\n                log.debug(\"monitor\", `[${monitor.name}] Node ${nodeInfo} is healthy`);\n                // Success - return without error\n            } else if (res.status === 503) {\n                throw new Error(res.data.reason);\n            } else {\n                throw new Error(`${res.status} - ${res.statusText}`);\n            }\n        } catch (error) {\n            if (axios.isCancel(error)) {\n                throw new Error(\"Request timed out\");\n            } else if (error.response) {\n                // Re-throw with the original error message if it's already formatted\n                throw error;\n            } else {\n                throw new Error(error.message);\n            }\n        }\n    }\n}\n\nmodule.exports = {\n    RabbitMqMonitorType,\n};\n","sourceCodeStart":88,"sourceCodeEnd":115,"githubUrl":"https://github.com/louislam/uptime-kuma/blob/6b5ea0155793e666666745fb8d6fef1e829543a2/server/monitor-types/rabbitmq.js#L88-L115","documentation":"The final else branch in checkSingleNode's catch handles errors with no axios `.response` property — i.e. the request never got an HTTP answer. It throws a fresh Error wrapping error.message. This is the network/transport failure path, distinct from the 503 and generic-status branches above it.","triggerScenarios":"axios fails before receiving a response: ECONNREFUSED, ENOTFOUND (DNS), ECONNRESET, EAI_AGAIN, certificate errors, or socket hangup. Since error.response is undefined, the catch falls to else and re-wraps the OS/axios message.","commonSituations":"Wrong host/port, DNS not resolving the node name, firewall dropping the connection, TLS certificate mismatch with rejectUnauthorized, or the RabbitMQ node process not listening on the management port.","solutions":["Verify host and port resolve and accept connections: nc -vz host 15672.","Check DNS resolution and /etc/hosts or the cluster's name resolution.","If TLS: confirm the certificate is trusted or adjust the relevant TLS settings.","Ensure the RabbitMQ management plugin is listening (netstat -tlnp | grep 15672)."],"exampleFix":"# before\ngetaddrinfo ENOTFOUND rabbit-prod.local\n# after\n# add DNS/hosts entry or correct the node hostname in the monitor","handlingStrategy":"validation","validationCode":"const dns = require('dns').promises;\nconst net = require('net');\nasync function preflightRabbitReachability(baseUrl) {\n  const u = new URL(baseUrl);\n  await dns.lookup(u.hostname);\n  const ok = await new Promise(res => {\n    const s = net.connect({ host: u.hostname, port: Number(u.port || 15672) });\n    s.setTimeout(3000, () => { s.destroy(); res(false); });\n    s.once('connect', () => { s.destroy(); res(true); });\n    s.once('error', () => res(false));\n  });\n  if (!ok) throw new Error(`Cannot reach ${u.hostname}:${u.port || 15672}`);\n}","typeGuard":"function isTransportError(e) { return !e.response && (e.code === 'ECONNREFUSED' || e.code === 'ENOTFOUND' || e.code === 'ECONNRESET'); }","tryCatchPattern":"try {\n  await checkSingleNode(monitor, baseUrl, nodeInfo);\n} catch (e) {\n  if (/ENOTFOUND|ECONNREFUSED|ECONNRESET/.test(e.message)) {\n    log.error('Network/DNS issue reaching RabbitMQ node');\n  }\n  throw e;\n}","preventionTips":["Validate DNS and port reachability before adding a node.","Keep /etc/hosts or DNS records current for cluster nodes.","Whitelist the Uptime Kuma host on the management port firewall."],"tags":["rabbitmq","network","dns","transport"],"backgroundTag":null,"analyzedSha":"6b5ea0155793e666666745fb8d6fef1e829543a2","analyzedAt":"2026-08-12T23:42:12.959Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}