Skip to content
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

FS#3675 - getaddrinfo prefers IPv6 and fails when there is no IPv6 connectivity #6986

Open
openwrt-bot opened this issue Mar 9, 2021 · 3 comments
Labels
bug issue report with a confirmed bug core packages pull request/issue for core (in-tree) packages flyspray release/21.02 pull request/issue targeted (also) for OpenWrt 21.02 release

Comments

@openwrt-bot
Copy link

Malakai:

As stated in the summary, getaddrinfo prefers IPv6 and fails when there is no IPv6 connectivity which causes issues with some functionalities.
For instance, I opened this [[https://forum.openwrt.org/t/collectd-network-plugin-getaddrinfo-failed-system-error/90546|thread]] on the forum about collectd network plugin complaining of "getaddrinfo failed: System error" when using a hostname that is resolvable only in IPv4 or an IPv4 address.
IPv6 is deactivated on my entire network (on the router and on the hosts) and this seems to cause that error message.
This is happening on a Linksys WRT1900ACS with OpenWrt 19.07.2 and on a TP-Link Archer C7 v5 with OpenWrt 19.07.7
Apparently, the issue is still relevant even when you do not disable IPv6 specifically. vgaetera (on the forum) tested OpenWrt 19.07.7 x86_64 as a KVM/QEMU guest with mostly default configuration. So, IPv6 is enabled but IPv6 connectivity is missing and the issue persists.

I am not sure if it is also related to getaddrinfo but another issue is when I flash a device with OpenWRT and there is no IPv6 connectivity, I can't use opkg at all. First I have to manually download full wget and install it and then opkg starts working.

For more details and troubleshooting about this getaddrinfo issue, check : https://forum.openwrt.org/t/collectd-network-plugin-getaddrinfo-failed-system-error/90546

@aparcar aparcar added the release/19.07 pull request/issue targeted (also) for OpenWrt 19.07 release label Feb 22, 2022
@dandudikof
Copy link

dandudikof commented Apr 19, 2022

Second this same issue.

wrt1900ac | OpenWrt 21.02.0 ( as a dumb AP , no iptables nor dnsmasq)

Ipv6 is also disabled as much as possible. Except for stray interfaces on openwrt where i forget (option ipv6 '0')

Tue Apr 19 00:15:37 2022 daemon.err collectd[7313]: network plugin: getaddrinfo (192.168.17.66, 25822) failed: System error
Tue Apr 19 00:16:57 2022 daemon.err collectd[7313]: network plugin: getaddrinfo (192.168.17.66, 25822) failed: System error
Tue Apr 19 00:19:37 2022 daemon.err collectd[7313]: network plugin: getaddrinfo (192.168.17.66, 25822) failed: System error

collectd network output plugin configured for ip not hostname. And dns ptr(reverse ip to host) query returns correct.

thanx

EDIT: PS: removing option ipv6 '0' atleast for lo(loopback) solves the problem , but still seems like a bug.
ipv4 connectivity should not depend on ipv6 being enable somewhere.

@ynezz ynezz added the release/21.02 pull request/issue targeted (also) for OpenWrt 21.02 release label May 24, 2022
@ynezz
Copy link
Member

ynezz commented May 24, 2022

@dandudikof can you try to reproduce the issue with 22.03-rc2 ? BTW it would help if you could share some minimal network configuration which could be used to reproduce this issue.

@ynezz ynezz added bug issue report with a confirmed bug core packages pull request/issue for core (in-tree) packages and removed release/19.07 pull request/issue targeted (also) for OpenWrt 19.07 release labels May 24, 2022
@dandudikof
Copy link

dandudikof commented May 26, 2022

Did a syupgrade to 22.03-rc2 and tried to install the same packages i had before .

including

luci-app-statistics
collectd-mod-cpu
collectd-mod-interface
collectd-mod-iwinfo
collectd-mod-load
collectd-mod-memory
collectd-mod-network
collectd-mod-rrdtool
collectd-mod-sensors
collectd-mod-uptime

config device
option name 'lo'
option ipv6 '0'

and checked all other device also. (no visible ipv6 addressing with "ip address" same with "ifconfig")

No errors in logread, and network plugin is sending data . ( to a telegraf , which forwards to influxdb )

seems like it is working without ipv6 being on

thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug issue report with a confirmed bug core packages pull request/issue for core (in-tree) packages flyspray release/21.02 pull request/issue targeted (also) for OpenWrt 21.02 release
Projects
None yet
Development

No branches or pull requests

4 participants