question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Restoring from lnd rescue file (_provision.setup.sh fail)

See original GitHub issue

Trying to recover from backup_file to fresh SD card with existing blockchain data:

- **Preparing SSD**

\*************************************
\* JUST MAKING BACKUP TO SD CARD
\*************************************
please wait ..
\# *** LND.RESCUE --> BACKUP
mv: cannot move '/home/admin/lnd.version.info' to '/mnt/hdd/lnd/version.info': No such file or directory
chown: cannot access '/mnt/hdd/lnd/version.info': No such file or directory
\# Stopping lnd...
\# OK

tar: Removing leading `/' from member names
tar: /mnt/hdd/lnd: Cannot stat: No such file or directory
tar: Exiting with failure status due to previous errors
error='backup is empty'

!!!! This will DELETE your personal data & POSSIBLE FUNDS from the HDD !!!!
--> It will keep Blockchain data - so you dont have to download/copy again.
Press ENTER to really continue - CTRL+c to CANCEL (last chance)

stopping services ... (please wait)
- swap
- background
- lnd
- blockchain
selective delete ... (please wait)
\*************************
OK - the HDD is now clean
\*************************
reboot -> sudo shutdown -r now
power off -> sudo shutdown now
Connection to 192.168.0.126 closed by remote host.
Connection to 192.168.0.126 closed.
  • INSERT FRESH SD 1.7.1 SSH in to the new node and continue

NOTE: When promted to your fresh Rapsiblitz there are three options but none point to *From Resucue File* which is found two steps later when choosing FRESHSETUP

  • Setup New Blitz
<USE BLOCKCHAIN> <DELETE DATA>

Choose a new name →Entering existing old name.

Choose Client: → LND

Choose NEW/OLD → OLD

Choose Recover → LNDRESCUE

UPLOAD RESCUE FILE with instructions

In new terminal, inside the folder that contains the rescue-file: scp -r ./lnd-rescue-*.tar.gz bitcoin@192.168.0.126:/home/bitcoin/temp/upload/

PW: raspiblitz → 100% switching back to other terminal

→ file found

Get hint: The Raspiblitz uses 3 Passwords and that setting A + B need to be set now. No further hints to when PW C will be set.

→ PW A accepted → Pw B accepted

Next step fails:

\###########################################################
\# /home/admin/raspiblitz.log

\***********************************************
Running RaspiBlitz Bootstrap 1.7.1
Sun 17 Oct 15:12:35 BST 2021
\***********************************************
\# *** blitz.ssh.sh checkrepair
\# countKeyFiles(8)
\# OK: SSHD RUNNING
No HDMI switch found. 
No FS EXPAND needed. needsExpansion(0) fsexpanded(1)
No SSHRESET switch found. 
No UASP FIX needed (1st-try).
Waiting for HDD/SSD ...
total 604
drwxr-xr-x   2 root root   4096 Oct 12 00:12 .
drwxr-xr-x 118 root root   4096 Oct 12 00:12 ..
-rw-r--r--   1 root root 565189 Jan 31  2020 moduli
-rw-r--r--   1 root root   1580 Jan 31  2020 ssh_config
-rw-r--r--   1 root root   3250 Jan 31  2020 sshd_config
-rw-------   1 root root   1381 Oct 12 00:12 ssh_host_dsa_key
-rw-r--r--   1 root root    606 Oct 12 00:12 ssh_host_dsa_key.pub
-rw-------   1 root root    513 Oct 12 00:12 ssh_host_ecdsa_key
-rw-r--r--   1 root root    178 Oct 12 00:12 ssh_host_ecdsa_key.pub
-rw-------   1 root root    411 Oct 12 00:12 ssh_host_ed25519_key
-rw-r--r--   1 root root     98 Oct 12 00:12 ssh_host_ed25519_key.pub
-rw-------   1 root root   1823 Oct 12 00:12 ssh_host_rsa_key
-rw-r--r--   1 root root    398 Oct 12 00:12 ssh_host_rsa_key.pub
-rw-r--r--   1 root root    338 Mar  5  2021 ssh_import_id
wifiIsSet=0
hddBackupLocationAvailable=0
hddRestoreConfigAvailable=0
memRestoreConfigAvailable=0
wifiRestore=0
wifiBackup=0
No UASP FIX needed (2nd-try).
isMounted: 0
Checking for UASP deactivation ...
HDD already part of system: 0
Temp mounting (1) data drive (sda)
Temp mounting (1) result: 1
HDD is there but not AutoMounted yet - Waiting for user Setup/Update
\# df 
Filesystem     1K-blocks      Used Available Use% Mounted on
/dev/root       14987608   4385864   9945396  31% /
devtmpfs         1933976         0   1933976   0% /dev
tmpfs            1968600         0   1968600   0% /dev/shm
tmpfs            1968600      8632   1959968   1% /run
tmpfs               5120         0      5120   0% /run/lock
tmpfs            1968600         0   1968600   0% /sys/fs/cgroup
tmpfs              32768         4     32764   1% /var/cache/raspiblitz
/dev/mmcblk0p1    258095     30357    227738  12% /boot
tmpfs             393720         0    393720   0% /run/user/1000
/dev/sda1      960379920 415068516 496456980  46% /mnt/hdd
\# lsblk -o NAME,FSTYPE,LABEL 
NAME        FSTYPE LABEL
sda                
└─sda1      ext4   BLOCKCHAIN
mmcblk0            
├─mmcblk0p1 vfat   boot
└─mmcblk0p2 ext4   rootfs
\# RASPIBLITZ DATA DRIVE Status

\# BASICS
isMounted=1
isBTRFS=0
hddRaspiData=0
hddRaspiVersion=''
isSSD=0
datadisk='sda'
datapartition='sda1'
hddBlocksBitcoin=1
hddBlocksLitecoin=0
hddBytes=1000203091968
hddGigaBytes=931
hddUsedInfo='396G (46%)'
hddDataFreeKB=496456980
hddAdapterUSB='174c:1153'
hddAdapterUSAP=0

\# RAID
isRaid=0
raidCandidates=0

\# SWAP
isSwapExternal=0

Displaying Info Message: Please Login for Setup
\## WAIT LOOP: USER SETUP/UPDATE/MIGRATION
\# PROVISION PROCESS with setupPhase(setup)
Temp mounting (2) data drive (sda)
Temp mounting (2) result: 1
Refreshing links between directories/drives ..
\# Sourcing /mnt/hdd/raspiblitz.conf 
\# RASPIBLITZ CONFIG FILE
raspiBlitzVersion='1.7.1'
lcdrotate=1
lightning=lnd
network=bitcoin
chain=main
hostname='ZERF'
runBehindTor=on
\# Sourcing /var/cache/raspiblitz/temp/raspiblitz.setup 
\# RASPIBLITZ SETUP STATE
network=bitcoin
hostname=ZERF
lightning=lnd
network=bitcoin
chain=main
setPasswordA=1
setPasswordB=1
lndrescue='/home/bitcoin/temp/upload/lnd-rescue-7d9e128a83992e1746d6975840f92935.tar.gz'
\# df 
Filesystem     1K-blocks      Used Available Use% Mounted on
/dev/root       14987608   4285924  10045336  30% /
devtmpfs         1933976         0   1933976   0% /dev
tmpfs            1968600         0   1968600   0% /dev/shm
tmpfs            1968600     25032   1943568   2% /run
tmpfs               5120         0      5120   0% /run/lock
tmpfs            1968600         0   1968600   0% /sys/fs/cgroup
tmpfs              32768        20     32748   1% /var/cache/raspiblitz
/dev/mmcblk0p1    258095     30357    227738  12% /boot
tmpfs             393720         0    393720   0% /run/user/1000
tmpfs             393720         0    393720   0% /run/user/1001
/dev/sda1      960379920 415068536 496456960  46% /mnt/hdd
\# lsblk -o NAME,FSTYPE,LABEL 
NAME        FSTYPE LABEL
sda                
└─sda1      ext4   BLOCKCHAIN
mmcblk0            
├─mmcblk0p1 vfat   boot
└─mmcblk0p2 ext4   rootfs
\# Update /home/admin/raspiblitz.info 
state=provision
message='Starting Provision'
baseimage=raspios_arm64
cpu=aarch64
board=rp4
ramMB=3844
ramGB=4
network=bitcoin
chain=main
localip='192.168.0.126'
online='1'
dnsworking=1
fsexpanded=1
displayClass=lcd
displayType=
setupStep=0
setupPhase='setup'
fundRecovery=0
hostname=
hddCandidate='sda'
hddGigaBytes=931
hddBlocksBitcoin=1
hddBlocksLitecoin=0
hddGotMigrationData=
\# migrationFile()
\# setting PASSWORD A

OK - password A changed for user pi, root, admin & bitcoin
...
Calling _provision.setup.sh for basic setup tasks ..
EXIT _provision.setup.sh BECAUSE OF ERROR STATE (5)
This can also happen if _provision.setup.sh has syntax errors
\# /home/admin/raspiblitz.provision-setup.log

\###################################
\# _provision.setup.sh
\###################################
\*** Prepare bitcoin ***
mkdir: cannot create directory ‘/mnt/hdd/bitcoin’: File exists
mkdir: cannot create directory ‘/mnt/hdd/bitcoin/blocks’: File exists
mkdir: cannot create directory ‘/mnt/hdd/bitcoin/chainstate’: File exists
File Exists: /mnt/hdd/bitcoin/bitcoin.conf --> 1
\# setting PASSWORD B
\# OK -> RPC Password B changed
\# Reboot is needed
...
\*** Start bitcoin (SETUP) ***
- This can take a while ..
\# (0/50) checking if bitcoind is running ... 
\# (1/50) checking if bitcoind is running ... 
\# (2/50) checking if bitcoind is running ... 
\# (3/50) checking if bitcoind is running ... 
OK bitcoin startup successful 
Prepare Lightning (lnd)
\############## Setup LND
FAIL: missing passwordC in (/var/cache/raspiblitz/temp/raspiblitz.setup)!
\***********************************************************
ERROR - please report to development team
\***********************************************************
state(error) message(_provision.setup.sh fail)
https://github.com/rootzoll/raspiblitz#support
command to shutdown --> off
admin@raspberrypi:~ $ 

→ off

Blitz shuts down.


Unplug power to reboot.

SSH back in to the raspiblitz, now with new PW: A Now prompted to

PLEASE START WITH A FRESH SD CARD IMAGE (leads to same result)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:44 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
openomscommented, Jan 17, 2022

This should be fixed in the latest release candidate image. The download link is in the dev branch. Bugs found there will be actively fixed so beat is to keep it up to date by running the shortcut command: patch in the command line.

2reactions
joernroedercommented, Jan 9, 2022

ran into the same issue yesterday night, ported over the changes of the _provision.setup.sh script into my fresh v1.7.1 script folder and was able to restore a lnd-rescue-*.tar.gz seamlessly. Thanks, great job!

Read more comments on GitHub >

github_iconTop Results From Across the Web

v1.7.1 Restoring from channel backup (_provision.setup.sh fail)
Experimenting with SCB recovery to a node with existing blockchain data. This process fails trying to import the SCB.
Read more >
Lightning Node Setup, Backup, and Recovery - Charles Hill
The chantools program will (hopefully) help you recover your funds from an old copy of your lnd's channel.db . But before we get...
Read more >
Disaster recovery - Builder's Guide
Learn how to recover your funds in the event of a catastrophic failure.
Read more >
Backup/Recovery - PlebNet Wiki
LND can store a backup file of your channels using a method called Static Channel Backups (SCB). Instead of trying to maintain the...
Read more >
FAQ - Frequently Asked Questions - raspiblitz
How to backup LND data in a rescue situation see next question "How can I recover my coins from a failing RaspiBlitz?". How...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found