Skip to content

Bug: Out of range value for column 'ping_max' at row 1Β #6472

@fabianoengler

Description

@fabianoengler

πŸ“‘ I have found these related issues/pull requests

(Didn't find anything similar/related)

πŸ›‘οΈ Security Policy

πŸ“ Description

One of my push monitors is returning started to return http 404 status out of nowhere, very odd at first because it was working fine and the token didn't change.

Upon investigating the issue, I found that if a ping is larger than 1 million milliseconds (~16.7 minutes) it raises an exception and "corrupts" the data, the monitor doesn't work anymore after that, even with smaller pings.

I have an hourly job and the ping passed is the runtime of the job, it's been under this ~16.7 minutes so far but if one of the job runs takes more than that, it screws the monitor and all pushes after that fails with 404 error.

Estrange behavior: After a bad large ping, the push requests all fail with 404 http error, I do receive an alarm notification but if log in to the dashboard, all the pushes for that monitor are green, there is no errors there.

If I am reading this correctly: the individual ping is stored successful in one table but it fails to update the stat_daily table, to fail alarm gets triggered but on that dashboard all bars are green and there is no failed monitor.

As for the 404, I believe that is the inappropriate status code, since it seems to cause an unhandled exception, I would expect a 500 error. If the 1m value is defined as invalid by the contract, it should trigger a validation error that returns a 400 error (not the 404 Not Found).

But I see no reason for it not to accept larger values, the column type is float and the float type (single precision) on MariaDB can store up to 3.402823466E+38, so it seems an artificial limitation. Also, the fact that individual push insertion works and the daily stat update fails suggest a bug in the code handling this case.

I'm using the latest docker image: louislam/uptime-kuma:2.0.2

Full container logs attached bellow, but the meat of it is::

Trace: Error: update `stat_daily` set `up` = 10, `down` = 24, `ping` = 444445.66666666674, `ping_min` = 1, `ping_max` = 1000000 where `id` = 6182 - Out of range value for column 'ping_max' at row 1
    (...)
    at addChunk (node:internal/streams/readable:561:12)
    at readableAddChunkPushByteMode (node:internal/streams/readable:512:3)
    at Readable.push (node:internal/streams/readable:392:5) {
  code: 'ER_WARN_DATA_OUT_OF_RANGE',
  errno: 1264,
  sqlState: '22003',
  sqlMessage: "Out of range value for column 'ping_max' at row 1",
  sql: 'update `stat_daily` set `up` = 10, `down` = 24, `ping` = 444445.66666666674, `ping_min` = 1, `ping_max` = 1000000 where `id` = 6182'
}
    at Timeout.safeBeat [as _onTimeout] (/app/server/model/monitor.js:1021:25)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

πŸ‘Ÿ Reproduction steps

To reproduce, just create a new push monitor and send a ping value of 1,000,000 ms or larger, after that the monitor doesn't work anymore regardless of the ping value:

fabiano@mybox:~$   ## little helper function to push to kuma with curl
fabiano@mybox:~$   ## and display the http status code of the response:
fabiano@mybox:~$ kuma_push() { curl -s -w "\nHTTP Status: %{http_code}\n" "${PUSH_URL:?}${1:-}" ; }
fabiano@mybox:~$   ## copy the push url from the dashboard:
fabiano@mybox:~$ PUSH_URL="https://uptime.mydomain.example.com/api/push/G71s7K07bCVru7xcxI65BJ31kLHwH3G2?status=up&msg=OK&ping="
fabiano@mybox:~$   ## push with ping = 1ms:
fabiano@mybox:~$ kuma_push 1
{"ok":true}
HTTP Status: 200
fabiano@mybox:~$ kuma_push 1
{"ok":true}
HTTP Status: 200
fabiano@mybox:~$   ## still works with 999,999ms
fabiano@mybox:~$ kuma_push 999999
{"ok":true}
HTTP Status: 200
fabiano@mybox:~$ kuma_push 999999
{"ok":true}
HTTP Status: 200
fabiano@mybox:~$ kuma_push 999999
{"ok":true}
HTTP Status: 200
fabiano@mybox:~$   ## failure point seems to be 1mm:
fabiano@mybox:~$ kuma_push 1000000
{"ok":false,"msg":"update `stat_daily` set `up` = 6, `down` = 0, `ping` = 666666.5, `ping_min` = 1, `ping_max` = 1000000 where `id` = 6182 - Out of range value for column 'ping_max' at row 1"}
HTTP Status: 404
fabiano@mybox:~$   ## after a failure, no ping value works anymore:
fabiano@mybox:~$ kuma_push 1
{"ok":false,"msg":"update `stat_daily` set `up` = 7, `down` = 0, `ping` = 571428.5714285715, `ping_min` = 1, `ping_max` = 1000000 where `id` = 6182 - Out of range value for column 'ping_max' at row 1"}
HTTP Status: 404
fabiano@mybox:~$ kuma_push 1
{"ok":false,"msg":"update `stat_daily` set `up` = 8, `down` = 0, `ping` = 500000.12500000006, `ping_min` = 1, `ping_max` = 1000000 where `id` = 6182 - Out of range value for column 'ping_max' at row 1"}
HTTP Status: 404
fabiano@mybox:~$ kuma_push 10
{"ok":false,"msg":"update `stat_daily` set `up` = 9, `down` = 0, `ping` = 444445.66666666674, `ping_min` = 1, `ping_max` = 1000000 where `id` = 6182 - Out of range value for column 'ping_max' at row 1"}
HTTP Status: 404
fabiano@mybox:~$

πŸ‘€ Expected behavior

I expect it to work and return a 200 http status code ;)

πŸ˜“ Actual Behavior

Push fails with 404 http status code.

🐻 Uptime-Kuma Version

2.0.2

πŸ’» Operating System and Arch

Ubuntu 22.04 LTS x86_64

🌐 Browser

curl 7.81.0 (x86_64-pc-linux-gnu) libcurl/7.81.0 OpenSSL/3.0.2 zlib/1.2.11 brotli/1.0.9 zstd/1.4.8 libidn2/2.3.2 libpsl/0.21.0 (+libidn2/2.3.2) libssh/0.9.6/openssl/zlib nghttp2/1.43.0 librtmp/2.3 OpenLDAP/2.5.13

πŸ–₯️ Deployment Environment

  • Runtime Environment:
    Client: Docker Engine - Community
    Version: 27.3.1
    Context: default
    Debug Mode: false
    Plugins:
    buildx: Docker Buildx (Docker Inc.)
    Version: v0.17.1
    compose: Docker Compose (Docker Inc.)
    Version: v2.31.0
    Runtimes: io.containerd.runc.v2 runc
    Default Runtime: runc
    Init Binary: docker-init
    containerd version: 88bf19b2105c8b17560993bee28a01ddc2f97182
    runc version: v1.2.2-0-g7cb3632
    init version: de40ad0
    Kernel Version: 5.15.0-126-generic
    Operating System: Ubuntu 22.04.5 LTS
    OSType: linux
    Architecture: x86_64
    CPUs: 1
    Total Memory: 957.4MiB

πŸ“ Relevant log output

2025-12-09T17:50:44.552028277Z 2025-12-09T14:50:44-03:00 [MONITOR] WARN: Monitor #65 'Test Push': Failing: No heartbeat in the time window | Interval: 60 seconds | Type: push | Down Count: 0 | Resend Interval: 0
2025-12-09T17:50:44.558735862Z Trace: Error: update `stat_daily` set `up` = 10, `down` = 24, `ping` = 444445.66666666674, `ping_min` = 1, `ping_max` = 1000000 where `id` = 6182 - Out of range value for column 'ping_max' at row 1
2025-12-09T17:50:44.558777971Z     at Packet.asError (/app/node_modules/mysql2/lib/packets/packet.js:740:17)
2025-12-09T17:50:44.558782009Z     at Query.execute (/app/node_modules/mysql2/lib/commands/command.js:29:26)
2025-12-09T17:50:44.558784937Z     at Connection.handlePacket (/app/node_modules/mysql2/lib/base/connection.js:475:34)
2025-12-09T17:50:44.558788988Z     at PacketParser.onPacket (/app/node_modules/mysql2/lib/base/connection.js:93:12)
2025-12-09T17:50:44.558809757Z     at PacketParser.executeStart (/app/node_modules/mysql2/lib/packet_parser.js:75:16)
2025-12-09T17:50:44.558813503Z     at Socket.<anonymous> (/app/node_modules/mysql2/lib/base/connection.js:100:25)
2025-12-09T17:50:44.558816989Z     at Socket.emit (node:events:524:28)
2025-12-09T17:50:44.558819593Z     at addChunk (node:internal/streams/readable:561:12)
2025-12-09T17:50:44.558822327Z     at readableAddChunkPushByteMode (node:internal/streams/readable:512:3)
2025-12-09T17:50:44.558825601Z     at Readable.push (node:internal/streams/readable:392:5) {
2025-12-09T17:50:44.558829628Z   code: 'ER_WARN_DATA_OUT_OF_RANGE',
2025-12-09T17:50:44.558833418Z   errno: 1264,
2025-12-09T17:50:44.558837198Z   sqlState: '22003',
2025-12-09T17:50:44.558841131Z   sqlMessage: "Out of range value for column 'ping_max' at row 1",
2025-12-09T17:50:44.558845189Z   sql: 'update `stat_daily` set `up` = 10, `down` = 24, `ping` = 444445.66666666674, `ping_min` = 1, `ping_max` = 1000000 where `id` = 6182'
2025-12-09T17:50:44.558849790Z }
2025-12-09T17:50:44.558853870Z     at Timeout.safeBeat [as _onTimeout] (/app/server/model/monitor.js:1021:25)
2025-12-09T17:50:44.558858446Z     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
2025-12-09T17:50:44.560653939Z 2025-12-09T14:50:44-03:00 [MONITOR] ERROR: Please report to https://github.com/louislam/uptime-kuma/issues
2025-12-09T17:50:44.565195769Z 2025-12-09T14:50:44-03:00 [MONITOR] INFO: Try to restart the monitor

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions