louislam/uptime-kuma · error · Error
Per-ping timeout must be between ${PING_PER_REQUEST_TIMEOUT_
Error message
Per-ping timeout must be between ${PING_PER_REQUEST_TIMEOUT_MIN} and ${PING_PER_REQUEST_TIMEOUT_MAX} seconds (default: ${PING_PER_REQUEST_TIMEOUT_DEFAULT}) What it means
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.
Source
Thrown at server/model/monitor.js:1722
if (this.type === "pm2" && /[\u0000-\u001F\u007F]/.test(this.system_service_name)) {
throw new Error("Invalid PM2 process name.");
}
if (this.type === "ping") {
// ping parameters validation
if (this.packetSize && (this.packetSize < PING_PACKET_SIZE_MIN || this.packetSize > PING_PACKET_SIZE_MAX)) {
throw new Error(
`Packet size must be between ${PING_PACKET_SIZE_MIN} and ${PING_PACKET_SIZE_MAX} (default: ${PING_PACKET_SIZE_DEFAULT})`
);
}
if (
this.ping_per_request_timeout &&
(this.ping_per_request_timeout < PING_PER_REQUEST_TIMEOUT_MIN ||
this.ping_per_request_timeout > PING_PER_REQUEST_TIMEOUT_MAX)
) {
throw new Error(
`Per-ping timeout must be between ${PING_PER_REQUEST_TIMEOUT_MIN} and ${PING_PER_REQUEST_TIMEOUT_MAX} seconds (default: ${PING_PER_REQUEST_TIMEOUT_DEFAULT})`
);
}
if (this.ping_count && (this.ping_count < PING_COUNT_MIN || this.ping_count > PING_COUNT_MAX)) {
throw new Error(
`Echo requests count must be between ${PING_COUNT_MIN} and ${PING_COUNT_MAX} (default: ${PING_COUNT_DEFAULT})`
);
}
if (this.timeout) {
const pingGlobalTimeout = Math.round(Number(this.timeout));
if (
pingGlobalTimeout < this.ping_per_request_timeout ||
pingGlobalTimeout < PING_GLOBAL_TIMEOUT_MIN ||
pingGlobalTimeout > PING_GLOBAL_TIMEOUT_MAX
) {View on GitHub (pinned to 6b5ea01557)
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.
Example fix
// before
{ type: "ping", ping_per_request_timeout: 3000 }
// after
{ type: "ping", ping_per_request_timeout: 3 } Defensive patterns
Strategy: validation
Validate before calling
function validPerPingTimeout(v) {
const n = Number(v);
return !v || (Number.isInteger(n) && n >= 1 && n <= 60);
} Type guard
function isPerPingTimeout(n) {
return n == null || (typeof n === "number" && Number.isInteger(n) && n >= 1 && n <= 60);
} Try / catch
try {
await bean.validate();
} catch (e) {
if (/Per-ping timeout/.test(e.message)) return badRequest("ping_per_request_timeout must be 1..60 seconds");
throw e;
} Prevention
- Document the unit as seconds.
- Ensure per-ping timeout <= global timeout in the form.
When it happens
Trigger: 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).
Common situations: 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".
Understand the failure class
- Timeouts: ETIMEDOUT, deadlines, and hung requests — what actually expires when a request times out.
Related errors
- Timeout must be between ${PING_GLOBAL_TIMEOUT_MIN} and ${PIN
- Packet size must be between ${PING_PACKET_SIZE_MIN} and ${PI
- Echo requests count must be between ${PING_COUNT_MIN} and ${
- Screenshot delay must be less than ${maxDelayFromTimeout}ms
- Screenshot delay must be less than ${maxDelayFromInterval}ms
AI-assisted analysis of louislam/uptime-kuma@6b5ea01557 (2026-08-12).
Data as JSON: /api/errors/535f9113ed797e3f.
Report an issue: GitHub.