Open reliveyy opened 4 years ago
Just stumbled upon this when running latest xud-docker simnet, xucli
couldn't connect:
simnet > status
┌─────────┬──────────────────────────────────────────────────┐
│ SERVICE │ STATUS │
├─────────┼──────────────────────────────────────────────────┤
│ lndbtc │ Ready │
├─────────┼──────────────────────────────────────────────────┤
│ lndltc │ Ready │
├─────────┼──────────────────────────────────────────────────┤
│ raiden │ Container exited │
├─────────┼──────────────────────────────────────────────────┤
│ xud │ could not connect to xud at 0.0.0.0:28886, is xu │
└─────────┴──────────────────────────────────────────────────┘
It was using the chore/update-simnet
branch which was build with the latest xud
master which included https://github.com/ExchangeUnion/xud/pull/1482.
Problem in my case seems not to be that grpc can't bind using the ipv6 address, but that xucli can't connect to it:
bash-5.0# netstat -a
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:28885 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:28887 0.0.0.0:* LISTEN
tcp 0 0 localhost:9050 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.11:33931 0.0.0.0:* LISTEN
tcp 0 0 xud:40772 lndbtc:10009 ESTABLISHED
tcp 0 0 xud:43704 45.62.228.131:9001 ESTABLISHED
tcp 0 0 localhost:52644 localhost:9050 ESTABLISHED
tcp 0 0 xud:39330 lndltc:10009 ESTABLISHED
tcp 0 0 localhost:52750 localhost:9050 TIME_WAIT
tcp 0 0 localhost:9050 localhost:52644 ESTABLISHED
tcp 0 0 :::28886 :::* LISTEN
udp 0 0 127.0.0.11:57518 0.0.0.0:*
udp 0 0 xud:47357 metadata.google.internal:domain ESTABLISHED
Active UNIX domain sockets (servers and established)
Proto RefCnt Flags Type State I-Node Path
Since according to https://github.com/grpc/grpc-node/issues/1209 the only working solution to get grpc to listen on a ipv4 addres so far is using gprc-js, which we don't want because not stable. So I guess the only way is to get xucli connect to a ipv6 address.
Update: grpc-js is under way https://github.com/ExchangeUnion/xud/pull/1605 and would enable xud-docker to use grpc/grpc-node#1209
I found this issue when I'm debuging watchdog feature. It exists in Docker environment only. And it is related to https://github.com/grpc/grpc-node/issues/1209
I haven't figure out why our master xud image doesn't have this problem.