If the only interface which has an IP address and is up is lo, one of the two default rpcbinds (:: and 0.0.0.0) will fail with "libevent: getaddrinfo: address family for nodename not supported".
RPC wont bind without an IP address on a non-localhost interface #13155
issue TheBlueMatt opened this issue on May 2, 2018-
TheBlueMatt commented at 7:11 PM on May 2, 2018: contributor
- fanquake added the label RPC/REST/ZMQ on May 2, 2018
-
pinheadmz commented at 5:24 PM on April 7, 2023: member
I know this is an old one, but can you offer steps to reproduce? I down'ed all interfaces except
loon macOS and rpc bound fine:--> ifconfig | grep UP -A 5 lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384 options=1203<RXCSUM,TXCSUM,TXSTATUS,SW_TIMESTAMP> inet 127.0.0.1 netmask 0xff000000 inet6 ::1 prefixlen 128 inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1 nd6 options=201<PERFORMNUD,DAD>2023-04-07T17:19:42Z Binding RPC on address ::1 port 18443 2023-04-07T17:19:42Z Binding RPC on address 127.0.0.1 port 18443However,
I did notice that in a docker container with no ipv6 I got the error you reported... but that makes sense so I don't understand if there is still a bug or if you think the error message maybe needs to be changed?
# ifconfig eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 172.17.0.2 netmask 255.255.0.0 broadcast 172.17.255.255 ether 02:42:ac:11:00:02 txqueuelen 0 (Ethernet) RX packets 195 bytes 218835 (218.8 KB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 131 bytes 7323 (7.3 KB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 loop txqueuelen 1000 (Local Loopback) RX packets 24 bytes 1200 (1.2 KB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 24 bytes 1200 (1.2 KB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 02023-04-07T16:41:56Z Binding RPC on address ::1 port 18443 2023-04-07T16:41:56Z [libevent:warning] getaddrinfo: address family for nodename not supported 2023-04-07T16:41:56Z Binding RPC on address ::1 port 18443 failed. 2023-04-07T16:41:56Z Binding RPC on address 127.0.0.1 port 18443 -
pinheadmz commented at 3:58 PM on April 13, 2023: member
Thanks Matt! Closing for now, lets reopen if it comes up again
- pinheadmz closed this on Apr 13, 2023
- bitcoin locked this on Apr 12, 2024
- bitcoin unlocked this on Jun 10, 2024
- maflcko reopened this on Jun 10, 2024
-
m3dwards commented at 5:18 PM on June 12, 2024: contributor
I believe this is the same issue as in #30245 but in libevent.
If you pass
::1togetaddrinfowhen configured withAI_ADDRCONFIGit will check that there is a non loopback IPV6 interface configured. This was to prevent IPV6 DNS lookups on IPV4 only machines which could be slow.Please see #30245 for a more full write up and some references.
As I understand it, there are efforts to replace libevent so rather than attempting to get this behaviour changed upstream in libevent we could just wait for that.
-
vasild commented at 12:35 PM on June 14, 2024: contributor
one of the two default rpcbinds (:: and 0.0.0.0) will fail
Which one? Is it always
::or always0.0.0.0or randomly one or the other? I guess there is some mistake here because the default rpcbinds are::1and127.0.0.1(not::and0.0.0.0). - achow101 referenced this in commit ec74f45741 on Jul 18, 2024
- PastaPastaPasta referenced this in commit 3e009ea12f on Oct 25, 2024
- PastaPastaPasta referenced this in commit 745addf6a7 on Oct 27, 2024
-
kristapsk commented at 9:37 PM on August 26, 2025: contributor
Noticed this when there is only IPv6 address assigned to eth0 interface (lo has both 127.0.0.1 and ::1). When IPv4 address is also added to eth0, problem disappears.
Bitcoin Core version v29.0.0 (release build) Using the 'arm_shani(1way,2way)' SHA256 implementation Startup time: 2025-08-26T21:30:01Z Default data directory /.bitcoin Using data directory /ssd/bitcoind/mainnet Config file: /home/bitcoind/mainnet.conf Config file arg: chain="main" Config file arg: datadir="/ssd/bitcoind/mainnet" Config file arg: disablewallet="1" Config file arg: discover="1" Config file arg: externalip="****" Config file arg: logtimestamps="0" Config file arg: maxconnections="80" Config file arg: maxuploadtarget="2048" Config file arg: onion="127.0.0.1:9050" Config file arg: printtoconsole="1" Config file arg: rpcallowip="127.0.0.1" Config file arg: rpcauth=**** Config file arg: rpcbind="127.0.0.1" Config file arg: rpcport="8332" Config file arg: server="1" Config file arg: whitelist="127.0.0.1" Config file arg: zmqpubrawblock="tcp://127.0.0.1:8331" Config file arg: zmqpubrawtx="tcp://127.0.0.1:8330" Command-line arg: conf="/home/bitcoind/mainnet.conf" Using at most 80 automatic connections (1024 file descriptors available) Wallet disabled! scheduler thread start Binding RPC on address 127.0.0.1 port 8332 [libevent:warning] getaddrinfo: address family for nodename not supported Binding RPC on address 127.0.0.1 port 8332 failed. Unable to bind any endpoint for RPC server [error] Unable to start HTTP server. See debug log for details. Shutdown: In progress... scheduler thread exit Shutdown: done