-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
[Bug]: RuntimeException: Unable to check Ipv6. Check that PHP was not compiled with option "disable-ipv6". #33567
Comments
Thanks for reporting 👍 I guess we need to wrap the checkIp calls with try-catch: https://github.com/nextcloud/server/blob/c5ffd7ce32a74c06dddd55652edea5c896ee9b3d/lib/private/Http/Client/LocalAddressChecker.php |
You are welcome. However, I am not sure whether the current tests are valid in the first place. You check only domain names for IPv6, not if IPv6 is actually able to reach an IPv6 host on the Internet. e.g. I know several people and also companies that use IPv6 internally (and do not use any of the domain names you are testing for), but do have only a IPv4 gateway to reach the Internet for accessing IPv4 addresses. |
Additionally, I am not sure what this code is supposed to do? Are you trying to find local link addresses? In that case server/lib/private/Http/Client/LocalAddressChecker.php Lines 40 to 43 in c5ffd7c
|
The patch improve the detection of local ip addresses. |
The description in the PR has no useful information. If you are looking for a private IP range, it is wrong. The code uses the term "local" IP address. What does that mean? Unfortunately it can mean a lot. It can be the IP address of your computer if it is behind a public facing IP. Either way, I believe this needs a bit more explanation what the dev of that code intended. |
I also encounter this issue and get "Update server couldn't be reached for X days" notifications. When I insert public static function checkIp6(string $requestIp, string $ip) {
$cacheKey = $requestIp.'-'.$ip;
if (isset(self::$checkedIps[$cacheKey])) {
return self::$checkedIps[$cacheKey];
}
+ return self::$checkedIps[$cacheKey] = false;
if (!((\extension_loaded('sockets') && \defined('AF_INET6')) || @inet_pton('::1'))) {
throw new \RuntimeException('Unable to check Ipv6. Check that PHP was not compiled with option "disable-ipv6".');
} in IMO nextcloud should conservatively fall back to IPv4 in case IPv6 detection fails instead of aborting with the EDIT: Bug is still present in v24.0.5 |
Hey, #33031 was related to a security report. The report is disclosed now https://hackerone.com/reports/1608039. That should give you some background information why the check is here. I assume the actual error / missing piece is somewhere else. 2a01:4f8:130:32f1::53 belongs to apps.nextcloud.com. If IPv6 is not available on the system we should probably not query an IPv6 address at all.
A solution could be to copy the check from checkIp6 and pass it to DnsPinMiddleware via constructor and adjust the above lines to only fetch ipv6 if enabled. However not everyone without IPv6 compiles php without IPv6 support. An additional configuration option is probably the better choice. |
Thanks a bunch for the explanation. I just want to say that disabling ipv6 on the OS level and/or not compiling ipv6 support into PHP is not that uncommon. The reason is that sometimes even though IPv6 is not configured and used, SW still tries to initialize it, setup an address, and/or use it. It generates unnecessary overhead and often many warnings, even though everything is fine and correctly setup. |
In 25.0.0 the Exception moved but it's still there:
|
Problem still persists in 25.0.1 Does anyone maybe have a better workaround than patching the source directly for not missing updates? |
Problem still exists in 25.0,2. Like tessus, my host does not have IPv6 enabled (in de kernel / network stack). I have enabled IPv6 in PHP only to work around this issue and that works great. I can get updates and see the appstore again. |
Also my host does not have IPv6 enabled and my last running version is 24.0.3. Upgrading to any newer version leads to the problem described above. Unfortunately my technical knowledge is very limited to help, but does anybody know will there be version with the IPv6 issue fixed In the near future? |
Use your package manager to upgrade Nextcloud to a version that's not affected. Once Nextcloud is at a version that has this bug fixed, you will be able to update the individual apps. Until then, you will not get notifications like "Update available for application X" |
@theerijn Downgrading nextcloud is not supported. Also this assumes, that it will be fixed before 26.x.x release since skipping major versions also isn't supported. I'm patching the source manually for now but I hope this will be adressed soon since it's a major brickwall. Fingers crossed. |
Issue still present in 25.0.4 |
Issue still present in 26.0.0. As as side note, I'd like to suggest adding this check to the "Security & Setup Warnings" procedure. It's not optimal to get a notification "The update server can't be reached" after three days. IMHO, it should come instantly as a warning like all other post-upgrade/setup warnings. |
Does anybody know, is this issue still present or fixed in the latest versions? Thanks |
@Stift1 Just checked. Still persists in 26.0.1 (Had to wait since you don't know immediately after the update when it doesn't work. Nextcloud gives a notification "Update server couldn't be reached in 3 days") |
Still persists in 26.0.5, thank you @heeplr for the ugly, but efficient workaround. |
Still persists in 27.0.2, and I suppose 27.1.x versions are in the same state. |
The issue is still open, and therefore it's not a big surprise, right? |
"unnecessary" ? Well... All the Nextcloud instances admins, who get regularly such "unnecessary" notifications because of this bug, might disagree, I guess. I know that we all have only 24 hours a day, that most of the devs are volunteers, and this bug is not really so important, and so on. I understand, and I respect that. |
I agree with @canoine: it’s pretty annoying… not the notification, but the delay in fixing such a little but persistent bug! :) |
Fixed with Nextcloud 29 |
Bug description
The update server could not be reached since 3 days to check for new updates.
Please check the Nextcloud and server log files for errors.
My server has IPv6 completely disabled and thus PHP was also compiled with
disable-ipv6
. This issue only became apparent after the lat update from 23.0.7 to 23.0.8.It makes no sense to force people to setup IPv6 or compile IPv6 into PHP when IPv6 is not used at all.
Steps to reproduce
Settings -> Overview
Expected behavior
Nestcloud should ignore IPv6 if it is not used and just use IPv4 instead and not throw an error that IPv6 support is not installed.
Installation method
Other
Operating system
Other
PHP engine version
PHP 8.0
Web server
Apache (supported)
Database engine version
MySQL
Is this bug present after an update or on a fresh install?
Updated from a minor version (ex. 22.2.3 to 22.2.4)
Are you using the Nextcloud Server Encryption module?
Encryption is Disabled
What user-backends are you using?
Configuration report
Nextcloud Logs
Additional info
I always update via the updater.phar on the cli. No optio for that in this template...
The text was updated successfully, but these errors were encountered: