louislam/uptime-kuma · error · Error

FlashDuty notification failed with status code ${result.stat

Error message

FlashDuty notification failed with status code ${result.status}

What it means

flashduty.js:106-107. The response carries a status but it is outside the 200-299 success band, so FlashDuty did not accept the alert. The thrown message includes the specific status for diagnosis.

Source

Thrown at server/notification-providers/flashduty.js:107

                title,
                event_status: eventStatus || "Info",
                alert_key: monitorInfo.id ? String(monitorInfo.id) : Math.random().toString(36).substring(7),
                labels,
            },
        };

        const baseURL = await Settings.get("primaryBaseURL");
        if (baseURL && monitorInfo) {
            options.client = "Uptime Kuma";
            options.client_url = baseURL + getMonitorRelativeURL(monitorInfo.id);
        }

        let result = await axios.request(options);
        if (result.status == null) {
            throw new Error("FlashDuty notification failed with invalid response!");
        }
        if (result.status < 200 || result.status >= 300) {
            throw new Error("FlashDuty notification failed with status code " + result.status);
        }
        if (result.statusText != null) {
            return "FlashDuty notification succeed: " + result.statusText;
        }

        return successMessage;
    }
}

module.exports = FlashDuty;

View on GitHub (pinned to 6b5ea01557)

Solutions

  1. Map the status: 401/403 → refresh integration key; 400 → validate payload schema against FlashDuty docs; 429 → reduce alert volume; 5xx → FlashDuty-side incident.
  2. Re-copy the integration key from the FlashDuty integration settings.
  3. Confirm the FlashDuty endpoint URL matches the account region.
  4. Validate the alert payload (labels, severity) against the FlashDuty API schema.
Defensive patterns

Strategy: validation

Validate before calling

// Pre-validate integration key + region endpoint
function flashdutyPreflight(notification) {
    if (!notification.flashdutyIntegrationKey) throw new Error('FlashDuty integration key missing');
    try { new URL(notification.flashdutyWebhookUrl); } catch { throw new Error('FlashDuty endpoint URL invalid'); }
}

Type guard

function isFlashdutySuccess(s) { return typeof s === 'number' && s >= 200 && s < 300; }

Try / catch

try { await provider.send(...); }
catch (e) {
    const code = (e.message.match(/(\d+)/) || [])[1];
    if (code === '401' || code === '403') log.error('FlashDuty integration key invalid');
    if (code === '400') log.warn('FlashDuty rejected payload — validate alert schema');
    if (code && +code >= 500) heartbeat.status = PENDING;
}

Prevention

When it happens

Trigger: Integration key wrong/revoked (401/403), payload schema rejected (400), FlashDuty rate limit (429), FlashDuty backend error (5xx), or endpoint URL pointing to the wrong region.

Common situations: FlashDuty integration key regenerated but not updated; payload's event/alert fields malformed by a monitor template change; routing to the wrong FlashDuty region endpoint; FlashDuty incident.

Related errors


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