{"record":{"id":"186501db8f3c5251","repo":"louislam/uptime-kuma","slug":"flashduty-notification-failed-with-status-code-r","errorCode":null,"errorMessage":"FlashDuty notification failed with status code ${result.status}","messagePattern":"FlashDuty notification failed with status code (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"server/notification-providers/flashduty.js","lineNumber":107,"sourceCode":"                title,\n                event_status: eventStatus || \"Info\",\n                alert_key: monitorInfo.id ? String(monitorInfo.id) : Math.random().toString(36).substring(7),\n                labels,\n            },\n        };\n\n        const baseURL = await Settings.get(\"primaryBaseURL\");\n        if (baseURL && monitorInfo) {\n            options.client = \"Uptime Kuma\";\n            options.client_url = baseURL + getMonitorRelativeURL(monitorInfo.id);\n        }\n\n        let result = await axios.request(options);\n        if (result.status == null) {\n            throw new Error(\"FlashDuty notification failed with invalid response!\");\n        }\n        if (result.status < 200 || result.status >= 300) {\n            throw new Error(\"FlashDuty notification failed with status code \" + result.status);\n        }\n        if (result.statusText != null) {\n            return \"FlashDuty notification succeed: \" + result.statusText;\n        }\n\n        return successMessage;\n    }\n}\n\nmodule.exports = FlashDuty;\n","sourceCodeStart":89,"sourceCodeEnd":118,"githubUrl":"https://github.com/louislam/uptime-kuma/blob/6b5ea0155793e666666745fb8d6fef1e829543a2/server/notification-providers/flashduty.js#L89-L118","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Map the status: 401/403 → refresh integration key; 400 → validate payload schema against FlashDuty docs; 429 → reduce alert volume; 5xx → FlashDuty-side incident.","Re-copy the integration key from the FlashDuty integration settings.","Confirm the FlashDuty endpoint URL matches the account region.","Validate the alert payload (labels, severity) against the FlashDuty API schema."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Pre-validate integration key + region endpoint\nfunction flashdutyPreflight(notification) {\n    if (!notification.flashdutyIntegrationKey) throw new Error('FlashDuty integration key missing');\n    try { new URL(notification.flashdutyWebhookUrl); } catch { throw new Error('FlashDuty endpoint URL invalid'); }\n}","typeGuard":"function isFlashdutySuccess(s) { return typeof s === 'number' && s >= 200 && s < 300; }","tryCatchPattern":"try { await provider.send(...); }\ncatch (e) {\n    const code = (e.message.match(/(\\d+)/) || [])[1];\n    if (code === '401' || code === '403') log.error('FlashDuty integration key invalid');\n    if (code === '400') log.warn('FlashDuty rejected payload — validate alert schema');\n    if (code && +code >= 500) heartbeat.status = PENDING;\n}","preventionTips":["Treat integration key rotation as part of the key-management runbook.","Match the endpoint URL to the correct FlashDuty region."],"tags":["notification","flashduty","http","status-code","incident-management"],"backgroundTag":null,"analyzedSha":"6b5ea0155793e666666745fb8d6fef1e829543a2","analyzedAt":"2026-08-12T23:42:12.959Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}