mirror of
https://github.com/louislam/uptime-kuma.git
synced 2026-03-02 22:57:00 -05:00
[Ping] fails if you choose a ping paket size below 16 bytes #2471
Labels
No labels
A:accessibility
A:api
A:cert-expiry
A:core
A:dashboard
A:deployment
A:documentation
A:domain expiry
A:incidents
A:maintenance
A:metrics
A:monitor
A:notifications
A:reports
A:settings
A:status-page
A:ui/ux
A:user-management
Stale
ai-slop
blocked
blocked-upstream
bug
cannot-reproduce
dependencies
discussion
duplicate
feature-request
feature-request
good first issue
hacktoberfest
help
help wanted
house keeping
invalid
invalid-format
invalid-format
question
releaseblocker 🚨
security
spam
type:enhance-existing
type:new
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/uptime-kuma#2471
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @GoodSoulGermany on GitHub (Aug 14, 2023).
⚠️ Please verify that this bug has NOT been raised before.
🛡️ Security Policy
Description
When I set the ping paketsize below 16 bytes pinging fails and shows host offline.
👟 Reproduction steps
Set ping paketsize below 16 bytes.
👀 Expected behavior
A ping paketsize of 1 byte should work.
😓 Actual Behavior
Ping fails, shows host "offline" with the next ping.
When you use 16 bytes for ping it works. Below that number it will always 100% fails.
Why can I go below 16 bytes when Uptime Kuma can handle it?
Why can't Uptime Kuma handle bytes below 16 byte?
https://github.com/louislam/uptime-kuma/assets/4119560/b4e1f0cb-4b00-4164-9709-bffaa5600da1
🐻 Uptime-Kuma Version
1.21.1
💻 Operating System and Arch
Ubuntu 22.10
🌐 Browser
Chrome, Firefox, Edge, Vivaldi, Opera One - ANY browser
🐋 Docker Version
Docker version 20.10.21, build 20.10.21-0ubuntu1~22.10.2
🟩 NodeJS Version
Unknown (build in Docker)
📝 Relevant log output
@louislam commented on GitHub (Aug 14, 2023):
Did some research on this.
The message is actually a successful message.

Now I try to compare the ping result.
Raw ping command test:
56-byte's output (
ping -c 1 rs-debian):1-byte's output (
ping -c 1 -s 1 rs-debian):There is no time info in the 1-byte's output. According to https://docstore.mik.ua/manuals/hp-ux/en/B2355-60130/ping.1M.html:
So I think it maybe a parsing issue of
node-ping.https://github.com/louislam/node-ping/blob/master/lib/parser/linux.js
I think the better handling should be, returning the successful result, but with -1/undefined ping time value when <16 package size.
@chakflying commented on GitHub (Aug 14, 2023):
Or just set a minimum value of 16 bytes. I think very few people know this (I didn't) and it would be equally confusing for people to set it to 1 byte and don't understand why the ping value is broken.
@louislam commented on GitHub (Aug 15, 2023):
The weird thing is the 16-byte limit doesn't apply to Windows.
@chakflying commented on GitHub (Aug 16, 2023):
I checked with Wireshark and the packet looks the same as on Linux. I think the only difference for a larger packet is that the "Timestamp" and "Timestamp Reply" fields are included, which can be used to eliminate the server processing time from the calculated ping. But servers may not implement these fields anyway because of security reasons.
@neelbhanushali commented on GitHub (Feb 12, 2024):
@louislam @CommanderStorm
Should I go ahead with implementing a minimum limit of 16 bytes on frontend as mentioned here
Or modify node-ping?
@CommanderStorm commented on GitHub (Feb 12, 2024):
Given that "fixing it in the dependency" would essentially return invalid ping results
=> be confusing to our users
I think setting a minimum value on our side is a better choice.
Ignoring that this error is platform dependent1 and adding an help text (
the minimum of 16 packets is an upstream limitation of ping and exists to make sure that the results are statistically significant) seems like a good choice.Cc @chakflying for a second opinion
I don't fully see a reason why lowering this parameter this far is better, but maybe @GoodSoulGermany has one ↩︎
@chakflying commented on GitHub (Feb 14, 2024):
Authoritarian Approach:
Non-authoritarian Approach:
node-pingsuch that it would not fail to parse if the time value is not present. Just return null for the ping for display.Both are fine by me. Note that for the help text, I don't think it has anything to do with statistical significance. If I were to write it it would just be "packet size < 16 does not produce round-trip times on Linux".