ExchangeUnion / xud-docker

Streamlined setup of xud and all dependencies via docker 🐳
https://docs.exchangeunion.com
GNU Affero General Public License v3.0
5 stars 5 forks source link

xud gRPC couldn't bind on port: 18886 #419

Open reliveyy opened 4 years ago

reliveyy commented 4 years ago
E0417 02:49:08.940438300       1 server_secure_chttp2.cc:81] {"created":"@1587091748.940373900","description":"No address added out of total 1 resolved","file":"../deps/grpc/src/core/ext/transport/chttp2/server/chttp2_server.cc","file_line":394,"referenced_errors":[{"created":"@1587091748.940363600","description":"Failed to add port to server","file":"../deps/grpc/src/core/lib/iomgr/tcp_server_custom.cc","file_line":404,"referenced_errors":[{"created":"@1587091748.940353700","description":"Failed to initialize UV tcp handle","file":"../deps/grpc/src/core/lib/iomgr/tcp_uv.cc","file_line":72,"grpc_status":14,"os_error":"address family not supported"}]}]}
17/04/2020 02:49:08.944 [RPC] error: gRPC couldn't bind on port: 18886

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.

kilrau commented 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.

kilrau commented 4 years ago

Update: grpc-js is under way https://github.com/ExchangeUnion/xud/pull/1605 and would enable xud-docker to use grpc/grpc-node#1209