{"record":{"id":"d11f4fc21717ef12","repo":"louislam/uptime-kuma","slug":"slug-is-not-found","errorCode":null,"errorMessage":"slug is not found","messagePattern":"slug is not found","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"server/socket-handlers/status-page-socket-handler.js","lineNumber":41,"sourceCode":"        throw new Error(\"Please input content\");\n    }\n}\n\n/**\n * Socket handlers for status page\n * @param {Socket} socket Socket.io instance to add listeners on\n * @returns {void}\n */\nmodule.exports.statusPageSocketHandler = (socket) => {\n    // Post or edit incident\n    socket.on(\"postIncident\", async (slug, incident, callback) => {\n        try {\n            checkLogin(socket);\n\n            let statusPageID = await StatusPage.slugToID(slug);\n\n            if (!statusPageID) {\n                throw new Error(\"slug is not found\");\n            }\n\n            let incidentBean;\n\n            if (incident.id) {\n                incidentBean = await R.findOne(\"incident\", \" id = ? AND status_page_id = ? \", [\n                    incident.id,\n                    statusPageID,\n                ]);\n            }\n\n            if (incidentBean == null) {\n                incidentBean = R.dispense(\"incident\");\n            }\n\n            incidentBean.title = incident.title;\n            incidentBean.content = incident.content;\n            incidentBean.style = incident.style;","sourceCodeStart":23,"sourceCodeEnd":59,"githubUrl":"https://github.com/louislam/uptime-kuma/blob/6b5ea0155793e666666745fb8d6fef1e829543a2/server/socket-handlers/status-page-socket-handler.js#L23-L59","documentation":"Thrown by the postIncident handler when StatusPage.slugToID(slug) returns a falsy id, meaning no status page row matches the slug. It prevents posting an incident to a non-existent status page and runs before any incident bean is created.","triggerScenarios":"Client emits postIncident with a slug that does not resolve to any status_page row (typo, deleted page, slug not yet created).","commonSituations":"Slug copy/paste error; status page was deleted; frontend keeps a stale slug after navigation; slug case mismatch (slugs are case-sensitive).","solutions":["Use a slug returned by the status page list/getStatusPage endpoints for the current user.","Verify the slug exists before opening the incident composer.","If the page was deleted, recreate it or pick another slug."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const slugs = (await StatusPage.getStatusPageList()).map(p => p.slug);\nif (!slugs.includes(slug)) throw new Error(\"slug is not found\");\nsocket.emit(\"postIncident\", slug, incident, cb);","typeGuard":"function isKnownSlug(slug, known) {\n  return typeof slug === \"string\" && Array.isArray(known) && known.includes(slug);\n}","tryCatchPattern":"try { await emitAsync(\"postIncident\", slug, incident, cb); }\ncatch (e) { if (/slug is not found/.test(e.message)) refreshStatusPages(); else throw e; }","preventionTips":["Pull slug from the status page list endpoint.","Match slug casing exactly (case-sensitive).","Discard slugs from deleted pages."],"tags":["status-page","slug","not-found","socket-io","incident"],"backgroundTag":null,"analyzedSha":"6b5ea0155793e666666745fb8d6fef1e829543a2","analyzedAt":"2026-08-12T23:42:12.959Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}