mirror of
https://github.com/louislam/uptime-kuma.git
synced 2026-03-02 22:57:00 -05:00
Version 1.7.0 breaks ping for local devices #274
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#274
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 @raspberrycoulis on GitHub (Sep 26, 2021).
Describe the bug
After updating to version 1.7.0, all my ping monitors for local devices are broken. Prior to v1.7.0 these worked just fine - for example:
Monitor type: Ping
Hostname: local IP address - i.e. 192.168.1.21
The above worked just fine before updating to v1.7.0, but now they're all borked.
To fix, I have to change to:
Monitor type: TCP Port
Hostname: local IP address - i.e. 192.168.1.21
Port: 80 (for example, I'm running Pi-Hole on the above local IP address so port 80 is the web UI).
Expected behavior
The pings should work still as nothing has changed. Testing manually via a terminal (i.e.
ping 192.168.1.21 -c 10works as expected. The expected behaviour is that the ping monitor should "just work".Info
Uptime Kuma Version: 1.7.0
Using Docker?: Yes
Docker Version: 20.10.3 build b35e731
OS: Synology DSM
Browser: Brave / Chrome
Error Log
"Device name": Failing: ping: socket: Operation not permitted@louislam commented on GitHub (Sep 26, 2021):
Did you turn off NET_RAW?
Maybe related issue:
https://github.com/louislam/uptime-kuma/issues/373
@raspberrycoulis commented on GitHub (Sep 27, 2021):
It was never set specifically in my Docker Compose file anyway. I've just added it and recreated the container, but still doesn't work.
To be clear, everything worked perfectly before I upgraded to v1.7.0. I made zero changes to my Docker Compose file. I simply ran
docker-compose pullthendocker-compose up -dto update and recreate the container.This is my Docker Compose file for Uptime Kuma for reference (I've included the
NET_RAWas this is currently what my current config looks like as per your suggestion):Some notes:
.envfile and works fine for me@gaby commented on GitHub (Sep 27, 2021):
@louislam I think this is happening because of the changes in #436
@louislam commented on GitHub (Sep 27, 2021):
As I cannot reproduce the problem, I am not 100% sure.
I suggest @raspberrycoulis should try
louislam/uptime-kuma:1-alpine.@raspberrycoulis commented on GitHub (Sep 27, 2021):
This fixes the issue @louislam - as in, the local pings work again.
@nbvcxz commented on GitHub (Sep 27, 2021):
@raspberrycoulis - could you paste the full
docker-compose.yml? Here I can see only the service part, but to reproduce it, I'd like to have the same Docker network definitions. So far, I cannot reproduce it on Uptime Kuma 1.7.0 Debian - I'm pinging host IP eth0 (I guess this is what you mean local IP address) with no issues: 0ms response (as expected).@raspberrycoulis commented on GitHub (Sep 27, 2021):
@nbvcxz I would, but it's a relatively large file that also handles other services like Sonarr, Radarr, NZBGet etc., so I've simply provided the relevant parts for the Uptime Kuma container. I'll add as much as I can that will be relevant.
And from my
.envfile:So with those combined, this is what you would expect from the
docker-compose.ymlfile:NOTE: The file above is now using the
1-alpineimage as recommended by @louislam earlier.@nbvcxz commented on GitHub (Sep 27, 2021):
Few more questions:
3.5or2.x? I got:What is according the documentation: these parameters are from
2.xnot from3.xcompose. btw. they are working with e.g. 2.4 compose2. Is
ip_range: 127.20.0.1/24a typo? (127→172)I still cannot reproduce it on Debian image. It can be caused by host OS settings. If it still persists, could you make the following tests:
docker exec -it --user 1000:1000 uptime-kuma /bin/bash -c "ping 192.168.1.21"I assume you are running default 1000:1000 userdocker exec -it --user uptime-kuma /bin/bash -c "ping 192.168.1.21"It will run ping as root from the containerIt will run Uptime Kuma as root user (as before).
@louislam commented on GitHub (Sep 27, 2021):
I think it is related to #373. The symptoms are very similar.
As Alpine is still working, it is probably not related to the user problem.
I suspect that it could be Synology DSM's Docker which disabled many Capability Keys by default.
@raspberrycoulis commented on GitHub (Sep 28, 2021):
Yeah sorry @nbvcxz, that is quite a lot of info to ask for when I've already tried to explain that I've changed absolutely nothing other than update the image to v1.7.0... As I said, everything worked fine as per the compose file I've shared previously, but then the pings just stopped working after updating to v1.7.0.
Switching to the
1-alpinetag reverted the issue, which @louislam seems to think is related to the issue. I'll try running the container as root on the latest image, to see if this helps.@raspberrycoulis commented on GitHub (Sep 28, 2021):
Update: @louislam / @nbvcxz - running as root on the latest image resolves the issue, so definitely a permissions issue.
I'm using a compose file with version 3.5, so the parameters are:
Hope this helps!
@louislam commented on GitHub (Sep 28, 2021):
Thanks for testing. With this, it is a bit different to the #373 issue.
I hope this is not a common issue, I still don't know how to reproduce this.
@elkaboing commented on GitHub (Sep 28, 2021):
I ran into the same issue. Updated my docker container this afternoon and when I brought the service back up, all my local pings were failing with
Adding the root privileges to the environment section fixed the issue.
Here's my current docker-compose file (after adding PUID=0 and PGID=0) which is working as expected:
@louislam commented on GitHub (Sep 29, 2021):
May consider to change the default user back to
root.@louislam commented on GitHub (Sep 29, 2021):
Fixed in 1.7.1.
Will try to find out how to reproduce the problem.
@aniqueta commented on GitHub (Jan 11, 2023):
@louislam I'm experiencing this issue now in 1.94.1. I did not experience this in prior versions. The last version I was on was before 1.7 (unfortunately, I did not note it, as I've not had problems before).
I receive the following error:
The environment is running uptime-kuma on Ubuntu 22.04.1 without Docker, but as its own user through systemd.
I am able to use the ping command via that user, so I don't believe there's a permissions or path issue.
Appreciate any help troubleshooting. Thanks.
@louislam commented on GitHub (Jan 11, 2023):
@aniqueta We changed the ping library in 1.19.4. Can you try 1.19.3?
cc: @Computroniks
Related issue: https://github.com/danielzzz/node-ping/issues/105
@louislam commented on GitHub (Jan 11, 2023):
Just my guess:
For systemd, environment path is not added by default. So Uptime Kuma cannot find the ping command.
https://askubuntu.com/questions/1014480/how-do-i-add-bin-to-path-for-a-systemd-service
If it is true, that is why the old implementation is hardcoded the full path of ping
/bin/ping. (https://github.com/louislam/uptime-kuma/issues/2126)@Computroniks commented on GitHub (Jan 11, 2023):
Not sure it is a path issue. Pm2 seems to inject the current environment of the user when starting the process https://pm2.keymetrics.io/docs/usage/environment/. The error message is just a message shown on any general ping error where there was an issue with the module using the ping binary.
Edit, just realised that you are using systemd on its own without pm2, in which case as @louislam says, you will need to edit the system file to include the environment. I am interested, why not just use pm2?
@Computroniks commented on GitHub (Jan 11, 2023):
Given that you say you have created another account, it might be a permissions error. Try running the process as your normal account and see if it works then.
@aniqueta commented on GitHub (Jan 11, 2023):
Thanks for the super fast replies.
Downgrading to 1.19.3 resolved the issue.
The $PATH variable had been already set correctly in the systemd service file.
I'm able to run the ping commend from command line correctly as the specified user and running as a normal user still produced the ping error.
I didn't use pm2, since a) this is a low memory deployment (512MB), and while it didn't take much more memory, it was enough that I got OOM errors when running apt upgrade for example, and b) I don't have a need to use pm2 for other services, so it would hinder consistency and familiarity of tools across my services. It wasn't difficult at all to use systemd.
So it seems like something with the new library?
@louislam commented on GitHub (Jan 11, 2023):
Can you share your service file?
I just tested with wiki's service file, cannot reproduce your problem:
https://github.com/louislam/uptime-kuma/wiki/Systemd-Unit-File
@louislam commented on GitHub (Jan 11, 2023):
Anyway, I managed to handle this by forking the
node-pingproject. It will be released along with 1.19.5github.com/louislam/node-ping@1fdac27526@RyderCragie commented on GitHub (Jan 5, 2025):
@louislam I am having this issue too.
https://www.reddit.com/r/UptimeKuma/comments/1htdgc9/false_intermittent_downtime/