Raspiblitz: Lnd gets announced as 127.0.0.1:9735

Created on 27 Oct 2020  路  6Comments  路  Source: rootzoll/raspiblitz

Bug

After LAN got disconnected and reconnected, 1ml.com shows up my node with a new address: 127.0.0.1:9735. This Address keeps active till reboot and is shown in my menu screen.

Environment

  • Clearnet (no IPSec or TOR)
  • OpenVPN Service which connects as Client to VPS with static IP (port forwardings at the VPS ok)
  • DynDNS with duckdns.org (blitz is recognizing the public static ip fine)
  • curl -s http://v4.ipv6-test.com/api/myip.php from internet.sh works if my I-Net is up, hangs if it is down

Expected Behaviour

Never write private or loopback IPs as a publicIP

All 6 comments

I did a pull request which could be related to this issue (not sure if it will fix it)

https://github.com/rootzoll/raspiblitz/pull/1719

// I debugged this down to 00infoBlitz.sh:

 ln_getInfo=$(sudo -u bitcoin /usr/local/bin/lncli --macaroonpath=${lnd_macaroon_dir}/readonly.macaroon --tlscertpath=${lnd_dir}/tls.cert getinfo 2>/dev/null)
 ln_external=$(echo "${ln_getInfo}" | grep "uris" -A 1 | tr -d '\n' | cut -d '"' -f4)

The json gets his data (127.0.0.1) from the lncli call above

// Fixed with restart lnd service... So lnd service seems to cause this issue itself if started without connectivity?!

Which IP is announced is set by parameter when LND starts - and is is getting started by sytstemd service:
https://github.com/rootzoll/raspiblitz/blob/eea158949899f816d59f9adca19b1d8972814036/home.admin/assets/lnd.service#L14

And the value of ${publicIP} is set by the raspiblitz.conf with:
https://github.com/rootzoll/raspiblitz/blob/eea158949899f816d59f9adca19b1d8972814036/home.admin/assets/lnd.service#L12

So the question would be: Why is their a 127.0.0.1 as publicIP in raspiblitz.conf?

The value get written there by config-script internet.sh update-publicip:
https://github.com/rootzoll/raspiblitz/blob/eea158949899f816d59f9adca19b1d8972814036/home.admin/config.scripts/internet.sh#L210

And that is called during bootup (before LND is started by systemd) by _bootstrap.sh:
https://github.com/rootzoll/raspiblitz/blob/eea158949899f816d59f9adca19b1d8972814036/home.admin/_bootstrap.sh#L481

So how to fix .. I would recommend to fix this in inernet.sh by not setting 127.0.01 as public IP ... but what to set as an replacement if that case is detected? If we keep it blank it could be that LND not starting because the parameter would be invalid. Should boostrap 'block' at that point until internet is available? I am not sure yet what the best solution would be. Open for input.

Oh i missed that part where the service gets started with that parameter. So at this point (publicIP=127.0.0.1) i would ignore the sed call in internet.sh. Maybe internet.sh should just quit if connectivity fails and wait for it.

After that, i think i found the reason for 127.0.0.1 here:
https://github.com/rootzoll/raspiblitz/issues/312#issuecomment-462675101

https://github.com/rootzoll/raspiblitz/blob/eea158949899f816d59f9adca19b1d8972814036/home.admin/config.scripts/internet.sh#L132

So no ip is not a solution. 127.0.0.1 is still a bad idea.

i will test this:

    if [ "${publicIP}" != "127.0.0.1" ]; then
      sudo sed -i "s/^publicIP=.*/publicIP='${publicIP}'/g" /mnt/hdd/raspiblitz.conf
    else
      echo "Skip set 127.0.0.1 as lnd --externalip"
    fi

@ChuckNorrison can you try if the PR #1729 solves this? You can use a v1.6.1 release and then get the PR with UPDATE > PATCH > PATCHMENU > PR > 1729 and restart.

Already done successful :) awesome thanks

Perfect ... I merged the PR and will be part of v1.6.2 release. Closing issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ChuckNorrison picture ChuckNorrison  路  4Comments

cedricwalter picture cedricwalter  路  5Comments

frennkie picture frennkie  路  5Comments

rootzoll picture rootzoll  路  4Comments

rootzoll picture rootzoll  路  3Comments