I’m experiencing issues with opening LND, and the log error suggests the problem lies with LND itself, not StartOS. The error message is: “LTND: unable to open graph DB: ReadVarBytes; sig is larger than the max allowed size [count 179, max 80]”.
After reaching out to the Lightning Labs team, they recommended using chantools_compactdb
. I installed chantools
and attempted to run the command:
chantools compactdb \
--sourcedb ~/embassy-data/package-data/volumes/lnd/data/main/data/graph/mainnet/channel.db \
--destdb ./embassy-data/package-data/volumes/lnd/data/main/data/graph/mainnet/compacted.db
However, this resulted in an error: “Error: error opening source DB: open /root/embassy-data/package-data/volumes/lnd/data/main/data/graph/mainnet/channel.db: no such file or directory”.
To troubleshoot, I used the command sudo find / -name channel.db
(from the default SSH location, not root), which returned the path /embassy-data/package-data/volumes/lnd/data/main/data/graph/mainnet/channel.db
. This suggests that channel.db
is indeed located in the expected location.
I’m unsure where I’m going wrong. Should I not be executing chantools
from the root user? Any assistance would be appreciated.
~/embassy-data/package-data/volumes/lnd/data/main/data/graph/mainnet/
won’t exist.
/embassy-data/package-data/volumes/lnd/data/main/data/graph/mainnet/
does exist.
./embassy-data/package-data/volumes/lnd/data/main/data/graph/mainnet/
might sometimes exist.
I modified the --sourcedb
to read:
--sourcedb /embassy-data/package-data/volumes/lnd/data/main/data/graph/mainnet/channel.db \
However, I still encountered an error:
Error: error opening source DB: open /embassy-data/package-data/volumes/lnd/data/main/data/graph/mainnet/channel.db: no such file or directory
./embassy-data/… did not work either
Has anyone out there successfully run chantools? If so, please confirm if you execute chantools commands as root (sudo /usr/lib/startos/scripts/chroot-and-upgrade).
I found that, after using the (sudo /usr/lib/startos/scripts/chroot-and-upgrade) script, it makes linux all weird and makes it not be able to find the /embassy-data/package/volumes/lnd/data/main/data/graph/mainnet/channel.db
file.
So after using that script, I exit the startOS and exit SSH.
I go back in and use the following commands
sudo -i
curl -L https://github.com/lightninglabs/chantools/releases/download/v0.12.2/chantools-linux-amd64-v0.12.2.tar.gz | tar -zxv -f- --strip-components=1 -C /usr/local/bin
(you might need a slightly different URL for a different chantools version and/or for different OS/processor).
Then run the chantool compactdb command with:
chantools compactdb \ --sourcedb /embassy-data/package-data/volumes/lnd/data/main/data/graph/mainnet/channel.db \ --destdb /embassy-data/package-data/volumes/lnd/data/main/data/graph/mainnet/compacted.db
What I’m stuck on now though is what do I do next? How do I get LND to use this newly compacted file named “compact.db” instead of the original un-compacted file “channel.db”?
Is the best way by simply renaming both files and “trick” LND into using the newly compacted file?
If you’ve started LND since the compacting… you’re back to square one and must do it all over again.
If you haven’t started LND you can rename channel.db
to channel.bak
and compacted.db
to channel.db
-
mv channel.db channel.bak
-
mv compacted.db channel.db
Good to know. I did not start up LND since compacting with chantools compactdb
.
I swapped the file names as you noted with the mv
commands.
Now when I’m running LND for the first time since renaming, can I run with database compacting at startup set to “disabled” (off)?
Sure. You can set the configuration however you like.
Thanks for all the help Stu!
Right now it’s considering the newly compacted file as successfully compacted.
Now it’s back to trying to sync the rest of the graph.
What service log output lines should I be expecting to see when it has proper/healthy syncing? Even if it takes a whole week from here, I would love to at least have a peace of mind that it’s making syncing progress.
Thanks again!!
It should sync in minutes then just work. If not, then the issue never was anything to do with compacting.