lnd: lncli feereport fails with error "no policy for outgoing channel" from a previously cooperatively closed channel, and open channels

Background

I’m having trouble with channels being closed, and then I get an error with lncli feereport as follows:

@lnd:~$ lncli feereport
[lncli] rpc error: code = Unknown desc = no policy for outgoing channel REDACTED

and the log has

[ERR] RPCS: [/lnrpc.Lightning/FeeReport]: no policy for outgoing channel REDACTED

if I examine the channel:

$ lncli getchaninfo REDACTED
{
    "channel_id": "REDACTED",
    "chan_point": "0000000000000000000000000000000000000000000000000000000000000000:0",
    "last_update": 0,
    "node1_pub": "REDACTED",
    "node2_pub": "REDACTED",
    "capacity": "0",
    "node1_policy": null,
    "node2_policy": null
}

This happened over 2 nodes, one testnet, one mainnet. In both instances the chan_point is all zeros

However, one instance has a single nodeX_policy as null, while the other instance above, both are null.

If I examine the output of lncli closechannels and find the node pubkey it’s a cooperative close in both instances, e.g.

{
    "channel_point": "REDACTED:0",
    "chan_id": "REDACTED",
    "chain_hash": "REDACTED",
    "closing_tx_hash": "REDACTED",
    "remote_pubkey": "REDACTED",
    "capacity": "20000",
    "close_height": 1637586,
    "settled_balance": "0",
    "time_locked_balance": "0",
    "close_type": "COOPERATIVE_CLOSE",
    "open_initiator": "INITIATOR_REMOTE",
    "close_initiator": "INITIATOR_UNKNOWN",
    "resolutions": [
    ]
},

I’m fully synced:

"synced_to_chain": true,
"synced_to_graph": true,

Your environment

  • lnd version 0.11.0-beta commit=v0.11.0-beta
  • Ubuntu 16.04, Linux lnd 4.4.0-179-generic #209-Ubuntu SMP Fri Apr 24 17:48:44 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
  • testnet instance is backed with btcd version 0.20.1-beta
  • mainnet instance is backed with Bitcoin Core RPC client version v0.18.0.0-2472733a24a9364e4c6233ccd04166a26a68cc65
  • these are long-running nodes, which have gone through upgrades from the earliest public LND releases

Steps to reproduce

An unknown something happens with a closed channel.

Run lncli feereport and get an error

Expected behaviour

I should see output with a list of fees.

Actual behaviour

I get an error

[lncli] rpc error: code = Unknown desc = no policy for outgoing channel REDACTED

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 22 (21 by maintainers)

Most upvoted comments

This is the patch I am using to get back up and running in the meantime if anyone is stuck with this.

diff --git a/routing/router.go b/routing/router.go
index af1e8d75..396fbdd2 100644
--- a/routing/router.go
+++ b/routing/router.go
@@ -2255,7 +2255,7 @@ func (r *ChannelRouter) ForAllOutgoingChannels(cb func(*channeldb.ChannelEdgeInf
                e, _ *channeldb.ChannelEdgePolicy) error {

                if e == nil {
-                       return fmt.Errorf("channel from self node has no policy")
+                       return nil
                }

                return cb(c, e)
diff --git a/rpcserver.go b/rpcserver.go
index 8d39547f..4d74ca11 100644
--- a/rpcserver.go
+++ b/rpcserver.go
@@ -5756,8 +5756,7 @@ func (r *rpcServer) FeeReport(ctx context.Context,

                // Self node should always have policies for its channels.
                if edgePolicy == nil {
-                       return fmt.Errorf("no policy for outgoing channel %v ",
-                               chanInfo.ChannelID)
+                       return nil
                }

                // We'll compute the effective fee rate by converting from a