Lightning: STATUS_FAIL_INTERNAL_ERROR: Failed to bind on 2 socket: Cannot assign requested address

Created on 12 May 2018  Â·  19Comments  Â·  Source: ElementsProject/lightning

Issue and Steps to Reproduce

v0.5.2-2016-11-21-2716-g1125682

Attempt to start node. Debug output:

tail -f debug.log
2018-05-12T03:08:50.370Z lightningd(17025): Loading HTLCs for channel 130
2018-05-12T03:08:50.370Z lightningd(17025): Restored 0 incoming and 0 outgoing HTLCS
2018-05-12T03:08:50.370Z lightningd(17025): Loading HTLCs for channel 132
2018-05-12T03:08:50.370Z lightningd(17025): Restored 0 incoming and 0 outgoing HTLCS
2018-05-12T03:08:50.370Z lightningd(17025): Loading HTLCs for channel 136
2018-05-12T03:08:50.370Z lightningd(17025): Restored 0 incoming and 0 outgoing HTLCS
2018-05-12T03:08:50.370Z lightningd(17025): Loading HTLCs for channel 138
2018-05-12T03:08:50.370Z lightningd(17025): Restored 0 incoming and 0 outgoing HTLCS
2018-05-12T03:08:50.579Z lightningd(17025): Adding block 521917: 000000000000000000126909929301aab2287f986d62ed341839387373ca9e28
2018-05-12T03:08:50.582Z lightningd(17025): Listening on 'lightning-rpc'
2018-05-12T03:09:20.772Z lightning_gossipd(17043): Unable to parse local_add_channel message: 0bc907f46f00033d00016fe28c0ab6f1b372c1a6a246ae63f74f931e8365e15a089c68d6190000000000035f813598df61688b7eff80d546b2ba200bb00c1726bf32f44b692cc98a3580cd000e0000000000000000000003e80000000a
2018-05-12T03:09:20.772Z lightning_gossipd(17043): Unable to parse local_add_channel message: 0bc907f51b00070900006fe28c0ab6f1b372c1a6a246ae63f74f931e8365e15a089c68d6190000000000031b046a18089261f1d8d1238e98fb0303e62b521bd24dbfa960a4b469684a48f9000e0000000000000001000003e80000000a
2018-05-12T03:09:20.773Z lightning_gossipd(17043): Unable to parse local_add_channel message: 0bc907f51b00070900006fe28c0ab6f1b372c1a6a246ae63f74f931e8365e15a089c68d6190000000000031b046a18089261f1d8d1238e98fb0303e62b521bd24dbfa960a4b469684a48f9000e0000000000000001000003e80000000a
2018-05-12T03:09:20.773Z lightning_gossipd(17043): Unable to parse local_add_channel message: 0bc907f51b00070900006fe28c0ab6f1b372c1a6a246ae63f74f931e8365e15a089c68d6190000000000031b046a18089261f1d8d1238e98fb0303e62b521bd24dbfa960a4b469684a48f9000e0000000000000001000003e80000000a
2018-05-12T03:09:20.773Z lightning_gossipd(17043): gossip_store: Read 8349/2323865/5119/159 cannounce/cupdate/nannounce/cdelete from store in 325240679 bytes
2018-05-12T03:09:20.773Z lightning_gossipd(17043): STATUS_FAIL_INTERNAL_ERROR: Failed to bind on 2 socket: Cannot assign requested address

getinfo output

If I need to provide additional information, please just let me know how I can help and what to provide.

Most helpful comment

I think the trick is ignoring --addr for any non-public-facing machines, and doing;

--bind-addr 127.0.0.1:9735 --announce-addr my.pub.ip.addr:9735

on the cmdline for launching lightningd.

Testing that out after having difficulty getting the node started after upgrading.

All 19 comments

I got this error when the external IP address I had in config was not the internal listening address. Check the new config params for IP addresses.

Thank you for pointing this out to me! That did the trick. I simply wasn't aware of the new params.

Could you guys be a little more detailed.
There are three configuration params for lightningd:
--addr <arg> Set an IP address (v4 or v6) to listen on and announce to the network for incoming connections --bind-addr <arg> Set an IP address (v4 or v6) to listen on, but not announce --announce-addr <arg> Set an IP address (v4 or v6) or .onion v2/v3 to announce, but not listen on

I have tried to set the first and the second equal to the external address but it didn't work.

I think the trick is ignoring --addr for any non-public-facing machines, and doing;

--bind-addr 127.0.0.1:9735 --announce-addr my.pub.ip.addr:9735

on the cmdline for launching lightningd.

Testing that out after having difficulty getting the node started after upgrading.

Interesting...
Thank you.

Il sab 12 mag 2018, 15:50 Xian001 notifications@github.com ha scritto:

I think the trick, for a port forwarded box at least, is ignoring -addr
for any non-public-facing machines, and doing;

--bind-addr 127.0.0.1:9735 --announce-addr my.ip.ad.dr:9735

on the cmdline for launching lightningd.

Testing that out after having difficulty getting the node started after
upgrading.

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/ElementsProject/lightning/issues/1496#issuecomment-388556608,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAcIbgt6I4w2WJSREgsLsxKqz1Beq5v2ks5txuiZgaJpZM4T8Qev
.

adding this to my config seems to have allowed it to start normally for me. We'll see if the lightning explorers can see my uri now after I give them a few hours to update.

--bind-addr 127.0.0.1:9735 --announce-addr my.pub.ip.addr:9735

EDIT: Again, ignore below. Took longer than anticipated for explorers to update their info.


We'll see if the lightning explorers can see my uri now after I give them a few hours to update.

Does not seem to work, for broadcasting the URI

EDIT: Not sure how quickly they update. I updated my command line, went out to run errands for a few hours, came back, and noticed the URI's still showing up as blank at robtex.com and https://lnmainnet.gaben.win/ . Maybe we do need to wait longer...

Do they update that quickly? The last time stamp on mine is several hours old.

For anyone having this issue... I found the details in the original issue:

https://github.com/ElementsProject/lightning/pull/1450

--bind-addr=a        listen on address a
--announce-addr=a    announce our address as a to peers
--addr=a             equivalent to --bind-addr=a --announce-addr=a

So... if the local IP address it is listening on is the same as the incoming IP then just use addr. Otherwise you need to specify both the bind and the announce addr.

Ok, a few more hours later, and it appears that the cmdline I used is properly broadcasting the URI to explorers.

Wow. The longest downtime ever for my Lightning node was because of this configuration change. I wish they would warn us before making this huge of a change!

For the record, for those who used to use "--ipaddr=1.2.3.4", now you must specify "--bind-addr 10.11.12.13" "--announce-addr=1.2.3.4", where 10.11.12.13 is your local in-NAT LAN address, and 1.2.3.4 is your public IP#.

They should have kept "--ipaddr" as an alias for that, and marked it as depracated, with a warning in the log file.

The new names, while obvious, don't fix the breakage of the configuration.

If you have ipaddr in ~/.lightning/config, you also have to remove it or change it to bind-addr/announce-addr.

@Xian001 hello, thanks a lot for the information, I used what you suggested up in the comment "--bind-addr 127.0.0.1:9735 --announce-addr my.pub.ip.addr:9735"I used it without the "--announce" part but because I am a newbie and I know nothing about programming I used the IP address that you provided "--bind-addr 127.0.0.1:9735 " is there any way to reverse this idiotic mistake?

Stop lightningd, then start it with the correct arguments?

127.0.0.1 is "loopback" for IPv4, and simply means it will bind to an IPv4 interface it finds.

You need to know your public IP address too and use it for --announce-addr.

Or try running without any addr flags first, just see if what interfaces it discovers.

@ZmnSCPxj thank you so much but how can I stop lightningd am really sorry but am a real newbie I use Ubuntu 17.10 (GNU/Linux 4.13.0-38-generic x86_64)
I am using the https://console.cloud.google.com I activated a virtual machine from there

@ZmnSCPxj again thanks for your help I ran it right now without any --addr, I guess it's running smoothly, does running the node without an addr function affect the node in a bad way?

Look at what it says in the logs. It should have discovered its public IP address, which should match the public address you see in the Google Cloud service.

I have successfully started my node with config file like this ->

alias=MYNODE
rgb=47D278
bind-addr=127.0.0.1:9735
announce-addr=my.pub.ip.addr:9735

you put this file in .lightning folder and than start your node with ./lightningd/lightningd --network bitcoin

in less than a minute i saw my URI updated on https://lnmainnet.gaben.win/

Was this page helpful?
0 / 5 - 0 ratings

Related issues

willcl-ark picture willcl-ark  Â·  4Comments

SPIRY-RO picture SPIRY-RO  Â·  4Comments

ZmnSCPxj picture ZmnSCPxj  Â·  4Comments

AndiMacTen picture AndiMacTen  Â·  3Comments

gallizoltan picture gallizoltan  Â·  3Comments