I haven’t had this happen yet or needed to do it, so proceed at your own risk here. Have a full read through before proceeding. 
The logs provide critical insight into why LND is not available: LND is repeatedly crashing due to a panic error in the bbolt database, specifically with the error freepages: failed to get all reachable pages (page 34104: multiple references). This indicates database corruption in LND’s bbolt database, which is used to store channel states, wallet data, and other critical information. The Tor issues noted previously are secondary and likely not the root cause of LND’s failure to start. Below are focused actions to address this issue, prioritizing the database corruption.
Analysis
- LND Crash Cause:
- The error panic: freepages: failed to get all reachable pages (page 34104: multiple references) occurs when LND attempts to open its bbolt database (channel.db). This is a known issue with bbolt (a key-value store used by LND) and typically indicates corruption, often caused by:
- Improper shutdown: Power loss or abrupt termination of LND.
- Disk issues: Hardware failure, full disk, or file system errors.
- Resource constraints: Insufficient memory or CPU causing incomplete writes.
- The repeated crashes (every minute from 12:25 to 13:02 on April 21, 2025) show that LND is stuck in a restart loop, unable to proceed past opening the database.
- Tor Issues:
- The lightning_tor_1 logs still show 404 errors and circuit timeouts, but these are likely irrelevant to the LND crash. Tor is bootstrapping successfully (reaching 100% in the logs), and the lack of INTRODUCE2 cells suggests LND isn’t even attempting to establish connections due to the crash.
- Configuration Warning:
- The warning Config ‘bitcoin.active’ is deprecated, please remove it indicates an outdated configuration in lnd.conf. While not the cause of the crash, it should be addressed to ensure compatibility with LND 0.18.5-beta.
- Impact:
- LND’s failure to start means your Umbrel Lightning node is offline, preventing channel operations, payments, or routing.
- The database corruption could risk channel funds if not handled carefully, especially if channels need to be closed or restored.
Focused Actions
The primary goal is to resolve the bbolt database corruption and get LND running again. Below are targeted steps, ordered by priority. Proceed with caution and ensure you have backups of critical files (especially the channel.backup file) before making changes.
1. Back Up Critical Files
Before attempting repairs, back up LND’s data to prevent potential loss of channel funds:
- SSH into your Umbrel node:
ssh umbrel@umbrel.local
- Copy the LND data directory:
cp -r ~/umbrel/app-data/lightning/data/lnd ~/umbrel/lnd-backup-$(date +%F-%H%M%S)
- Locate and back up the channel.backup file (Static Channel Backup, critical for recovering funds):
find ~/umbrel/app-data/lightning/data/lnd -name channel.backup cp ~/umbrel/app-data/lightning/data/lnd/channel.backup ~/umbrel/channel-backup-$(date +%F-%H%M%S).backup
- Copy the backup to an external device (e.g., USB drive or another computer) to ensure it’s safe.
2. Check Disk and System Health
Database corruption is often linked to disk or resource issues. Verify the system’s health:
df -h
Ensure the partition hosting ~/umbrel has at least a few GB free. If full, free up space by removing unnecessary files or apps via the Umbrel dashboard.
sudo dmesg | grep -i error sudo fsck /dev/sdX
Replace /dev/sdX with your disk (e.g., /dev/sda1). Run fsck only if the disk is unmounted or the system is in recovery mode.
top free -m
Ensure memory and CPU usage are not maxed out. If resources are low, stop non-essential Umbrel apps via the dashboard.
3. Attempt to Repair the bbolt Database
The channel.db file is likely corrupted. You can attempt to repair it using bbolt tools or by compacting the database.
- Install bbolt CLI tool (if not already present):
go install go.etcd.io/bbolt/cmd/bbolt@latest
Ensure $GOPATH/bin is in your PATH:
export PATH=$PATH:~/go/bin
- Stop Umbrel to prevent LND from accessing the database:
sudo ~/umbrel/scripts/stop
- Locate the channel.db file: The database is typically at:
~/umbrel/app-data/lightning/data/lnd/data/graph/mainnet/channel.db
cp ~/umbrel/app-data/lightning/data/lnd/data/graph/mainnet/channel.db ~/umbrel/channel.db.backup
- Check the database for errors:
bbolt check ~/umbrel/app-data/lightning/data/lnd/data/graph/mainnet/channel.db
This will report any inconsistencies. If errors are found, proceed to compacting.
- Compact the database (to attempt repair):
bbolt compact -o ~/umbrel/channel.db.compacted ~/umbrel/app-data/lightning/data/lnd/data/graph/mainnet/channel.db
If successful, replace the original database:
mv ~/umbrel/app-data/lightning/data/lnd/data/graph/mainnet/channel.db ~/umbrel/channel.db.corrupted mv ~/umbrel/channel.db.compacted ~/umbrel/app-data/lightning/data/lnd/data/graph/mainnet/channel.db
sudo ~/umbrel/scripts/start
docker logs -f lightning_lnd_1
Check if LND starts without the freepages panic. If it still crashes, proceed to the next step.
4. Rebuild the channel.db Using Static Channel Backup (SCB)
If the database cannot be repaired, you may need to rebuild channel.db and restore channels using the channel.backup file. This step risks force-closing channels, which could result in loss of funds if not done correctly, so proceed only if necessary.
sudo ~/umbrel/scripts/stop
- Move the corrupted channel.db:
mv ~/umbrel/app-data/lightning/data/lnd/data/graph/mainnet/channel.db ~/umbrel/channel.db.corrupted
- Start Umbrel to create a new channel.db:
sudo ~/umbrel/scripts/start
LND will create a new, empty channel.db.
- Restore channels using SCB:
- Access the LND container:
docker exec -it lightning_lnd_1 sh
- Use lncli to initiate recovery:
lncli restorechanbackup --multi_file /lnd/channel.backup
Replace /lnd/channel.backup with the path to your channel.backup file inside the container (check with find /lnd -name channel.backup).
- This will attempt to force-close channels and recover funds to your on-chain wallet. Monitor the process:
lncli pendingchannels lncli closedchannels
docker logs -f lightning_lnd_1
Ensure LND starts and channels are being restored.
- Warning: Channel restoration may take time and requires peers to be online. If channels don’t close properly, you may need to contact channel peers or use tools like chantools for advanced recovery (see step 6).
5. Address Deprecated Configuration
The bitcoin.active warning should be resolved to ensure compatibility:
It’s either here,
nano ~/umbrel/app-data/lightning/data/lnd/lnd.conf
or
nano ~/umbrel/app-data/lightning/data/lightning/settings.json
I suggest making a backup of the file first.
- Remove or comment out the bitcoin.active line:
;bitcoin.active=1
sudo ~/umbrel/scripts/stop sudo ~/umbrel/scripts/start
See later comment, as this prob doesn’t work any longer.
6. Use chantools for Advanced Recovery (if Necessary)
If the above steps fail or channel restoration is incomplete, use chantools to recover funds from the corrupted database or SCB:
go install github.com/lightninglabs/chantools@latest
. ## If this doesn’t work, see comments at bottom.
- Dump data from corrupted channel.db:
chantools dumpchanneldb --db ~/umbrel/channel.db.corrupted
This extracts channel information for analysis.
chantools forceclose --channeldb ~/umbrel/channel.db.corrupted --publish
This attempts to close channels using the corrupted database.
chantools rescueclosed --backup ~/umbrel/channel-backup-<date>.backup
Follow the chantools prompts to recover funds to your on-chain wallet.
7. Reset LND (Last Resort)
If all else fails, reset LND and start fresh. This will lose channel state unless you have a valid SCB:
sudo ~/umbrel/scripts/stop
- Delete LND data (excluding wallet.db and channel.backup):
mv ~/umbrel/app-data/lightning/data/lnd ~/umbrel/lnd-backup-$(date +%F-%H%M%S) mkdir -p ~/umbrel/app-data/lightning/data/lnd
- Restore wallet.db and channel.backup (if available):
cp ~/umbrel/lnd-backup-<date>/wallet.db ~/umbrel/app-data/lightning/data/lnd/ cp ~/umbrel/lnd-backup-<date>/channel.backup ~/umbrel/app-data/lightning/data/lnd/
sudo ~/umbrel/scripts/start
- Restore channels (as in step 4).
8. Address Tor Issues (Secondary)
The Tor circuit timeouts and 404 errors may persist but are not the primary issue. If LND starts successfully, test connectivity:
cat ~/umbrel/app-data/lightning/tor/data/hostname
docker exec lightning_lnd_1 lncli getinfo docker exec lightning_lnd_1 lncli listpeers
- If Tor issues persist, configure Tor bridges (as outlined in the previous response) or consider switching to clearnet (requires a public IP).
Monitoring and Validation
After each step, monitor logs to confirm progress:
docker logs -f lightning_lnd_1 docker logs -f lightning_app_1
Look for:
- LND starting without the freepages panic.
- Successful blockchain sync (lncli getinfo shows synced_to_chain: true).
- Channel restoration progress (if using SCB).
Important Notes
- Channel Funds: If you have open channels, do not skip the backup step. A valid channel.backup file is critical for recovering funds. If channels are force-closed, you may incur on-chain fees, and funds may be locked in timelocks (CLTV).
- Community Support: If you encounter issues, share sanitized logs (remove public keys, addresses) on the Lightning Labs GitHub (GitHub · Where software is built).
- Hardware Check: If corruption persists, test your storage device (e.g., SD card or SSD) for failures, as hardware issues are a common cause.
Next Steps
Start with steps 1–3 (backup, system health, database repair). If the bbolt compact fails, proceed to step 4 (SCB restore) or step 6 (chantools). Avoid resetting LND (step 7) unless absolutely necessary.