Skip to content

[bug]: LND halts when closing channels when configured with postgres #10320

@AuthenticityBTC

Description

@AuthenticityBTC

Pre-Submission Checklist

  • I have searched the existing issues and believe this is a new bug.
  • 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 closing channels and the closing tx is included in the currently mined block, LND halts and begins to throw a large number of DB issues.

failing link: unable to update commitment: db tx retries exceeded with error: internal error

`
2025-10-18 22:43:43.236 [ERR] GRDB: UpdateEdgePolicy faild: inserting chan policy extra TLVs: unable to insert channel_policy(38550) extra signed field(55555): ERROR: could not serialize access due to read/write dependencies among transactions (SQLSTATE 40001)

2025-10-18 22:43:44.246 [ERR] GRDB: UpdateEdgePolicy faild: inserting chan policy extra TLVs: unable to insert channel_policy(38550) extra signed field(55555): ERROR: could not serialize access due to read/write dependencies among transactions (SQLSTATE 40001)

2025-10-18 22:43:45.257 [ERR] GRDB: UpdateEdgePolicy faild: inserting chan policy extra TLVs: unable to insert channel_policy(38550) extra signed field(55555): ERROR: could not serialize access due to read/write dependencies among transactions (SQLSTATE 40001)

2025-10-18 22:43:46.267 [ERR] GRDB: UpdateEdgePolicy faild: inserting chan policy extra TLVs: unable to insert channel_policy(38550) extra signed field(55555): ERROR: could not serialize access due to read/write dependencies among transactions (SQLSTATE 40001)

2025-10-18 22:43:47.276 [ERR] GRDB: UpdateEdgePolicy faild: inserting chan policy extra TLVs: unable to insert channel_policy(38550) extra signed field(55555): ERROR: could not serialize access due to read/write dependencies among transactions (SQLSTATE 40001)

2025-10-18 22:43:48.287 [ERR] GRDB: UpdateEdgePolicy faild: inserting chan policy extra TLVs: unable to insert channel_policy(38550) extra signed field(55555): ERROR: could not serialize access due to read/write dependencies among transactions (SQLSTATE 40001)

2025-10-18 22:43:49.302 [ERR] GRDB: UpdateEdgePolicy faild: inserting chan policy extra TLVs: unable to insert channel_policy(38550) extra signed field(55555): ERROR: could not serialize access due to read/write dependencies among transactions (SQLSTATE 40001)`

I originally had max connections as 10 and timeout as 0, I attempted to change the settings to 50 / 3600s and the issue persists

Expected Behavior

Closing channels to not back up DB transactions

Debug Information

No response

Environment

LNDg, BOS. LND and Postgres running on different servers. Postgres 17

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions