{"record":{"id":"273aab928b9d967d","repo":"louislam/uptime-kuma","slug":"no-rabbitmq-nodes-configured","errorCode":null,"errorMessage":"No RabbitMQ nodes configured","messagePattern":"No RabbitMQ nodes configured","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"server/monitor-types/rabbitmq.js","lineNumber":21,"sourceCode":"const { axiosAbortSignal } = require(\"../util-server\");\nconst axios = require(\"axios\");\n\nclass RabbitMqMonitorType extends MonitorType {\n    name = \"rabbitmq\";\n\n    /**\n     * @inheritdoc\n     */\n    async check(monitor, heartbeat, server) {\n        let baseUrls = [];\n        try {\n            baseUrls = JSON.parse(monitor.rabbitmqNodes);\n        } catch (error) {\n            throw new Error(\"Invalid RabbitMQ Nodes\");\n        }\n\n        if (baseUrls.length === 0) {\n            throw new Error(\"No RabbitMQ nodes configured\");\n        }\n\n        const errors = [];\n\n        for (let i = 0; i < baseUrls.length; i++) {\n            const baseUrl = baseUrls[i];\n            const nodeIndex = i + 1;\n\n            try {\n                await this.checkSingleNode(monitor, baseUrl, `${nodeIndex}/${baseUrls.length}`);\n                // If checkSingleNode succeeds (doesn't throw), set heartbeat to UP\n                heartbeat.status = UP;\n                heartbeat.msg =\n                    baseUrls.length === 1\n                        ? \"Node is reachable and there are no alerts in the cluster\"\n                        : `One of the ${baseUrls.length} nodes is reachable and there are no alerts in the cluster`;\n                return;\n            } catch (error) {","sourceCodeStart":3,"sourceCodeEnd":39,"githubUrl":"https://github.com/louislam/uptime-kuma/blob/6b5ea0155793e666666745fb8d6fef1e829543a2/server/monitor-types/rabbitmq.js#L3-L39","documentation":"JSON.parse(monitor.rabbitmqNodes) succeeded but produced an empty array (e.g. the literal string '[]'). With no nodes there is nothing to iterate, so the guard at rabbitmq.js:21 throws before the loop. This is distinct from error 103: the value was valid JSON, just semantically empty.","triggerScenarios":"monitor.rabbitmqNodes equals '[]' or a JSON array that evaluates to length 0 after parsing.","commonSituations":"User added the RabbitMQ monitor but never added a node, or removed all nodes and saved. A UI bug that serializes an empty list could also produce it.","solutions":["Add at least one RabbitMQ management URL to the monitor's node list.","Confirm the value is a non-empty JSON array, e.g. [\"http://rabbit-1:15672\"].","Re-open the monitor editor and ensure a node is present before saving."],"exampleFix":"// before\nmonitor.rabbitmqNodes = \"[]\";\n// after\nmonitor.rabbitmqNodes = \"[\\\"http://rabbit-1:15672\\\"]\";","handlingStrategy":"validation","validationCode":"function requireRabbitNodes(raw) {\n  const arr = parseRabbitNodes(raw); // reuse error 103 helper\n  if (arr.length === 0) throw new Error('At least one RabbitMQ node URL is required');\n  return arr;\n}","typeGuard":"function hasAtLeastOneNode(arr) { return Array.isArray(arr) && arr.length > 0; }","tryCatchPattern":"try {\n  await rabbitmqMonitor.check(monitor, heartbeat, server);\n} catch (e) {\n  if (/No RabbitMQ nodes configured/.test(e.message)) {\n    // prompt the user; nothing to retry\n  }\n  throw e;\n}","preventionTips":["Disable the Save button when the node list is empty.","Default to a single node placeholder the user edits.","Run the empty-list validation in a pre-save hook on the model."],"tags":["rabbitmq","config","validation"],"backgroundTag":null,"analyzedSha":"6b5ea0155793e666666745fb8d6fef1e829543a2","analyzedAt":"2026-08-12T23:42:12.959Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}