-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
unable to start server: historical channel bucket has not yet been created #6155
unable to start server: historical channel bucket has not yet been created #6155
Comments
I looked at where this error is coming from and it seems like there was an oversight in the last DB migration. This only seems to happen if you skip a few versions. I have a simple patch that should allow you to start up. Can you try if that fixes the problem for you while we work on a more permanent fix? This should allow you to compile a version of lnd with the patch:
Here's the patch file: |
Thanks, today I actually tried going back to v13 and it is currently resyncing... hasn't hit an issue yet. Once that is done I will retry with a backup of my db. Although I am not sure if I have all the tools to run make on my windows machine? I am just using compiled binaries. |
looks like I was able to catch up to latest block and then switch to 14 and it hasn't crashed yet |
Is is the migration or just that this node didn't have the contents of the historical bucket at all, since it was a few years old? See this PR: #6159 |
Ah I see the solution in the patch file now: diff --git a/channeldb/db.go b/channeldb/db.go
index 1b56d3de3..f93befd51 100644
--- a/channeldb/db.go
+++ b/channeldb/db.go
@@ -353,9 +353,14 @@ func (d *DB) Wipe() error {
// the database are created.
func initChannelDB(db kvdb.Backend) error {
err := kvdb.Update(db, func(tx kvdb.RwTx) error {
+ _, err := tx.CreateTopLevelBucket(historicalChannelBucket)
+ if err != nil {
+ return err
+ }
+
meta := &Meta{}
// Check if DB is already initialized.
- err := fetchMeta(meta, tx)
+ err = fetchMeta(meta, tx)
if err == nil {
return nil
} I think ensuring it always exists is better than handling this special case. In the end, the behavior will be the same (it'll return chan not found instead). |
I think we actually also want this as well: diff --git a/channeldb/db.go b/channeldb/db.go
index 92a49c2f8..2ad2803da 100644
--- a/channeldb/db.go
+++ b/channeldb/db.go
@@ -329,6 +329,7 @@ var dbTopLevelBuckets = [][]byte{
metaBucket,
closeSummaryBucket,
outpointBucket,
+ historicalChannelBucket,
} When a channel is closed we use |
For older nodes, this bucket was never created, so we'll get an error if we try and query it. In this commit, we catch this error like we do when a given channel doesn't have the information (but the bucket actually exists). Fixes lightningnetwork#6155
For older nodes, this bucket was never created, so we'll get an error if we try and query it. In this commit, we catch this error like we do when a given channel doesn't have the information (but the bucket actually exists). Fixes lightningnetwork#6155
For older nodes, this bucket was never created, so we'll get an error if we try and query it. In this commit, we catch this error like we do when a given channel doesn't have the information (but the bucket actually exists). Fixes lightningnetwork#6155
For older nodes, this bucket was never created, so we'll get an error if we try and query it. In this commit, we catch this error like we do when a given channel doesn't have the information (but the bucket actually exists). Fixes lightningnetwork#6155
Background
I have an older casa hardware node which I am trying to restore on a local node on my windows machine. Following the instructions here: https://support.keys.casa/hc/en-us/articles/360050420391-Casa-Node-Funds-Recovery-Guide
I synced a fresh bitcoin node with pruning disabled. I then copied my lnd data folder from the casa node to my windows pc and started lnd and ran ./lncli unlock using my casa password. The lnd node unlocks and lnd looks to start successfully syncing.
After a few hours the lnd node seems to just shut down without any clear error other then the title of this post (which I cannot seem to find a single google result for)
Here is a sample of the tail end of the shutdown:
I also tried the recovery method by deleting the wallet.db file and reinitializing the wallet using lncli create and my seed. It successfully entered recovery mode, began syncing for a few hours and then eventually shut down with the exact same error.
Your environment
Steps to reproduce
Steps above
Expected behaviour
lnd should sync and allow me to access my funds
Actual behaviour
Shutdown and crash with error: "unable to start server: historical channel bucket has not yet been created"
The text was updated successfully, but these errors were encountered: