Open martoko opened 3 years ago
Thank you for the report.
I don't think the correct solution is to bind both addresses by default. I think this needs to be an explicit choice by the node operator.
But indeed, this is an annoying issue, but it is ultimately a limitation of the http2-client
library which is used by the GRPC client library which just takes the first address returned from address lookup, see https://hackage.haskell.org/package/http2-client-0.10.0.0/docs/src/Network.HTTP2.Client.RawConnection.html#newRawHttp2Connection
It would be good to make this more robust, but it is unfortunately not as straightforward to fix as it could be.
Bug Description Running
concordium-client --grpc-ip localhost --grpc-port 10000 consensus status
results inError: I/O error: Cannot establish connection to GRPC endpoint.
.Whereas running
concordium-client --grpc-ip 127.0.0.1 --grpc-port 10000 consensus status
works just fine.Other programs work fine with
localhost
.And
localhost
has been configured correctly in/etc/hosts
Steps to Reproduce Run
concordium-client --grpc-ip localhost --grpc-port 10000 consensus status
in an Arch Linux installation with a node running on port 10000.Expected Result Should output consensus status.
Actual Result Gives an error.
Versions concordium-node 1.0.1 concordium-client 1.0.1 Operating System: Arch Linux
Kernel: Linux 5.12.14-arch1-1 Architecture: x86-64
Further details The node is bound on IPv4 only.
Running
netcat
on bothlocalhost
and127.0.0.1
seems to output some data, suggesting that a connection has been established.Naturally running
netcat
on the IPv6localhost
does not work.Further experimentation reveals that by binding the node on the IPv6 localhost by setting
Environment=RPC_SERVER_ADDR=::1
makes the command work with localhost.This makes sense as
localhost
resolves to both127.0.0.1
and::1
, but concordium-node is only running on one of these by default.Maybe the concordium-node should bind to both IPv4 and IPv6 by default, or the concordium-client should be able to handle
localhost
returning both IPv4 and IPv6 addresses (something which other programs such asnetcat
seems to be able to do just fine).