louislam/uptime-kuma · error · Error
Monitor not found or not active.
Error message
Monitor not found or not active.
What it means
Thrown by the push endpoint when no `monitor` row matches the supplied `pushToken` AND `active = 1`. The token must correspond to an enabled push-type monitor. Returned to the caller as HTTP 404 with `{ok:false, msg}`.
Source
Thrown at server/routers/api-router.js:65
router.all("/api/push/:pushToken", async (request, response) => {
try {
let pushToken = request.params.pushToken;
let msg = request.query.msg || "OK";
let ping = parseFloat(request.query.ping) || null;
let statusString = request.query.status || "up";
const statusFromParam = statusString === "up" ? UP : DOWN;
// Validate ping value - max 100 billion ms (~3.17 years)
// Fits safely in both BIGINT and FLOAT(20,2)
const MAX_PING_MS = 100000000000;
if (ping !== null && (ping < 0 || ping > MAX_PING_MS)) {
throw new Error(`Invalid ping value. Must be between 0 and ${MAX_PING_MS} ms.`);
}
let monitor = await R.findOne("monitor", " push_token = ? AND active = 1 ", [pushToken]);
if (!monitor) {
throw new Error("Monitor not found or not active.");
}
const previousHeartbeat = await Monitor.getPreviousHeartbeat(monitor.id);
let isFirstBeat = true;
let bean = R.dispense("heartbeat");
bean.time = R.isoDateTimeMillis(dayjs.utc());
bean.monitor_id = monitor.id;
bean.ping = ping;
bean.msg = msg;
bean.downCount = previousHeartbeat?.downCount || 0;
if (previousHeartbeat) {
isFirstBeat = false;
bean.duration = dayjs(bean.time).diff(dayjs(previousHeartbeat.time), "second");
}
View on GitHub (pinned to 6b5ea01557)
Solutions
- Re-copy the push URL from the monitor's settings in the UI and verify the token segment matches exactly.
- Confirm the monitor exists and is active (not paused) in the dashboard.
- Ensure the push script targets the correct Uptime Kuma instance/host.
- If the monitor was deleted, recreate it and update the agent with the new token.
Example fix
// before
fetch(`${base}/api/push/${oldToken}?status=up`)
// after
// copy the full push URL from Monitor -> Settings -> Push URL, e.g.
fetch(`${base}/api/push/${currentToken}?status=up&msg=OK&ping=${pingMs}`) Defensive patterns
Strategy: fallback
Validate before calling
// Confirm the token maps to an active monitor before relying on it
const m = await R.findOne('monitor', ' push_token = ? AND active = 1 ', [token]);
if (!m) { log.warn('push token invalid/inactive'); return; } Type guard
function looksLikePushToken(token) {
return typeof token === 'string' && token.length > 0 && /^[A-Za-z0-9_-]+$/.test(token);
} Prevention
- Copy the push URL verbatim from the monitor's settings page.
- Keep the monitor active (not paused) while pushing.
- Point the push script at the correct Uptime Kuma host.
- After deleting/recreating a monitor, update the agent with the new token.
When it happens
Trigger: Calling /api/push/<token> with a wrong/typo'd token, a token for a monitor that was paused (active=0) or deleted, or a token copied from a different Uptime Kuma instance.
Common situations: Monitor was paused or disabled; monitor deleted and the push script still runs; token regenerated after a monitor edit; pointing the push agent at the wrong server/host.
Related errors
- docker host not found
- notification not found
- proxy not found
- Remote browser not found
- Remote Browser not found
AI-assisted analysis of louislam/uptime-kuma@6b5ea01557 (2026-08-12).
Data as JSON: /api/errors/51e095ae6adc8086.
Report an issue: GitHub.