Skip to content

IPv6-only does not work in some environments #3113

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 task done
solick opened this issue Apr 29, 2023 · 10 comments
Closed
1 task done

IPv6-only does not work in some environments #3113

solick opened this issue Apr 29, 2023 · 10 comments
Labels
A:core Issues or PRs describing changes to the core of uptime kuma blocked-upstream upstream (i.e. a dependency we depend on will have to do this work) feature-request Request for new features to be added

Comments

@solick
Copy link

solick commented Apr 29, 2023

⚠️ Please verify that this feature request has NOT been suggested before.

  • I checked and didn't find similar feature request

🏷️ Feature Request Type

Other

🔖 Feature description

Currently it is not possible to monitor server which has only an ipv6 address. I tested with a virtual machine which has only an ipv6 address with ping monitoring and the server is down as inactive. Tested the same machine with uptimerobot and the server is shown as up and running.

Because Ipv6 is the future and Ipv4 is legacy, uptime-duma should support ipv6 monitoring.

✔️ Solution

Either enable ping monitoring to test v4 and v6 or add a new ping6 monitoring.

❓ Alternatives

No response

📝 Additional Context

No response

@solick solick added the feature-request Request for new features to be added label Apr 29, 2023
@n-thumann
Copy link
Contributor

Is this still the case? I am currently running Uptime Kuma on a IPv6-only server and monitoring ipv6.google.com (doesn't have an A record) with no issues ✌️

@solick
Copy link
Author

solick commented Jul 5, 2023

It was only the case using the docker variant. I installed uptime kuma now plain on a vm and now it works.

@solick solick closed this as completed Jul 5, 2023
@benniju
Copy link

benniju commented May 27, 2024

Hi, I can only run Uptime Kuma in docker, because I use Home Assistant OS. Would it be possible to add IPv6 support to the Docker images?

@CommanderStorm
Copy link
Collaborator

We support ipv6.
Without additional details about your setup it is basically impossible to help you.
=> What are you trying to monitor?

Why you are likely wondering if we support this is because we don't have happy eyeballs v2 due to the node version we packaged.
If you are asking to select which stack you are using: this is currently not possible in nodejs (see #1242)

We have upgraded nodejs for uptime-kuma V2. You can see #4500 for the bugs which will need to be fixed before we can publish the beta.

@benniju
Copy link

benniju commented May 27, 2024

I am running v1.23.13 in Home Assistant OS using the following addon: https://github.com/hassio-addons/addon-uptime-kuma
I have tried adding a ping monitor for an Hostname which only has an AAAA (IPv6) record and no A (IPv4) record and IP address.
When I save the monitor I get the message that it is down with the error ping: connect: Address not available. When I try to add the IP Address itself with braces, I can't even save the monitor.

This is the output when I try to use ping in the docker container using docker exec:

root@a0d7b954-uptime-kuma:/opt$ ping google.de
PING google.de (142.250.186.35) 56(84) bytes of data.
64 bytes from fra24s04-in-f3.1e100.net (142.250.186.35): icmp_seq=1 ttl=114 time=19.9 ms
^C
--- google.de ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 19.858/19.858/19.858/0.000 ms
root@a0d7b954-uptime-kuma:/opt$ ping -6 google.de
ping: connect: Address not available
root@a0d7b954-uptime-kuma:/opt$ ping6 google.de
ping6: connect: Address not available

So it seems that the container does not have any IPv6 support at all. This is not the case for other Home Assistant Containers.
Although I have noticed that the hass docker image is not based on this docker image, so maybe I should open the issue there?

@CommanderStorm
Copy link
Collaborator

Is the URL publicly routable? If yes, could you provide the URL you are testing against?

Is this reproducible on uptime.kuma.pet ?
(I am trying to rule out bad docker networking, which is somewhat of a common occurrence)

Alternatively (idk how to do that via your deployment variant, we don't maintain that and I don't use it) you can try our troubleshooting steps here and see if it is a docker network is configured correctly:
https://github.com/louislam/uptime-kuma/wiki/Troubleshooting

I don't know what is the problem with ipv6 in the ping monitor. Likely the allowed regex needs adjusting.
The pattern is currently quite complicated

@CommanderStorm
Copy link
Collaborator

The current regex is here:

/**
* Regex pattern fr identifying hostnames and IP addresses
* @param {boolean} mqtt whether or not the regex should take into
* account the fact that it is an mqtt uri
* @returns {RegExp} The requested regex
*/
export function hostNameRegexPattern(mqtt = false) {
// mqtt, mqtts, ws and wss schemes accepted by mqtt.js (https://github.com/mqttjs/MQTT.js/#connect)
const mqttSchemeRegexPattern = "((mqtt|ws)s?:\\/\\/)?";
// Source: https://digitalfortress.tech/tips/top-15-commonly-used-regex/
const ipRegexPattern = `((^${mqtt ? mqttSchemeRegexPattern : ""}((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))$)|(^((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:)))(%.+)?$))`;
// Source: https://stackoverflow.com/questions/106179/regular-expression-to-match-dns-hostname-or-ip-address
const hostNameRegexPattern = `^${mqtt ? mqttSchemeRegexPattern : ""}([a-zA-Z0-9])?(([a-zA-Z0-9_]|[a-zA-Z0-9_][a-zA-Z0-9\\-_]*[a-zA-Z0-9_])\\.)*([A-Za-z0-9_]|[A-Za-z0-9_][A-Za-z0-9\\-_]*[A-Za-z0-9_])(\\.)?$`;
return `${ipRegexPattern}|${hostNameRegexPattern}`;
}

@benniju
Copy link

benniju commented May 27, 2024

Is the URL publicly routable? If yes, could you provide the URL you are testing against?

Yes, but I do not want to publish the URL. But the same problem also occurs when adding ipv6.google.com.

Is this reproducible on uptime.kuma.pet ? (I am trying to rule out bad docker networking, which is somewhat of a common occurrence)

Yes, the ping also does not work there with the error connect: Network is unreachable

Alternatively (idk how to do that via your deployment variant, we don't maintain that and I don't use it) you can try our troubleshooting steps here and see if it is a docker network is configured correctly: https://github.com/louislam/uptime-kuma/wiki/Troubleshooting

root@a0d7b954-uptime-kuma:/opt$ curl https://ipv6.google.com
curl: (7) Failed to connect to ipv6.google.com port 443 after 4 ms: Couldn't connect to server
root@a0d7b954-uptime-kuma:/opt$ ping ipv6.google.com
ping: connect: Address not available

So as I also noted before it does seem that the container does not have any IPv6 Support at all, so it is likely a docker network problem. Should I open an issue in the addons repo instead? I find it interesting though, that the IPv6 ping also fails on the demo, but with a different error.

@benniju
Copy link

benniju commented May 27, 2024

I have now enabled host networking in a customised version of the container, and now the ping works fine.
This is not really recommended though and lowers the "security rating" of the addon and you also can't simply modify the port of the webserver easily then. It probably seems to be a general issue with IPv6 networking in Home Assistant then and not a issue in Uptime Kuma.

@CommanderStorm CommanderStorm changed the title IPv6 only support IPv6-only does not work in some environments May 27, 2024
@CommanderStorm CommanderStorm added help wanted May need your help to test or answer A:monitor Issues or PRs related to monitors type:enhance-existing feature wants to enhance existing monitor labels May 27, 2024
@CommanderStorm
Copy link
Collaborator

ipv6 networking in docker (docs at https://docs.docker.com/config/daemon/ipv6/) needs to be enabled.
By default only IPv4 is available.

For home assistant this is tracked/discussed here:
home-assistant/supervisor#2133

Closing as nothing we can do. Upstream support needs to be enabled manually.
If there is something that we are missing, please comment and we can reopen the issue ^^

@CommanderStorm CommanderStorm closed this as not planned Won't fix, can't repro, duplicate, stale May 28, 2024
@CommanderStorm CommanderStorm added blocked-upstream upstream (i.e. a dependency we depend on will have to do this work) A:core Issues or PRs describing changes to the core of uptime kuma and removed help wanted May need your help to test or answer A:monitor Issues or PRs related to monitors type:enhance-existing feature wants to enhance existing monitor labels May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A:core Issues or PRs describing changes to the core of uptime kuma blocked-upstream upstream (i.e. a dependency we depend on will have to do this work) feature-request Request for new features to be added
Projects
None yet
Development

No branches or pull requests

4 participants