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
- Edit the Grafana Oncall notification integration and paste the Integration URL copied from Grafana Oncall (Alerting -> Integrations -> Generic).
- Ensure the saved field name matches what the provider reads: notification.GrafanaOncallURL (case-sensitive).
- 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
- Validate required provider URLs at notification-save time so the user learns immediately, not on the first alert.
- Mark the URL field required and of type url in the form schema.
- Run a test send right after creating the integration.
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
- Interval cannot be less than ${MIN_INTERVAL_SECOND} seconds
- Retry interval cannot be less than ${MIN_INTERVAL_SECOND} se
- Response max length cannot be less than 0
- Response max length cannot be more than ${RESPONSE_BODY_LENG
- Kafka Producer Brokers must be valid JSON: ${e.message}
AI-assisted analysis of louislam/uptime-kuma@6b5ea01557 (2026-08-12).
Data as JSON: /api/errors/f4305a85443b9a50.
Report an issue: GitHub.