Cardano-node: Network.Socket.bind: unsupported operation (Cannot assign requested address)

Hi there,
I’m trying to run a test net node and I’m getting the following error message during startup:

Shutting down…

cardano-node: Network.Socket.bind: unsupported operation (Cannot assign requested address)

Any ideas how I can fix this would be greatly appreciated.

S.

3 Likes

how it looks your node start script?

try to replace –host-addr with 0.0.0.0

1 Like

0.0.0.0 means it binds to all interfaces. Is this intended for a testnet node?

Is there another cardano node already running on the same host when you start your testnet node?

If you want multiple nodes listening on the same interface you need to make sure you are not using the same port number.

2 Likes

Hi Alexd1985,

Changing the host-addr to 0.0.0.0 worked and the testnet node now starts. I am now seeing the “Chain extended, new tip …” messages.

Does this mean that something about my config or setup is wrong? I am assuming that a valid public IP address needs to be entered when connecting to the mainnet?

Thanks!

S.

1 Like

Hi waldmops,

How do I check if there is another testnet node running?

Thanks!

S

Well, usually I remember having started one. In case I’m not sure, I use
netstat -tulpn
to see which processes are listening on network interfaces.

Hi waldmops,

Thanks for sharing the command to check running node. By the way, with regards to your earlier question, I am running a testnet node. So is it ok to set the host-addr to 0.0.0.0? It seems to be working when I do that. I assume for a mainnet node the IP address has to be a real public and static address.

S

Yes, that is OK. The address 0.0.0.0 just means that the process binds to all available interfaces at once instead of a specific one. In other words it exposes the service to the internet, which is what you want since other nodes should be able to connect to yours.

If, on the other hand, you are running something that should not normally be reachable by the whole world, you would bind to 127.0.0.1 or some interface on the local network. I do this for things like cardano-rt-view or grafana and set up tunnels from the machines that need to access these services.

3 Likes

Hi waldmops,

I see thanks for the explanation. So for a mainnet node we can still use the 0.0.0.0 as the hostaddr?

S.

Yes, I use 0.0.0.0

Thanks for your help guys!

“Yes, that is OK”

We should maybe add: that you should not use 0.0.0.0 if it is a BP-Node, only if you have it behind a firewall which only lets private relays connect to the BP.

@waldmops nothing against what you said, but you know how people are,…
better let’s make it more “detailed” or some people will have some problems :wink:

2 Likes

Hi there,

I have had the same issue while setting up a node on AWS and I found this post useful

Specifically this part:

AWS runs network address translation between your instance and the internet. So, the AWS instance might be reachable by the IP address 08.08.08.0808 (public IP), however, the server is actually configured to use 88.88.88.88 (private IP). What I need to do was bind to the internal IP of the server which I found with ifconfig (private IP).

Hope it helps!

2 Likes

I can verify today (02/19/2021) that using 0.0.0.0 works!

1 Like