lightningnetwork / lnd

Lightning Network Daemon ⚡️
MIT License
7.73k stars 2.09k forks source link

[bug]: updatechanpolicy error: "channel from self node has no policy" #7247

Open AbelLykens opened 1 year ago

AbelLykens commented 1 year ago

Background

For my testnet node, when doing a updatechanpolicy, I get an error:

# lncli updatechanpolicy --base_fee_msat 0 --fee_rate_ppm 50 --time_lock_delta 69
[lncli] rpc error: code = Unknown desc = channel from self node has no policy

Your environment

Steps to reproduce

Run lncli updatechanpolicy --base_fee_msat 0 --fee_rate_ppm 50 --time_lock_delta 69.

Expected behaviour

Policies are updated

Actual behaviour

Error ... Not much more in logs either. Nothing more, actually.

GeorgeTsagk commented 1 year ago

Hey @AbelLykens

Any chance your channel's funding tx didn't have enough confirmations? Does this error still appear if you try to update the channel policy?

AbelLykens commented 1 year ago

Thanks for your reply. Should I look at a specific channel? Because updatechanpolicy should update all, right? Not sure I understand what you ask me to do, sorry

GeorgeTsagk commented 1 year ago

Yes it should update all channels if none is specified. My question was about if any of your channels were newly created at the moment of executing updatechanpolicy

AbelLykens commented 1 year ago

Some are only a few hours old... But not really new...

GeorgeTsagk commented 1 year ago

Could you try running updatechanpolicy individually for each channel and see if it works & for which chans?

AbelLykens commented 1 year ago

All fail:

# lncli listchannels | jq -r '.channels[].channel_point' | while read point; do lncli updatechanpolicy --base_fee_msat 0 --fee_rate_ppm 50 --time_lock_delta 69 --chan_point $point; done | head
[lncli] rpc error: code = Unknown desc = channel from self node has no policy
[lncli] rpc error: code = Unknown desc = channel from self node has no policy
[lncli] rpc error: code = Unknown desc = channel from self node has no policy
[...]
[lncli] rpc error: code = Unknown desc = channel from self node has no policy
[lncli] rpc error: code = Unknown desc = channel from self node has no policy
[lncli] rpc error: code = Unknown desc = channel from self node has no policy
[lncli] rpc error: code = Unknown desc = channel from self node has no policy
AbelLykens commented 1 year ago

5861 indicates only open channels can be updated, but I think I try to do that.

There is also #4899, which says something about feereport, if I try feereport:

# lncli feereport
[lncli] rpc error: code = Unknown desc = no policy for outgoing channel 2014803380853735424 

Digging further:

# lncli getchaninfo 2014803380853735424
{
    "channel_id": "2014803380853735424",
    "chan_point": "2a846144a9375ee97880e75f99fdc8189f30d74a2117df5d30c45647dddd0abd:0",
    "last_update": 1603201623,
    "node1_pub": "02bd47793654f41e97e4e29a3bf0d9e6f859fe8ef1e475add8004a648188bd2a0e",
    "node2_pub": "030425d8babe3ab6dfc065e69dd8b10ce6738c86ea7d634324c913e21620fa5eaf",
    "capacity": "5000000",
    "node1_policy": {
        "time_lock_delta": 40,
        "min_htlc": "1000",
        "fee_base_msat": "1000",
        "fee_rate_milli_msat": "1000",
        "disabled": true,
        "max_htlc_msat": "4950000000",
        "last_update": 1603201623
    },
    "node2_policy": null
}
AbelLykens commented 1 year ago

Can't close that one...

# lncli closechannel --force --chan_point 2a846144a9375ee97880e75f99fdc8189f30d74a2117df5d30c45647dddd0abd:0
[lncli] rpc error: code = Unknown desc = channel not found

It's not in the list of channels either:

# lncli listchannels | grep 2a846144a9375ee97880e75f99fdc8189f30d74a2117df5d30c45647dddd0abd:0 | wc -l
0
AbelLykens commented 1 year ago

note added: abandonchannel is a dangerous command and can lead to loss of funds if used incorrectly - ask in our slack channel if unsure

# lncli abandonchannel --chan_point 2a846144a9375ee97880e75f99fdc8189f30d74a2117df5d30c45647dddd0abd:0 --i_know_what_i_am_doing 
[lncli] rpc error: code = Unknown desc = unable to find closed channel summary

Not sure what to do now :)

yyforyongyu commented 1 year ago

2a846144a9375ee97880e75f99fdc8189f30d74a2117df5d30c45647dddd0abd

Looks like this channel is from 2 years ago?

AbelLykens commented 1 year ago

Could be, I don't see it in listchannels...

guggero commented 1 year ago

Just to rule out anything out of the ordinary: Did you ever use any chantools commands on this node?

AbelLykens commented 1 year ago

Nah, chantools is not installed on this machine (yet? :wink: )

yyforyongyu commented 1 year ago

I did see it here. Werid as the channel seems to be not closed.

AbelLykens commented 1 year ago

Right... It's odd. No idea why it's not in my DB/listchannels. Shall I try the chantools thing and remove it?

yyforyongyu commented 1 year ago

Shall I try the chantools thing and remove it?

Yeah give it a shot!

AbelLykens commented 1 year ago
# ./chantools removechannel --testnet --channel 2a846144a9375ee97880e75f99fdc8189f30d74a2117df5d30c45647dddd0abd:0 --channeldb /root/.lnd/data/graph/testnet/channel.db
2022-12-13 19:07:05.048 [INF] CHAN: chantools version v0.10.6 commit 
2022-12-13 19:07:05.255 [INF] CHDB: Checking for schema update: latest_version=29, db_version=29
2022-12-13 19:07:05.259 [INF] CHDB: Checking for optional update: prune_revocation_log=false, db_version=empty
Error: channel not found
AbelLykens commented 1 year ago

Anything I can do? :)