louislam/uptime-kuma · error · Error

RabbitMQ Nodes must be valid JSON

Error message

RabbitMQ Nodes must be valid JSON: ${e.message}

What it means

validate() runs JSON.parse on rabbitmqNodes for RabbitMQ monitors. It must be valid JSON (typically an array of node URLs).

Solutions

  1. Provide rabbitmqNodes as valid JSON matching the expected shape
  2. Validate with JSON.parse before saving
Defensive patterns

Strategy: validation

Validate before calling

if (monitor.rabbitmqNodes) { JSON.parse(monitor.rabbitmqNodes); } // throws if invalid

Type guard

function isValidJsonField(v) { if (!v) return true; try { JSON.parse(v); return true; } catch { return false; } }

Try / catch

try { monitor.validate(); await save(monitor); } catch (e) { /* surface e.message */ }

Prevention

When it happens

Trigger: rabbitmqNodes contains a non-JSON string (comma-separated nodes, plain text).

Common situations: Pasting node list as newline- or comma-separated text instead of a JSON array.

Related errors


AI-assisted analysis of louislam/uptime-kuma@6b5ea01557 (2026-08-12). Data as JSON: /api/errors/25aa8ae0a1191e4a. Report an issue: GitHub.

Appendix: source

Thrown at server/model/monitor.js:1665

                JSON.parse(this.kafkaProducerBrokers);
            } catch (e) {
                throw new Error(`Kafka Producer Brokers must be valid JSON: ${e.message}`);
            }
        }

        if (this.kafkaProducerSaslOptions) {
            try {
                JSON.parse(this.kafkaProducerSaslOptions);
            } catch (e) {
                throw new Error(`Kafka Producer SASL Options must be valid JSON: ${e.message}`);
            }
        }

        if (this.rabbitmqNodes) {
            try {
                JSON.parse(this.rabbitmqNodes);
            } catch (e) {
                throw new Error(`RabbitMQ Nodes must be valid JSON: ${e.message}`);
            }
        }

        if (this.conditions) {
            try {
                JSON.parse(this.conditions);
            } catch (e) {
                throw new Error(`Conditions must be valid JSON: ${e.message}`);
            }
        }

        if (this.headers) {
            try {
                JSON.parse(this.headers);
            } catch (e) {
                throw new Error(`Headers must be valid JSON: ${e.message}`);
            }
        }

View on GitHub (pinned to 6b5ea01557)