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
- Enter at least one valid WhatsApp chat id (e.g. 1234567890@c.us for individuals or a group id) in openwaChatId.
- For multiple recipients, separate with commas; remove trailing commas that leave empty entries.
- 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
- Require at least one chat id at save time.
- Validate the @c.us / @g.us suffix format before sending.
- Confirm the OpenWA session is authenticated before relying on it.
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
- No recipient or group specified
- 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
AI-assisted analysis of louislam/uptime-kuma@6b5ea01557 (2026-08-12).
Data as JSON: /api/errors/15ce9317d063b03a.
Report an issue: GitHub.