louislam/uptime-kuma · warning · Error

GrafanaOncallURL cannot be empty

Error message

GrafanaOncallURL cannot be empty

What it means

A preflight validation guard in the Grafana Oncall provider: before any network call, it requires notification.GrafanaOncallURL to be truthy. If the field is empty/undefined/null, it throws immediately. This prevents sending a request to an undefined host and is a pure configuration check — no HTTP traffic occurs when it fires.

Source

Thrown at server/notification-providers/grafana-oncall.js:15

const NotificationProvider = require("./notification-provider");
const axios = require("axios");
const { DOWN, UP } = require("../../src/util");

class GrafanaOncall extends NotificationProvider {
    name = "GrafanaOncall";

    /**
     * @inheritdoc
     */
    async send(notification, msg, monitorJSON = null, heartbeatJSON = null) {
        const okMsg = "Sent Successfully.";

        if (!notification.GrafanaOncallURL) {
            throw new Error("GrafanaOncallURL cannot be empty");
        }

        try {
            let config = this.getAxiosConfigWithProxy({});
            if (heartbeatJSON === null) {
                let grafanaupdata = {
                    title: "General notification",
                    message: msg,
                    state: "alerting",
                };
                await axios.post(notification.GrafanaOncallURL, grafanaupdata, config);
                return okMsg;
            } else if (heartbeatJSON["status"] === DOWN) {
                let grafanadowndata = {
                    title: monitorJSON["name"] + " is down",
                    message: heartbeatJSON["msg"],
                    state: "alerting",
                };

View on GitHub (pinned to 6b5ea01557)

Solutions

  1. Edit the Grafana Oncall notification integration and paste the Integration URL copied from Grafana Oncall (Alerting -> Integrations -> Generic).
  2. Ensure the saved field name matches what the provider reads: notification.GrafanaOncallURL (case-sensitive).
  3. Save and re-run the test notification to confirm the guard no longer fires.
Defensive patterns

Strategy: validation

Validate before calling

if (!notification.GrafanaOncallURL || typeof notification.GrafanaOncallURL !== "string" || !/^https?:\/\//.test(notification.GrafanaOncallURL)) {
    throw new Error("GrafanaOncallURL must be a non-empty http(s) URL");
}

Type guard

/** @param {unknown} n */
function hasGrafanaOncallURL(n) {
    return typeof n === "object" && n !== null &&
        typeof n.GrafanaOncallURL === "string" &&
        n.GrafanaOncallURL.length > 0 &&
        /^https?:\/\//.test(n.GrafanaOncallURL);
}

Prevention

When it happens

Trigger: A Grafana Oncall notification was saved without setting GrafanaOncallURL, or the field was cleared/migrated to empty. Triggered on any send (test, up, down, general notification) for that integration.

Common situations: User created the notification entry but never pasted the integration URL; URL stored under a different field name due to a form/schema change; copying a notification config that omitted the URL.

Related errors


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