louislam/uptime-kuma · warning · Error

No valid OpenWA chat ID found.

Error message

No valid OpenWA chat ID found.

What it means

OpenWA splits notification.openwaChatId on commas, trims, and filters empty; if nothing remains it throws 'No valid OpenWA chat ID found.' before constructing the per-session send-text URL ({openwaApiUrl}/api/sessions/{session}/messages/send-text). Pure validation guard — no HTTP call occurs when this fires.

Source

Thrown at server/notification-providers/openwa.js:35

                text = await this.renderTemplate(customMessage, msg, monitorJSON, heartbeatJSON);
            }

            let config = {
                headers: {
                    Accept: "application/json",
                    "Content-Type": "application/json",
                    "X-Api-Key": notification.openwaApiKey,
                },
            };
            config = this.getAxiosConfigWithProxy(config);

            const chatIds = (notification.openwaChatId || "")
                .split(",")
                .map((id) => id.trim())
                .filter((id) => id.length > 0);

            if (chatIds.length === 0) {
                throw new Error("No valid OpenWA chat ID found.");
            }

            const baseUrl = notification.openwaApiUrl.replace(/([^/])\/+$/, "$1");
            const sessionId = encodeURIComponent(notification.openwaSession);
            const url = `${baseUrl}/api/sessions/${sessionId}/messages/send-text`;

            for (const chatId of chatIds) {
                await axios.post(
                    url,
                    {
                        chatId,
                        text,
                    },
                    config
                );
            }

            return okMsg;

View on GitHub (pinned to 6b5ea01557)

Solutions

  1. Enter at least one valid WhatsApp chat id (e.g. 1234567890@c.us for individuals or a group id) in openwaChatId.
  2. For multiple recipients, separate with commas; remove trailing commas that leave empty entries.
  3. Confirm the OpenWA session is authenticated/running so that, once a chat id is provided, the send-text call can succeed.
Defensive patterns

Strategy: validation

Validate before calling

const chatIds = String(notification.openwaChatId || "")
    .split(",")
    .map((id) => id.trim())
    .filter((id) => id.length > 0);
if (chatIds.length === 0) {
    throw new Error("No valid OpenWA chat ID found.");
}

Type guard

/** @param {string} id */
function looksLikeWaChatId(id) {
    return typeof id === "string" && /\d+@(c\.us|g\.us)$/.test(id);
}

Prevention

When it happens

Trigger: openwaChatId is empty, whitespace, or contains only commas; the field was cleared or never set.

Common situations: User configured the OpenWA server/session/api key but forgot to enter a chat id; chat id stored under a different field name; config migration left the field empty.

Related errors


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