## Lightning Payment failed (Could not find a route)

4

1

I tried to move funds between my two nodes. From A to B.

'A' node is

035ac00f3bfe7fd991ec7cd9b5fcad0bdaa338c343895e56f4ada7df181bc43622@46.101.114.3:9735


'B' node is

02b0de5dece2ae1c6cf62dba60e584268b8f27babb936a849e998c2170802efc9b@5.9.72.48:9735


First I made an invoice on 'B' node with the full amount available on 'A' node (150000 satoshi), but it didn't worked like the second time, when I calculate already the fees into the transaction, so I requested an invoice with 147900 satoshis.

The second invoice I made with the 'B' node:

root@Debian-94-stretch-64-minimal ~/lightning # cli/lightning-cli invoice 147900 1 movingfunds
{
"payment_hash": "7d7f8720cfa3d745bc15698e7f5908ddf658fa6241cfeb51e3085d338140766a",
"expiry_time": 1529652202,
"expires_at": 1529652202,
"bolt11": "lnbc1479n1pdje9w6pp504lcwgx050t5t0q4dx887kggmhm937nzg887k50rppwn8q2qwe4qdqjd4hhv6twvan82mnywvcqp25ajsmsdp9g9e9xcdwl26f6h37xusn4d2q30mde40lvekrhlcajxs9y6c70qzcmhxcu6kjm6wtm2f6u5dgutn4q3tsluzrmmtvuhw65gpg920uv"
}


I tried to pay with the 'A' node:

root@LightningN:~/c-lightning/lightning# cli/lightning-cli pay -k maxfeepercent=5 bolt11=lnbc1479n1pdje9w6pp504lcwgx050t5t0q4dx887kggmhm937nzg887k50rppwn8q2qwe4qdqjd4hhv6twvan82mnywvcqp25ajsmsdp9g9e9xcdwl26f6h37xusn4d2q30mde40lvekrhlcajxs9y6c70qzcmhxcu6kjm6wtm2f6u5dgutn4q3tsluzrmmtvuhw65gpg920uv
{ "code" : 205, "message" : "Could not find a route", "data" :
{
"getroute_tries": 3,
"sendpay_tries": 2,
"failures": [
{
"erring_index": 1,
"failcode": 4103,
"erring_node": "02f6725f9c1c40333b67faea92fd211c183050f28df32cac3f9d69685fe9665432",
"erring_channel": "520051:68:0",
"route": [
{
"id": "02f6725f9c1c40333b67faea92fd211c183050f28df32cac3f9d69685fe9665432",
"channel": "527929:1112:1",
"msatoshi": 155190,
"delay": 326
},
{
"id": "02e8334fcab092f496bce7421e8d711d41cbbfef0429bb30149784418df53dd1b1",
"channel": "520051:68:0",
"msatoshi": 154189,
"delay": 312
},
{
"channel": "520051:63:0",
"msatoshi": 153188,
"delay": 298
},
{
"channel": "519778:1560:0",
"msatoshi": 153187,
"delay": 154
},
{
"id": "02b0de5dece2ae1c6cf62dba60e584268b8f27babb936a849e998c2170802efc9b",
"channel": "528515:2266:1",
"msatoshi": 152188,
"delay": 10
}
]
},
{
"erring_index": 3,
"failcode": 4103,
"erring_channel": "528515:2266:1",
"channel_update": "b5bf64e0b15971ffb29e148080d717baac4aa707bd66214fd15585fdb1035af068de16ea66698a780814564733606ac8d1aa06ef9ddcce0d7b1b2e593f8734b06fe28c0ab6f1b372c1a6a246ae63f74f931e8365e15a089c68d61900000000000810830008da00015b2b7930000000900000000000000001000003e700000001",
"route": [
{
"id": "02f6725f9c1c40333b67faea92fd211c183050f28df32cac3f9d69685fe9665432",
"channel": "527929:1112:1",
"msatoshi": 154711,
"delay": 312
},
{
"channel": "528371:1680:1",
"msatoshi": 153710,
"delay": 298
},
{
"channel": "514137:241:0",
"msatoshi": 153709,
"delay": 154
},
{
"id": "02b0de5dece2ae1c6cf62dba60e584268b8f27babb936a849e998c2170802efc9b",
"channel": "528515:2266:1",
"msatoshi": 152710,
"delay": 10
}
]
}
]
} }


What's wrong? As I see the final ID is my second nodes ID so, they need to see each other.

1

Seems you are a bit unlucky here: the pay command tried two different routes which both failed, and then couldn't find a third route. The first one failed at node 02f6725f9c1 which I happen to have access to. So let's see what the error was. The path tried to route 147900 mSatoshi over that channel (plus some fees but let's ignore that for now). At the time of the attempt the channel looked like this from the node:

\$ lightning-cli listpeers | jq '.peers[] | select(.id == "02e8334fcab092f496bce7421e8d711d41cbbfef0429bb30149784418df53dd1b1")'
{
"id": "02e8334fcab092f496bce7421e8d711d41cbbfef0429bb30149784418df53dd1b1",
"connected": false,
"channels": [
{
"state": "CHANNELD_NORMAL",
"short_channel_id": "520051:68:0",
"channel_id": "8f48128e5be0d9f7c0d142388b22cd8eb7e624333c25ae0de9790486101c4579",
"funding_txid": "79451c10860479e90dae253c3324e6b78ecd228b3842d1c0f7d9e05b8e12488f",
"msatoshi_to_us": 0,
"msatoshi_to_us_min": 0,
"msatoshi_to_us_max": 0,
"msatoshi_total": 50000000,
"dust_limit_satoshis": 546,
"max_htlc_value_in_flight_msat": 18446744073709552000,
"their_channel_reserve_satoshis": 0,
"our_channel_reserve_satoshis": 546,
"channel_reserve_satoshis": 0,
"spendable_msatoshi": 0,
"htlc_minimum_msat": 0,
"their_to_self_delay": 144,
"our_to_self_delay": 144,
"to_self_delay": 144,
"max_accepted_htlcs": 483,
"status": [
],
"in_payments_offered": 0,
"in_msatoshi_offered": 0,
"in_payments_fulfilled": 0,
"in_msatoshi_fulfilled": 0,
"out_payments_offered": 0,
"out_msatoshi_offered": 0,
"out_payments_fulfilled": 0,
"out_msatoshi_fulfilled": 0
}
]
}


As you can see, all funds are owned by the remote side 02e8334fcab, so there is no way for us to send in that direction (if we have 10 bucks on the table and the other side owns all of it, I can't possibly pay them with the money). The pay command therefore saw the failure and attempted again.

For the second attempt, the payment still goes over 02f6725f9c1, but this time we have sufficient balance to forward it:

lightning-cli listpeers | jq '.peers[] | select(.id == "02ad6fb8d693dc1e4569bcedefadf5f72a931ae027dc0f0c544b34c1c6f3b9a02b")'
{
"connected": true,
"channels": [
{
"state": "CHANNELD_NORMAL",
"short_channel_id": "528371:1680:1",
"channel_id": "129a51f6055fb609e163c44ca10f060474348048d239ba66e3c0422a45b09b1f",
"funding_txid": "1e9bb0452a42c0e366ba39d24880347404060fa14cc463e109b65f05f6519a12",
"msatoshi_to_us": 501772528,
"msatoshi_to_us_min": 0,
"msatoshi_to_us_max": 502073023,
"msatoshi_total": 2000000000,
"dust_limit_satoshis": 546,
"their_channel_reserve_satoshis": 0,
"our_channel_reserve_satoshis": 20000,
"channel_reserve_satoshis": 0,
"spendable_msatoshi": 481772528,
"htlc_minimum_msat": 0,
"their_to_self_delay": 144,
"our_to_self_delay": 240,
"to_self_delay": 144,
"max_accepted_htlcs": 483,
"status": [
"CHANNELD_NORMAL:Reconnected, and reestablished."
],
}
]
}


But this time the last hop (025e77156e4c5) before reaching your node failed to forward. We can't inspect that last hop without access, but since you mention that you are the other side of the channel you use lightning-cli listpeers to see whether the other side has sufficient balance (msatoshi_to_us < msatoshi_total). My guess is that you opened the channel, and therefore own the entire balance (if you already own all of the money on the table how should they pay you?).

If you first try to transfer some funds somewhere else (just buy some pixels on satoshis.place or read an article on yalls), then you should be able to route to your node.

Thanks @cdecker for the advice, I tried it to buy some pixels on Satoshi's Place with Node 'A' but I got the following error: http://snippi.com/s/t22p5ow

If I type listpayments command I get the following result: http://snippi.com/s/oc4d8t6

– ZsZolee – 2018-06-23T20:41:27.617

Seems the payment took a bit longer than expected so the pay command decided to send it to the background. It should eventually resolve into either success or failure. – cdecker – 2018-06-24T12:19:30.963

It gone to 'failure'. I tried even on the other Node, the same happened: http://snippi.com/s/d4406by

– ZsZolee – 2018-06-24T12:39:20.600

The majority of those fail with failcode=16394, which is the numeric code for unknown_next_peer. This means that the node that reported the failure does not (or more likely no longer has) a channel to the next hop. This should eventually be recognized by your node through gossiping. The other codes 4103 and 4108 are for temporary_channel_failure and fee_insufficient. All of these seem to be caused by stale network information. Is your node connected and processing gossip (logging about channels being updated)? – cdecker – 2018-06-24T13:31:20.797

I see only the orriginal channels when I use 'listpeers' at both of my nodes. Node 'A': http://snippi.com/s/njz6yf9

Node 'B': http://snippi.com/s/13itv67

– ZsZolee – 2018-06-24T15:08:35.790

That's how it's supposed to work, since only those are your direct peers. listnodes and listchannels will show all known nodes and channels. – cdecker – 2018-06-24T18:48:33.370

what should I check, when I run those two commands? I got so much results, that I can't even see all of it, just the last 'X' amount. – ZsZolee – 2018-06-25T15:06:13.050

If you see channel_update and channel_announcement lines in the lightningd output, then it should be syncing alright. – cdecker – 2018-06-25T20:39:19.497

If I run the 'listnodes' and 'listchannels', on both of my nodes, I don't see in the (partial) results any 'channel_update' or 'channel_announcement'. What should I do now? :( – ZsZolee – 2018-06-26T09:41:58.903

I don't mean when you call lightning-cli, I mean the output of the lightningd process. – cdecker – 2018-06-26T18:08:28.807

Finally I got what you needed. Here is the log: http://snippi.com/s/3jb5hy2

– ZsZolee – 2018-07-02T21:06:54.177