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

Unable to listen gRPC on both IPv4 and IPv6 #2776

Closed
sohomangue opened this issue Mar 13, 2019 · 6 comments

Comments

Projects
None yet
4 participants
@sohomangue
Copy link

commented Mar 13, 2019

Background

lnd tells gRPC to only listen to IPv6 incoming connections even if I specify an IPv4 wildcard.

Your environment

  • lnd 0.5.2-beta
  • bitcoind 0.17.1
  • Raspbian 9 (Stretch)
  • Additional informations: Dual-stack (IPv4/IPv6) full node running on a Raspberry Pi

Steps to reproduce

lnd.conf:

...
externalip=[2a01:e34:eeb5:5d10:99c0:842a:432f:5270]:10040
externalip=78.235.85.209:10041
rpclisten=[::]:10050
rpclisten=0.0.0.0:10051
...

Expected behaviour

gRPC server should setup an IPv6 and an IPv4 listener.

2019-03-13 22:59:40.942 [INF] RPCS: password RPC server listening on [::]:10050
2019-03-13 22:59:40.942 [INF] RPCS: password RPC server listening on 0.0.0.0:10051

Actual behaviour

gRPC server sets up two IPv6 listeners.

2019-03-13 22:59:40.942 [INF] RPCS: password RPC server listening on [::]:10050
2019-03-13 22:59:40.942 [INF] RPCS: password RPC server listening on [::]:10051

Can be verified using netstat -nlp:

Active Internet connections (only servers)`
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
...     
tcp6       0      0 :::10050                :::*                    LISTEN      -         
tcp6       0      0 :::10051                :::*                    LISTEN      -   
@Roasbeef

This comment has been minimized.

Copy link
Member

commented Mar 14, 2019

Have you tried connecting to both? The rpclisten flag only accept a single argument. If you specify [::], then that means all interfaces.

@sohomangue

This comment has been minimized.

Copy link
Author

commented Mar 14, 2019

Yes, connecting 10050 leaves me hanging, even when using tlsextraip, tls.cert and admin.macaroon. Plus netstat shows it’s an IPv6-only route.

@Roasbeef

This comment has been minimized.

Copy link
Member

commented Mar 14, 2019

Try removing the ipv4 listen line.

@sohomangue

This comment has been minimized.

Copy link
Author

commented Mar 14, 2019

Same result, gRPC sets an IPv6 listener and as expected I can’t connect it from an external IPv4 address. Also tried removing the IPv6 listen line and leave rpclisten=0.0.0.0:10051 but gRPC still sets it up as an IPv6-only listener.

@P0u1us

This comment has been minimized.

Copy link

commented Apr 12, 2019

Hi, I believe to run into the same issue: with a full manual build of BTCpayServer ontop of LND I am unable to get the REST interface working; keen to see if this tread will solve that;
In the mean time I got really confused with the conflicting use for the terms RPC, gRPC and REST in the logs of LND: these are inconsistently used.

My lnd.conf file:
; to solve: #1567, extra line:
rpclisten=127.0.0.1:10008
rpclisten=0.0.0.0:10009
rpclisten=x.yyy.zzz.15:4388
restlisten=127.0.0.1:8080
restlisten=x.yyy.zzz.15:4380

BUT the log shows:
2019-04-12 17:13:32.276 [INF] RPCS: password RPC server listening on 127.0.0.1:10008
2019-04-12 17:13:32.276 [INF] RPCS: password RPC server listening on [::]:10009
2019-04-12 17:13:32.276 [INF] RPCS: password RPC server listening on x.yyy.zzz.15:4388
2019-04-12 17:13:32.276 [INF] RPCS: password gRPC proxy started at 127.0.0.1:8080
2019-04-12 17:13:32.276 [INF] RPCS: password gRPC proxy started at x.yyy.zzz.15:4380

2019-04-12 17:14:44.232 [INF] RPCS: RPC server listening on 127.0.0.1:10008
2019-04-12 17:14:44.232 [INF] RPCS: RPC server listening on [::]:10009
2019-04-12 17:14:44.232 [INF] RPCS: RPC server listening on x.yyy.zzz.15:4388
2019-04-12 17:14:44.232 [INF] RPCS: gRPC proxy started at 127.0.0.1:8080
2019-04-12 17:14:44.232 [INF] RPCS: gRPC proxy started at x.yyy.zzz.15:4380

gRPC= Google implementation of RPC and the competitor to REST!

Suggestion to correct the LND log output: gRPC into REST
I just hope it is only cosmetic and not the sign of mixing up vars! ;-)

@cfromknecht

This comment has been minimized.

Copy link
Collaborator

commented Apr 12, 2019

Suggestion to correct the LND log output: gRPC into REST

Good suggestion, this can be done. FWIW, the REST proxy just translates http requests into grpc requests, and uses the underlying grpc server to respond to http requests. Mixing of vars is not the issue, just a cosmetic one

gRPC= Google implementation of RPC and the competitor to REST!

gRPC is far superior to REST, I’d hardly call it a competition ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.