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.