{"record":{"id":"535f9113ed797e3f","repo":"louislam/uptime-kuma","slug":"per-ping-timeout-must-be-between-ping-per-reques","errorCode":null,"errorMessage":"Per-ping timeout must be between ${PING_PER_REQUEST_TIMEOUT_MIN} and ${PING_PER_REQUEST_TIMEOUT_MAX} seconds (default: ${PING_PER_REQUEST_TIMEOUT_DEFAULT})","messagePattern":"Per-ping timeout must be between (.+?) and (.+?) seconds \\(default: (.+?)\\)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"server/model/monitor.js","lineNumber":1722,"sourceCode":"\n        if (this.type === \"pm2\" && /[\\u0000-\\u001F\\u007F]/.test(this.system_service_name)) {\n            throw new Error(\"Invalid PM2 process name.\");\n        }\n\n        if (this.type === \"ping\") {\n            // ping parameters validation\n            if (this.packetSize && (this.packetSize < PING_PACKET_SIZE_MIN || this.packetSize > PING_PACKET_SIZE_MAX)) {\n                throw new Error(\n                    `Packet size must be between ${PING_PACKET_SIZE_MIN} and ${PING_PACKET_SIZE_MAX} (default: ${PING_PACKET_SIZE_DEFAULT})`\n                );\n            }\n\n            if (\n                this.ping_per_request_timeout &&\n                (this.ping_per_request_timeout < PING_PER_REQUEST_TIMEOUT_MIN ||\n                    this.ping_per_request_timeout > PING_PER_REQUEST_TIMEOUT_MAX)\n            ) {\n                throw new Error(\n                    `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                ) {","sourceCodeStart":1704,"sourceCodeEnd":1740,"githubUrl":"https://github.com/louislam/uptime-kuma/blob/6b5ea0155793e666666745fb8d6fef1e829543a2/server/model/monitor.js#L1704-L1740","documentation":"Thrown by Monitor.validate() for type \"ping\" when ping_per_request_timeout is set and outside [PING_PER_REQUEST_TIMEOUT_MIN=1, PING_PER_REQUEST_TIMEOUT_MAX=60] seconds. This is the per-echo-request (-W) deadline passed to ping, not the global monitor timeout.","triggerScenarios":"Save a ping monitor with ping_per_request_timeout=0.5, =0, =90, or a negative value. Mixing units (entering milliseconds where seconds are expected).","commonSituations":"User confuses the per-ping timeout with the overall monitor timeout and enters the monitor's full timeout (e.g. 300s). Importing a config from a tool that expresses the value in milliseconds. Setting 0 expecting \"no timeout\".","solutions":["Set ping_per_request_timeout to an integer of seconds between 1 and 60, or omit it for the default.","Ensure the value is less than or equal to the monitor's global timeout to avoid logical deadlocks.","Convert any millisecond-based input by dividing by 1000."],"exampleFix":"// before\n{ type: \"ping\", ping_per_request_timeout: 3000 }\n// after\n{ type: \"ping\", ping_per_request_timeout: 3 }","handlingStrategy":"validation","validationCode":"function validPerPingTimeout(v) {\n  const n = Number(v);\n  return !v || (Number.isInteger(n) && n >= 1 && n <= 60);\n}","typeGuard":"function isPerPingTimeout(n) {\n  return n == null || (typeof n === \"number\" && Number.isInteger(n) && n >= 1 && n <= 60);\n}","tryCatchPattern":"try {\n  await bean.validate();\n} catch (e) {\n  if (/Per-ping timeout/.test(e.message)) return badRequest(\"ping_per_request_timeout must be 1..60 seconds\");\n  throw e;\n}","preventionTips":["Document the unit as seconds.","Ensure per-ping timeout <= global timeout in the form."],"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"}