{"record":{"id":"da7c2d86815c0678","repo":"louislam/uptime-kuma","slug":"timeout-must-be-between-ping-global-timeout-min","errorCode":null,"errorMessage":"Timeout must be between ${PING_GLOBAL_TIMEOUT_MIN} and ${PING_GLOBAL_TIMEOUT_MAX} seconds (default: ${PING_GLOBAL_TIMEOUT_DEFAULT})","messagePattern":"Timeout must be between (.+?) and (.+?) seconds \\(default: (.+?)\\)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"server/model/monitor.js","lineNumber":1741,"sourceCode":"                    `Per-ping timeout must be between ${PING_PER_REQUEST_TIMEOUT_MIN} and ${PING_PER_REQUEST_TIMEOUT_MAX} seconds (default: ${PING_PER_REQUEST_TIMEOUT_DEFAULT})`\n                );\n            }\n\n            if (this.ping_count && (this.ping_count < PING_COUNT_MIN || this.ping_count > PING_COUNT_MAX)) {\n                throw new Error(\n                    `Echo requests count must be between ${PING_COUNT_MIN} and ${PING_COUNT_MAX} (default: ${PING_COUNT_DEFAULT})`\n                );\n            }\n\n            if (this.timeout) {\n                const pingGlobalTimeout = Math.round(Number(this.timeout));\n\n                if (\n                    pingGlobalTimeout < this.ping_per_request_timeout ||\n                    pingGlobalTimeout < PING_GLOBAL_TIMEOUT_MIN ||\n                    pingGlobalTimeout > PING_GLOBAL_TIMEOUT_MAX\n                ) {\n                    throw new Error(\n                        `Timeout must be between ${PING_GLOBAL_TIMEOUT_MIN} and ${PING_GLOBAL_TIMEOUT_MAX} seconds (default: ${PING_GLOBAL_TIMEOUT_DEFAULT})`\n                    );\n                }\n\n                this.timeout = pingGlobalTimeout;\n            }\n        }\n\n        if (this.type === \"real-browser\") {\n            // screenshot_delay validation\n            if (this.screenshot_delay !== undefined && this.screenshot_delay !== null) {\n                const delay = Number(this.screenshot_delay);\n                if (isNaN(delay) || delay < 0) {\n                    throw new Error(\"Screenshot delay must be a non-negative number\");\n                }\n\n                // Must not exceed 0.8 * timeout (page.goto timeout is interval * 1000 * 0.8)\n                const maxDelayFromTimeout = this.interval * 1000 * 0.8;","sourceCodeStart":1723,"sourceCodeEnd":1759,"githubUrl":"https://github.com/louislam/uptime-kuma/blob/6b5ea0155793e666666745fb8d6fef1e829543a2/server/model/monitor.js#L1723-L1759","documentation":"Thrown by Monitor.validate() for type \"ping\" when the global timeout (this.timeout, rounded) is less than ping_per_request_timeout, less than PING_GLOBAL_TIMEOUT_MIN=1, or greater than PING_GLOBAL_TIMEOUT_MAX=300 seconds. The first condition guarantees the overall deadline can fit at least one per-request deadline.","triggerScenarios":"Save a ping monitor with timeout=0, timeout=400, or a valid timeout (e.g. 2) that is smaller than ping_per_request_timeout (e.g. 5). Math.round(Number(this.timeout)) means fractional seconds are accepted but coerced.","commonSituations":"Setting a short global timeout while leaving a large per-ping timeout (logical impossibility). Inheriting a 60s default timeout then raising ping_per_request_timeout above it. Cluster-wide config templates that set timeout in milliseconds.","solutions":["Set timeout to an integer of seconds between 1 and 300 that is >= ping_per_request_timeout.","If you want a tight check, lower ping_per_request_timeout proportionally rather than only lowering timeout.","Omit timeout to use PING_GLOBAL_TIMEOUT_DEFAULT when you do not need a custom deadline."],"exampleFix":"// before\n{ type: \"ping\", timeout: 2, ping_per_request_timeout: 5 }\n// after\n{ type: \"ping\", timeout: 10, ping_per_request_timeout: 5 }","handlingStrategy":"validation","validationCode":"function validPingGlobalTimeout(timeout, perRequest) {\n  const t = Math.round(Number(timeout));\n  return t >= 1 && t <= 300 && t >= Number(perRequest || 0);\n}","typeGuard":"function isPingTimeoutCombo(timeout, perRequest) {\n  const t = Math.round(Number(timeout));\n  return Number.isInteger(t) && t >= 1 && t <= 300 && t >= (Number(perRequest) || 0);\n}","tryCatchPattern":"try {\n  await bean.validate();\n} catch (e) {\n  if (/Timeout must be between/.test(e.message)) return badRequest(\"global timeout must be 1..300s and >= per-ping timeout\");\n  throw e;\n}","preventionTips":["Keep global timeout >= per-ping timeout when editing either field.","Express both fields in the same unit (seconds)."],"tags":["monitor","ping","validation","timeout","uptime-kuma"],"backgroundTag":null,"analyzedSha":"6b5ea0155793e666666745fb8d6fef1e829543a2","analyzedAt":"2026-08-12T23:42:12.959Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}