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
[bug]: LND panics when calling kvdb.lastCompactionDate
.
#8638
Comments
Thanks for raising this issue. I'd recommend to keep lnd shutdown for the moment to not publish any outdated state. |
Could you try the compaction with chantools which is described a bit here and see if that succeeds? #8532 (comment) |
It seem to have compacted the db with no issue.
|
Ok that's great, could you check that the |
Seems like the |
Moving the
No I'm using an SSD. I'm not discarding corruption, but since moving the file and starting LND from scratch didn't work it doesn't seem that corruption is involved. func lastCompactionDate(dbFile string) (time.Time, error) {
zeroTime := time.Unix(0, 0)
tsFile := fmt.Sprintf("%s%s", dbFile, LastCompactionFileNameSuffix)
if !fileExists(tsFile) {
return zeroTime, nil
}
tsBytes, err := ioutil.ReadFile(tsFile)
if err != nil {
return zeroTime, err
}
tsNano := byteOrder.Uint64(tsBytes)
return time.Unix(0, int64(tsNano)), nil
} If I understand correctly, if the .last-compacted file does not exists, the function returns early. Which is odd, since the file |
Background
LND panics when calling
lastCompactionDate
:lnd[5921]: panic: runtime error: index out of range [7] with length 0
. This happened after a power outage that rebooted my machine. I was able to avoid the issue by settingdb.bolt.auto-compact=false
.Your environment
lnd
: lnd version 0.17.4-beta commit=v0.17.4-betauname -a
on *Nix): Debian GNU/Linux 11 (bullseye) aarch64btcd
,bitcoind
, or other backend: v26.1.0Expected behaviour
LND should be able to startup with
db.bolt.auto-compact=true
, or at least fail gracefully with better error handling.Actual behaviour
LND panics, see stacktrace:
The text was updated successfully, but these errors were encountered: