Skip to content

Postgres v13.3 or v14.1 backend failing with LND v0.14.1-beta #6103

@miketwenty1

Description

@miketwenty1

Background

I'm able to successfully run a node with bbolt/boltdb.
When I try to run a node with postgres, after doing a lncli create I get an error "Unable to process chain backend block connected notification: context canceled".

Note it does successfully create the tables before crashing:

  • channeldb_kv
  • decayedlogdb_kv
  • macaroondb_kv
  • towerclientdb_kv
  • towerserverdb_kv
  • walletdb_kv

Can reproduce this with clean environments. Verified Bitcoind node, postgres db is in working order.

Your environment

  • version of lnd
    v0.14.1-beta
  • which operating system (uname -a on *Nix)
    ubuntu 20.04
  • version of btcd, bitcoind, or other backend
    bitcoind v22.0
  • any other relevant environment details
    postgres version 13.3

Steps to reproduce

  • lnd.conf setup for postgres
[db]
db.backend=postgres

[postgres]
db.postgres.dsn=postgres://postgres:PASSWORD@hostname:5432/dbname
db.postgres.timeout=60s
db.postgres.maxconnections=1000
  • lncli create
  • crash with error in logs

Expected behaviour

No crash

Actual behaviour

crash [ERR] LNWL: Unable to process chain backend block connected notification: context canceled v13.3
or "error loading chain control: unable to create chain control: unable to create wallet: context canceled" v14.1
crash `

Logs when I use bbolt/botdb

2021-12-20 03:09:52.444 [INF] LTND: We're not running within systemd
2021-12-20 03:09:52.446 [INF] LTND: Waiting for chain backend to finish sync, start_height=714882
2021-12-20 03:09:53.479 [INF] LNWL: Started rescan from block 0000000000000000000a2daeed9f01f2ca39cd2839026c3f12ceb0f388f815ce (height 714553) for 0 addresses
2021-12-20 03:09:53.502 [INF] LNWL: Catching up block hashes to height 714562, this might take a while
2021-12-20 03:09:53.576 [INF] LNWL: Done catching up block hashes
2021-12-20 03:09:53.576 [INF] LNWL: Rescanned through block 000000000000000000081f53c492703c785f6fff23a92aa7325ff5603682e4f7 (height 714562)
2021-12-20 03:10:15.447 [INF] LNWL: Catching up block hashes to height 714882, this might take a while
2021-12-20 03:10:15.448 [INF] LNWL: Done catching up block hashes
2021-12-20 03:10:15.448 [INF] LNWL: Finished rescan for 0 addresses (synced to block 00000000000000000004a713a1136faaeb84bf34ff2117b6c5c65e7031772d21, height 714882)
2021-12-20 03:10:15.863 [INF] LTND: Chain backend is fully synced (end_height=714882)!
2021-12-20 03:10:15.863 [WRN] HLCK: check: disk space configured with 0 attempts, skipping it
2021-12-20 03:10:15.863 [WRN] HLCK: check: tls configured with 0 attempts, skipping it
2021-12-20 03:10:15.870 [INF] PRNF: PeerNotifier starting
2021-12-20 03:10:15.870 [INF] NTFN: New block epoch subscription
2021-12-20 03:10:15.871 [INF] NTFN: New block epoch subscription
2021-12-20 03:10:15.872 [INF] BRAR: Starting contract observer, watching for breaches.
2021-12-20 03:10:15.874 [INF] NTFN: New block epoch subscription
2021-12-20 03:10:15.874 [INF] DISC: Authenticated Gossiper is starting
2021-12-20 03:10:15.874 [INF] NTFN: New block epoch subscription
2021-12-20 03:10:15.877 [INF] CRTR: FilteredChainView starting
2021-12-20 03:10:15.883 [INF] CRTR: Filtering chain using 0 channels active
2021-12-20 03:10:15.886 [INF] CRTR: Prune tip for Channel Graph: height=714882, hash=00000000000000000004a713a1136faaeb84bf34ff2117b6c5c65e7031772d21
2021-12-20 03:10:15.888 [INF] NTFN: New block epoch subscription
2021-12-20 03:10:15.890 [INF] NTFN: New block epoch subscription
2021-12-20 03:10:15.890 [INF] HSWC: Starting HTLC Switch
2021-12-20 03:10:15.890 [INF] CHFT: Adding 0 channels to event store
2021-12-20 03:10:15.890 [INF] CHBU: Starting chanbackup.SubSwapper
2021-12-20 03:10:15.890 [INF] NTFN: New block epoch subscription

Logs when using postgres v13.3

2021-12-20 03:22:49.411 [INF] LTND: We're not running within systemd
2021-12-20 03:22:49.413 [INF] LTND: Waiting for chain backend to finish sync, start_height=714884
2021-12-20 03:22:50.446 [INF] LNWL: Started rescan from block 000000000000000000035fba7bdfed50a131d12685d9edb0ba0ae2f95993a0cd (height 714555) for 0 addresses
2021-12-20 03:22:50.458 [CRT] CHDB: Caught unhandled error: context canceled
2021-12-20 03:22:50.458 [INF] CHDB: Sending request for shutdown
2021-12-20 03:22:50.458 [INF] LTND: Received shutdown request.
2021-12-20 03:22:50.458 [INF] LTND: Shutting down...
2021-12-20 03:22:50.458 [INF] LTND: Gracefully shutting down.
2021-12-20 03:22:50.458 [ERR] LNWL: Unable to process chain backend block connected notification: context canceled
2021-12-20 03:22:50.465 [INF] LNWL: Catching up block hashes to height 714562, this might take a while
2021-12-20 03:22:50.566 [INF] LNWL: Done catching up block hashes
2021-12-20 03:22:50.566 [INF] LNWL: Rescanned through block 000000000000000000081f53c492703c785f6fff23a92aa7325ff5603682e4f7 (height 714562)
2021-12-20 03:22:51.420 [INF] RPCS: Stopping RPC Server
2021-12-20 03:22:51.420 [INF] RPCS: Stopping RouterRPC Sub-RPC Server
2021-12-20 03:22:51.420 [INF] RPCS: Stopping InvoicesRPC Sub-RPC Server
2021-12-20 03:22:51.420 [INF] RPCS: Stopping VersionRPC Sub-RPC Server
2021-12-20 03:22:51.420 [INF] RPCS: Stopping WatchtowerRPC Sub-RPC Server
2021-12-20 03:22:51.420 [INF] RPCS: Stopping WatchtowerClientRPC Sub-RPC Server
2021-12-20 03:22:51.420 [INF] RPCS: Stopping SignRPC Sub-RPC Server
2021-12-20 03:22:51.420 [INF] RPCS: Stopping WalletKitRPC Sub-RPC Server
2021-12-20 03:22:51.420 [INF] RPCS: Stopping AutopilotRPC Sub-RPC Server
2021-12-20 03:22:51.420 [INF] RPCS: Stopping ChainRPC Sub-RPC Server
2021-12-20 03:22:51.421 [INF] LTND: Shutdown complete

Logs when using postgres v14.1

2021-12-20 04:11:56.336 [INF] LTND: We're not running within systemd
2021-12-20 04:11:56.336 [INF] LTND: Waiting for wallet encryption password. Use `lncli create` to create a wallet, `lncli unlock` to unlock an existing wallet, or `lncli changepassword` to change the password of an existing wallet and unlock it.
2021-12-20 04:12:28.182 [INF] LNWL: Opened wallet
2021-12-20 04:12:28.234 [INF] CHRE: Primary chain is set to: bitcoin
2021-12-20 04:12:28.246 [INF] CHRE: Initializing bitcoind backed fee estimator in CONSERVATIVE mode
2021-12-20 04:12:28.246 [INF] LNWL: Started listening for bitcoind transaction notifications via ZMQ on 100.0.10.82:28333
2021-12-20 04:12:28.246 [INF] LNWL: Started listening for bitcoind block notifications via ZMQ on 100.0.10.82:28332
2021-12-20 04:12:28.909 [INF] LNWL: The wallet has been unlocked without a time limit
2021-12-20 04:12:28.920 [CRT] CHDB: Caught unhandled error: context canceled
2021-12-20 04:12:28.921 [INF] CHDB: Sending request for shutdown
2021-12-20 04:12:28.921 [INF] LTND: Received shutdown request.
2021-12-20 04:12:28.921 [INF] LTND: Shutting down...
2021-12-20 04:12:28.921 [INF] LTND: Gracefully shutting down.
2021-12-20 04:12:28.921 [ERR] LTND: unable to create chain control: unable to create wallet: context canceled
2021-12-20 04:12:28.921 [ERR] LTND: Shutting down because error in main method: error loading chain control: unable to create chain control: unable to create wallet: context canceled
2021-12-20 04:12:28.922 [INF] LTND: Shutdown complete

error loading chain control: unable to create chain control: unable to create wallet: context canceled

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions