{"record":{"id":"a2d874f05b7282be","repo":"louislam/uptime-kuma","slug":"flip-up-to-down","errorCode":null,"errorMessage":"Flip UP to DOWN","messagePattern":"Flip UP to DOWN","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"server/model/monitor.js","lineNumber":909,"sourceCode":"                            allowAutoTopicCreation: this.kafkaProducerAllowAutoTopicCreation,\n                            ssl: this.kafkaProducerSsl,\n                            clientId: `Uptime-Kuma/${version}`,\n                            interval: this.interval,\n                            connectionTimeout: this.timeout,\n                        },\n                        JSON.parse(this.kafkaProducerSaslOptions)\n                    );\n                    bean.status = UP;\n                    bean.ping = dayjs().valueOf() - startTime;\n                } else {\n                    throw new Error(\"Unknown Monitor Type\");\n                }\n\n                if (this.isUpsideDown()) {\n                    bean.status = flipStatus(bean.status);\n\n                    if (bean.status === DOWN) {\n                        throw new Error(\"Flip UP to DOWN\");\n                    }\n                }\n\n                retries = 0;\n            } catch (error) {\n                if (error?.name === \"CanceledError\") {\n                    bean.msg = `timeout by AbortSignal (${this.timeout}s)`;\n                } else {\n                    bean.msg = error.message;\n                }\n\n                if (this.getSaveErrorResponse() && error?.response?.data !== undefined) {\n                    await this.saveResponseData(bean, error.response.data);\n                }\n\n                // If UP come in here, it must be upside down mode\n                // Just reset the retries\n                if (this.isUpsideDown() && bean.status === UP) {","sourceCodeStart":891,"sourceCodeEnd":927,"githubUrl":"https://github.com/louislam/uptime-kuma/blob/6b5ea0155793e666666745fb8d6fef1e829543a2/server/model/monitor.js#L891-L927","documentation":"Thrown when a monitor has Upside-Down (invert) enabled and the beat would otherwise be UP: flipStatus turns UP into DOWN, and this error ensures the heartbeat records as DOWN. This is intended behavior, not a defect.","triggerScenarios":"An upside-down monitor receives a successful/UP response from its target.","commonSituations":"Monitoring for an unwanted condition (a maintenance page that should NOT be up, a port that should stay closed). The resulting DOWN is the desired alert.","solutions":["Understand this is by design: disable 'Invert' in the monitor to restore normal UP=good semantics","If the alert is unexpected, the target reached a state you did not anticipate — investigate the target itself"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// This is by-design behavior when invert is on; disable it if normal semantics are wanted\nif (!wantInverted) monitor.upsideDown = false;","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only enable Upside-Down when you genuinely want to alert on an UP target","Document inverted monitors clearly so the DOWN heartbeat is not mistaken for a real failure"],"tags":["upside-down","monitoring","by-design"],"backgroundTag":null,"analyzedSha":"6b5ea0155793e666666745fb8d6fef1e829543a2","analyzedAt":"2026-08-12T23:42:12.959Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}