lnd: Crash on startup, CNCT and SRVR reporting "bad-txns-vout-empty"

Background

LND was working fine until I did a graceful reboot of the server and started getting these errors on LND’s startup. After displaying the error, LND crashes.

2018-05-31 07:44:27.133 [INF] CNCT: ChannelArbitrator(0fae5dcc5ca92ea0b2a7eecdd2b6355be9810a44f336d0c052c4ecf4d482b7bd:0): starting state=StateBroadcastCommit
2018-05-31 07:44:27.136 [TRC] CNCT: ChannelArbitrator(0fae5dcc5ca92ea0b2a7eecdd2b6355be9810a44f336d0c052c4ecf4d482b7bd:0): attempting state step with trigger=chainTrigger from state=StateBroadcastCommit
2018-05-31 07:44:27.136 [INF] CNCT: ChannelArbitrator(0fae5dcc5ca92ea0b2a7eecdd2b6355be9810a44f336d0c052c4ecf4d482b7bd:0): force closing chan
2018-05-31 07:44:27.195 [DBG] LNWL: ChannelPoint(0fae5dcc5ca92ea0b2a7eecdd2b6355be9810a44f336d0c052c4ecf4d482b7bd:0), starting local commitment: (*lnwallet.commitment)(0xc4206a6000)({
 height: (uint64) 1,
 isOurs: (bool) true,
 ourMessageIndex: (uint64) 0,
 theirMessageIndex: (uint64) 0,
 ourHtlcIndex: (uint64) 0,
 theirHtlcIndex: (uint64) 0,
 txn: (*wire.MsgTx)(0xc4200c5800)({
  Version: (int32) 2,
  TxIn: ([]*wire.TxIn) (len=1 cap=1) {
   (*wire.TxIn)(0xc420330de0)({
    PreviousOutPoint: (wire.OutPoint) 0fae5dcc5ca92ea0b2a7eecdd2b6355be9810a44f336d0c052c4ecf4d482b7bd:0,
    SignatureScript: ([]uint8) {
    },
    Witness: (wire.TxWitness) <nil>,
    Sequence: (uint32) 2148093020
   })
  },
  TxOut: ([]*wire.TxOut) {
  },
  LockTime: (uint32) 548200124
 }),
 sig: ([]uint8) (len=70 cap=70) {
  00000000  30 44 02 20 7f 71 13 f0  72 31 bd fc ba 4e 3f e2  |0D. .q..r1...N?.|
  00000010  a0 ad e3 75 c6 00 b9 7e  15 2e 86 84 4c 11 10 c4  |...u...~....L...|
  00000020  ae 87 c1 f0 02 20 2e 54  61 e7 2b e8 db 23 a1 53  |..... .Ta.+..#.S|
  00000030  99 23 7f 8f d2 67 b2 26  9c 8a f1 7d 6b df a2 af  |.#...g.&...}k...|
  00000040  cf ef 9e 3f ed 1e                                 |...?..|
 },
 ourBalance: (lnwire.MilliSatoshi) 0 mSAT,
 theirBalance: (lnwire.MilliSatoshi) 19000 mSAT,
 fee: (btcutil.Amount) 0.00001081 BTC,
 feePerKw: (lnwallet.SatPerKWeight) 1494,
 dustLimit: (btcutil.Amount) 0.00000573 BTC,
 outgoingHTLCs: ([]lnwallet.PaymentDescriptor) <nil>,
 incomingHTLCs: ([]lnwallet.PaymentDescriptor) <nil>,
 outgoingHTLCIndex: (map[int32]*lnwallet.PaymentDescriptor) {
 },
 incomingHTLCIndex: (map[int32]*lnwallet.PaymentDescriptor) {
 }
})

2018-05-31 07:44:27.198 [DBG] LNWL: ChannelPoint(0fae5dcc5ca92ea0b2a7eecdd2b6355be9810a44f336d0c052c4ecf4d482b7bd:0), starting remote commitment: (*lnwallet.commitment)(0xc4206a6240)({
 height: (uint64) 1,
 isOurs: (bool) false,
 ourMessageIndex: (uint64) 0,
 theirMessageIndex: (uint64) 0,
 ourHtlcIndex: (uint64) 0,
 theirHtlcIndex: (uint64) 0,
 txn: (*wire.MsgTx)(0xc4200c5840)({
  Version: (int32) 2,
  TxIn: ([]*wire.TxIn) (len=1 cap=1) {
   (*wire.TxIn)(0xc420330e40)({
    PreviousOutPoint: (wire.OutPoint) 0fae5dcc5ca92ea0b2a7eecdd2b6355be9810a44f336d0c052c4ecf4d482b7bd:0,
    SignatureScript: ([]uint8) {
    },
    Witness: (wire.TxWitness) <nil>,
    Sequence: (uint32) 2148093020
   })
  },
  TxOut: ([]*wire.TxOut) {
  },
  LockTime: (uint32) 548200124
 }),
 sig: ([]uint8) {
 },
 ourBalance: (lnwire.MilliSatoshi) 0 mSAT,
 theirBalance: (lnwire.MilliSatoshi) 19000 mSAT,
 fee: (btcutil.Amount) 0.00001081 BTC,
 feePerKw: (lnwallet.SatPerKWeight) 1494,
 dustLimit: (btcutil.Amount) 0.00000546 BTC,
 outgoingHTLCs: ([]lnwallet.PaymentDescriptor) <nil>,
 incomingHTLCs: ([]lnwallet.PaymentDescriptor) <nil>,
 outgoingHTLCIndex: (map[int32]*lnwallet.PaymentDescriptor) {
 },
 incomingHTLCIndex: (map[int32]*lnwallet.PaymentDescriptor) {
 }
})

2018-05-31 07:44:27.198 [INF] HSWC: Removing channel link with ChannelID(bdb782d4f4ecc452c0d036f3440a81e95b35b6d2cdeea7b2a02ea95ccc5dae0f)
2018-05-31 07:44:27.199 [ERR] CNCT: unable to mark link inactive: channel link not found
2018-05-31 07:44:27.201 [INF] CNCT: Broadcasting force close transaction, ChannelPoint(0fae5dcc5ca92ea0b2a7eecdd2b6355be9810a44f336d0c052c4ecf4d482b7bd:0): (*wire.MsgTx)(0xc4200c5800)({
 Version: (int32) 2,
 TxIn: ([]*wire.TxIn) (len=1 cap=1) {
  (*wire.TxIn)(0xc420330de0)({
   PreviousOutPoint: (wire.OutPoint) 0fae5dcc5ca92ea0b2a7eecdd2b6355be9810a44f336d0c052c4ecf4d482b7bd:0,
   SignatureScript: ([]uint8) {
   },
   Witness: (wire.TxWitness) (len=4 cap=4) {
    ([]uint8) <nil>,
    ([]uint8) (len=71 cap=144) {
     00000000  30 44 02 20 7f 71 13 f0  72 31 bd fc ba 4e 3f e2  |0D. .q..r1...N?.|
     00000010  a0 ad e3 75 c6 00 b9 7e  15 2e 86 84 4c 11 10 c4  |...u...~....L...|
     00000020  ae 87 c1 f0 02 20 2e 54  61 e7 2b e8 db 23 a1 53  |..... .Ta.+..#.S|
     00000030  99 23 7f 8f d2 67 b2 26  9c 8a f1 7d 6b df a2 af  |.#...g.&...}k...|
     00000040  cf ef 9e 3f ed 1e 01                              |...?...|
    },
    ([]uint8) (len=72 cap=144) {
     00000000  30 45 02 21 00 c2 06 1f  eb d7 30 bb d3 b5 10 9b  |0E.!......0.....|
     00000010  27 2b 29 cf 54 30 4c ef  db a0 7c b0 57 c2 87 99  |'+).T0L...|.W...|
     00000020  0c a8 c1 83 81 02 20 0a  5d 30 fd 18 eb 6a 4e a4  |...... .]0...jN.|
     00000030  08 26 4f 41 96 21 54 e5  91 47 d6 b7 65 8b 29 4a  |.&OA.!T..G..e.)J|
     00000040  fe 3a 1f 45 da c9 7e 01                           |.:.E..~.|
    },
    ([]uint8) (len=71 cap=500) {
     00000000  52 21 02 c1 ce fd 79 99  2f ac af 20 e3 47 fc da  |R!....y./.. .G..|
     00000010  e3 c4 07 45 cf e9 6b 8d  ef b3 b8 c9 94 45 3d 26  |...E..k......E=&|
     00000020  76 8d eb 21 02 d4 db 80  c2 f2 9d 88 43 0d 25 6f  |v..!........C.%o|
     00000030  41 29 c9 fc 88 8d b5 c7  3a 72 a6 f8 ce 22 82 ce  |A)......:r..."..|
     00000040  b4 bd 22 9b 0c 52 ae                              |.."..R.|
    }
   },
   Sequence: (uint32) 2148093020
  })
 },
 TxOut: ([]*wire.TxOut) {
 },
 LockTime: (uint32) 548200124
})

2018-05-31 07:44:27.212 [ERR] CNCT: ChannelArbitrator(0fae5dcc5ca92ea0b2a7eecdd2b6355be9810a44f336d0c052c4ecf4d482b7bd:0): unable to broadcast close tx: -26: 16: bad-txns-vout-empty
2018-05-31 07:44:27.212 [ERR] CNCT: unable to advance state: -26: 16: bad-txns-vout-empty
2018-05-31 07:44:27.212 [ERR] SRVR: unable to start server: -26: 16: bad-txns-vout-empty

Your environment

  • LND 0.4.2 release
  • Linux b0900f03bc92 4.9.0-6-amd64 #1 SMP Debian 4.9.82-1+deb9u3 (2018-03-02) x86_64 GNU/Linux
  • bitcoind 0.16.0
  • runs in Docker container

Steps to reproduce

I’m unsure, but looking at the logs here’s probably how it went (to be confirmed):

  • Bob opens a channel to Alice with very small balance on their side (19000 mSAT)
  • Alice reboots her node
  • error happens on startup

Expected behaviour

LND gracefully prints an error without crashing and forgets about the dust in the channel.

Actual behaviour

LND generates a transaction with no output and crashes because it cannot broadcast it.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 17 (8 by maintainers)

Most upvoted comments

@vegardengen thanks this is essentially what I did. I applied both patches described in this thread on top of 0.5 master just so I could even run it. Switched on debug mode and compiled. Then used abandonchannel to abandon the 1000 satoshi channel that was causing the headache. I think I’m all good now!