louislam/uptime-kuma · warning · Error
No valid recipient phone number was provided.
Error message
No valid recipient phone number was provided.
What it means
Ooredoo splits notification.ooredooToNumber on whitespace/comma/semicolon, maps each through normalizePhoneNumber, filters empties, and throws 'No valid recipient phone number was provided.' if nothing remains. This is a preflight validation: no HTTP request is made when it fires. It means every entered token either was empty or normalized to an empty string.
Source
Thrown at server/notification-providers/ooredoo.js:26
class Ooredoo extends NotificationProvider {
name = "Ooredoo";
/**
* @inheritdoc
*/
async send(notification, msg, monitorJSON = null, heartbeatJSON = null) {
const okMsg = "Sent Successfully.";
const url = notification.ooredooServerUrl || "https://o-papi1-lb01.ooredoo.mv/bulk_sms/v2";
// Users may enter recipients separated by comma, semicolon, space or
// newline.
const recipients = notification.ooredooToNumber
.split(/[\s,;]+/)
.map((number) => this.normalizePhoneNumber(number))
.filter((number) => number !== "");
if (recipients.length === 0) {
throw new Error("No valid recipient phone number was provided.");
}
try {
let config = {
headers: {
"Content-Type": "application/x-www-form-urlencoded",
Authorization: "Bearer " + notification.ooredooBearerToken,
},
};
config = this.getAxiosConfigWithProxy(config);
// The gateway only accepts MAX_RECIPIENTS_PER_REQUEST numbers per
// call, so send the recipients in batches of that size.
for (let i = 0; i < recipients.length; i += MAX_RECIPIENTS_PER_REQUEST) {
const batch = recipients.slice(i, i + MAX_RECIPIENTS_PER_REQUEST);
const data = new URLSearchParams({
username: notification.ooredooUsername,
// The gateway expects the access key to be Base64 encoded.View on GitHub (pinned to 6b5ea01557)
Solutions
- Enter at least one recipient in the Maldivian format the gateway expects (960XXXXXXX), or a form normalizePhoneNumber accepts.
- Remove stray commas/semicolons/blank entries from ooredooToNumber.
- Confirm normalizePhoneNumber logic matches the input format you are providing (country code, leading +, etc.).
Defensive patterns
Strategy: validation
Validate before calling
const recipients = String(notification.ooredooToNumber || "")
.split(/[\s,;]+/)
.map((n) => this.normalizePhoneNumber(n))
.filter((n) => n !== "");
if (recipients.length === 0) {
throw new Error("No valid recipient phone number was provided.");
} Type guard
/** @param {string} n */
function isMaldivianPhone(n) {
return /^960\d{7}$/.test(n);
} Prevention
- Validate recipient format at save time, not just at send time.
- Document the expected 960XXXXXXX format near the field.
- Reject the field when it contains only separators/whitespace.
When it happens
Trigger: ooredooToNumber is empty or contains only separators/whitespace; every entered number is non-numeric/letters so normalizePhoneNumber returns ''; numbers lack the expected country code and the normalizer drops them.
Common situations: Recipient field left blank; recipients pasted with only punctuation; numbers in a format normalizePhoneNumber does not recognize (it targets Maldivian 960XXXXXXX format).
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/05cc058bade613e7.
Report an issue: GitHub.