lnd icon indicating copy to clipboard operation
lnd copied to clipboard

[bug]: lncli deletepayments -all crashes node (hard boot)

Open AuthenticityBTC opened this issue 2 months ago • 4 comments

Pre-Submission Checklist

  • [x] I have searched the existing issues and believe this is a new bug.
  • [x] I am not asking a question about how to use lnd, but reporting a bug (otherwise open a discussion).

LND Version

0.20.0-beta.rc1

LND Configuration

[db] db.no-rev-log-amt-data=true

db.backend=postgres

db.postgres.dsn=postgres://db.postgres.timeout=360s db.use-native-sql=true

db.postgres.maxconnections=50

Backend Version

Bitcoin Core version v28.0

Backend Configuration

N/A

OS/Distribution

Ubuntu 24.04.3 LTS

Bug Details & Steps to Reproduce

When running lncli deletepayments --all (in a screen), after a few hours, my entire node halts and requires a hard reboot. Initially, there is no performance impact, but later in the day the crash occurs. At this time, I am unable to SSH to the LND server or ping it. The postgres DB is still operational. I have included some graphs showing what occurs to the lead up to the crash.

Image Image Image Image Image Image

Expected Behavior

deletepayments to fail gracefully, or split the transaction into segments to prevent a crash (or have an option for max payments deleted).

Debug Information

No response

Environment

No response

AuthenticityBTC avatar Oct 24 '25 16:10 AuthenticityBTC

Thanks for reporting. I will escalate internally.

Do you know how many payments LND was trying to delete?

ffranr avatar Nov 03 '25 13:11 ffranr

Thanks for reporting. I will escalate internally.

Do you know how many payments LND was trying to delete?

Is a LNCLI command to count the number of deletable payments? I'm unsure how to get a count

AuthenticityBTC avatar Nov 06 '25 18:11 AuthenticityBTC

If you never deleted payments and did a lot of rebalancing, a good first estimate would be lncli listpayments --max_payments 1, reporting the value of last_index_offset.

bitromortac avatar Nov 07 '25 08:11 bitromortac

If you never deleted payments and did a lot of rebalancing, a good first estimate would be lncli listpayments --max_payments 1, reporting the value of last_index_offset.

"first_index_offset": "852214",
"last_index_offset": "852214",
"total_num_payments": "0"

Guess that makes sense why I'm up to 850k over 2 years...

AuthenticityBTC avatar Nov 07 '25 14:11 AuthenticityBTC