<p>Okay, I will try to expand on my comment in an answer. Currently, it's difficult to determine why a payment is failing with our core lightning node because it doesn't provide much information.</p>
<p>However, in the last year, I worked on a lightning network metrics specification, which is available <a href="https://lnmetrics.info/rfc" rel="nofollow noreferrer">here</a> or on <a href="https://github.com/LNOpenMetrics/lnmetrics.rfc/blob/main/metrics/metric_1.md" rel="nofollow noreferrer">Github</a>. Using this specification, you can try to find the channel through which the payment is being sent and potentially gather useful metrics or ideas to improve the current system.</p>
<p>Regarding your question, there are several well-known problems that we're trying to work around or resolve.</p>
<p>You were correct in assuming that &quot;local failed&quot; means that your node could not forward the payment.</p>
<p>Regarding the general failure, this is not your fault, but one of the nodes along the path that fails;</p>
<p>This can be caused by several factors, such as:</p>
<ul>
<li>the sender selected a channel in the route path that isn't suitable for sharing the payment (note that the sender chooses the route and not the current node), and due to the unknown real capacity of the channel, the sender path is just a guess. Currently, this unknown real capacity of the channel is considered a privacy feature;</li>
<li>the node that you have a channel with being offline (which can be common if the node uses a hidden network, aka tor),</li>
<li>the sender sending a payment that has already dead from the source (also known as a probing attack, which aims to steal information from the network graph regarding which channel can forward the payment), or</li>
<li>a bug in the software.</li>
</ul>
<p>In some cases, like with a probing attack, you can try to mitigate the issue by using lnmetrics to look at the channel that has only been sending failed payments in the last day or 10 days. With lnmetrics, you can analyze the local failure and try to understand what went wrong with your node. Additionally, you can check the node uptime of the node that you have a channel with to get a better understanding of what the reason is.</p>
<p>However, this info does not provide any final answer, but sometimes removing a bad node can help. Ideally, this analysis with lnmetrics should be automated, but you can do it manually for now.</p>
<blockquote>
<p>For &quot;Failed transactions&quot; I can find no reason. I guess these are transactions nodes behind my node can not route forward?</p>
</blockquote>
<p>Mh, currently, I cannot find where we return this error message, you can add the correct error here that you find in your core lightning?</p>
<p>P.S: I noted that you pointed out several times the word <code>transaction</code>, as the HTLC is a pre-signed transaction, in lightning this is called payment, but maybe I am missing something here, so I hope you can clarify</p>

CC BY-SA 4.0
2023-05-13T11:52:22.757Z
Do you know if other Lightning implementations currently provide more info than CLN on failed payments?
Michael Folkson
CC BY-SA 4.0
2023-05-13T12:55:03.230Z
No I am not in sync with others, sorry
vincenzopalazzo
CC BY-SA 4.0
2023-05-13T10:01:15.560Z
2023-05-13T10:09:15.850Z
2023-05-13T10:09:15.850Z
vincenzopalazzo
<p>In my node I see many failed Routing Transactions. I did not really find information on how to analyze what went wrong.</p>
<p>First I see</p>
<ol>
<li>Failed Transactions</li>
<li>Local Failed Transactions - reason always &quot;Temporary Channel Failure&quot;</li>
</ol>
<p>What is the difference between them? I guess that &quot;local failed&quot; means that my node was not able to forward them? What are the reasons? <a href="https://github.com/lnbook/lnbook/blob/ece69d5c2ac8116ef83c1826bd43bd4b33c74dca/12_path_finding.asciidoc#uncertainty-in-the-channel-graph" rel="nofollow noreferrer">Referring to lnbook</a>:</p>
<blockquote>
<p>Meanwhile if we get a &quot;temporary channel failure&quot; error, the most likely reason is a lack of liquidity for the specific amount.</p>
</blockquote>
<p>But there are also many which failed where I had enough liquidity.</p>
<p>For &quot;Failed transactions&quot; I can find no reason. I guess this are transactions nodes behind my node can not route forward?</p>

CC BY-SA 4.0
2023-05-05T15:35:43.183Z
If a transaction is routed from A to C over B where I am B, my liquidity on my side is relevant in the B-C channel. If A to B liquidity is not enough I would conclude that the transaction is not even reaching my node. So I thought it should fail because of my liquidity in B-C.
timmornYE
CC BY-SA 4.0
2023-05-06T18:05:11.857Z
You are searching for "Relay"? Bank is not really on point. A Bank guarantees you a balance of money they do not have. A Lightning relay can forward liquidity which is in a channel.
timmornYE
CC BY-SA 4.0
2023-05-12T15:29:54.637Z
this is difficult currently but not impossible, simple core lightning should return more information when it fails a payment
vincenzopalazzo
<core-lightning><lightning-routing>
Analyze Failed Routing in Core-Lightning
timmornYE
# Analyze Failed Routing in Core-Lightning

(Asked by: username_0 on 2023-05-04)

In my node I see many failed Routing Transactions. I did not really find information on how to analyze what went wrong.

First I see

1. Failed Transactions
2. Local Failed Transactions - reason always "Temporary Channel Failure"

What is the difference between them? I guess that "local failed" means that my node was not able to forward them? What are the reasons? [Referring to lnbook](https://github.com/lnbook/lnbook/blob/ece69d5c2ac8116ef83c1826bd43bd4b33c74dca/12_path_finding.asciidoc#uncertainty-in-the-channel-graph):

> Meanwhile if we get a "temporary channel failure" error, the most likely reason is a lack of liquidity for the specific amount.

But there are also many which failed where I had enough liquidity.

For "Failed transactions" I can find no reason. I guess this are transactions nodes behind my node can not route forward?

**Tags:** core-lightning, lightning-routing

> **Comments:**
> **username_0**: If a transaction is routed from A to C over B where I am B, my liquidity on my side is relevant in the B-C channel. If A to B liquidity is not enough I would conclude that the transaction is not even reaching my node. So I thought it should fail because of my liquidity in B-C.  
> **username_0**: You are searching for "Relay"? Bank is not really on point. A Bank guarantees you a balance of money they do not have. A Lightning relay can forward liquidity which is in a channel.  
> **username_1**: this is difficult currently but not impossible, simple core lightning should return more information when it fails a payment  

---

## 1 answers

### Answer by username_1 on 2023-05-13. Score: 3 | Accepted answer

Okay, I will try to expand on my comment in an answer. Currently, it's difficult to determine why a payment is failing with our core lightning node because it doesn't provide much information.

However, in the last year, I worked on a lightning network metrics specification, which is available [here](https://lnmetrics.info/rfc) or on [Github](https://github.com/LNOpenMetrics/lnmetrics.rfc/blob/main/metrics/metric_1.md). Using this specification, you can try to find the channel through which the payment is being sent and potentially gather useful metrics or ideas to improve the current system.

Regarding your question, there are several well-known problems that we're trying to work around or resolve.

You were correct in assuming that "local failed" means that your node could not forward the payment.

Regarding the general failure, this is not your fault, but one of the nodes along the path that fails;

This can be caused by several factors, such as:

* the sender selected a channel in the route path that isn't suitable for sharing the payment (note that the sender chooses the route and not the current node), and due to the unknown real capacity of the channel, the sender path is just a guess. Currently, this unknown real capacity of the channel is considered a privacy feature;
* the node that you have a channel with being offline (which can be common if the node uses a hidden network, aka tor),
* the sender sending a payment that has already dead from the source (also known as a probing attack, which aims to steal information from the network graph regarding which channel can forward the payment), or
* a bug in the software.

In some cases, like with a probing attack, you can try to mitigate the issue by using lnmetrics to look at the channel that has only been sending failed payments in the last day or 10 days. With lnmetrics, you can analyze the local failure and try to understand what went wrong with your node. Additionally, you can check the node uptime of the node that you have a channel with to get a better understanding of what the reason is.

However, this info does not provide any final answer, but sometimes removing a bad node can help. Ideally, this analysis with lnmetrics should be automated, but you can do it manually for now.

> For "Failed transactions" I can find no reason. I guess these are transactions nodes behind my node can not route forward?

Mh, currently, I cannot find where we return this error message, you can add the correct error here that you find in your core lightning?

P.S: I noted that you pointed out several times the word `transaction`, as the HTLC is a pre-signed transaction, in lightning this is called payment, but maybe I am missing something here, so I hope you can clarify

> **Comments:**
> **username_2**: Do you know if other Lightning implementations currently provide more info than CLN on failed payments?  
> **username_1**: No I am not in sync with others, sorry  

---

