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.

4 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:

4 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

Hi Cardano24,

I’ve been reading a lot here and ran into the same question as the Topic Starter. However… I believe the question was only answered half. Yes, it works with 0.0.0.0… but what to do if it WERE a BP node on the mainnet?
I am still in cardano school and playing with the testnet, but soon I’ll move to the real net. Which host address is meant here? The public ip of the core node itself or the ip of the relay node or something else - if we should not use 0.0.0.0?

thank you very much

Use 0.0.0.0

thank you, Alex - but this contradicts information from others like Cardano24. To be honest, I cannot choose who of you is the more professional one, but please add some explanation as well - after all, from what I understand this might be a security risk.

I know it was a bug… wondering if was fixed

You can try with ur IP or with 0.0.0.0 and see which will work

0.0.0.0 can be risky if u have more IPs… if u are using only one IPv4 address I think the result will be the same

thank you. Well, it works with 0.0.0.0 and not with the public ip of my server. In the video Carlos uses his public server ip though…