From ae30fb7745e2b8dc48a57def48a561aeafa3a13d Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Mon, 20 Jun 2022 11:00:36 +0930 Subject: [PATCH 1/2] common: downgrade "internal error" errors from lnd. Prior to 0.11.0 we had cases where we would treat errors as warnings: regretfully, this is still needed. This message in particular has been widely reported, and it now causes channel force closes. Downgrade and log. I did insert some snarky log message earlier, but hey, I'm sure CLN has done worse things to our peers! Signed-off-by: Rusty Russell Changelog-Fixed: Protocol: treat LND "internal error" as warnings, not force close events (as we did in v0.10). --- common/peer_failed.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/common/peer_failed.c b/common/peer_failed.c index c9c18d84dbe7..96325cf2351b 100644 --- a/common/peer_failed.c +++ b/common/peer_failed.c @@ -84,6 +84,15 @@ void peer_failed_received_errmsg(struct per_peer_state *pps, { u8 *msg; + /* LND sends "internal error" and we close the channel. But + * prior to 0.11 we would turn this into a warning, and they + * would recover after a reconnect. So we downgrade, but snark + * about it in the logs. */ + if (!warning && streq(desc, "internal error")) { + status_unusual("lnd sent 'internal error':" + " let's give it some space"); + warning = true; + } msg = towire_status_peer_error(NULL, channel_id, desc, warning, NULL); peer_billboard(true, "Received %s", desc); From effbd8071ae53f1c3ba5a1a26c3efeeb5cf1c5e1 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 23 Jun 2022 22:11:26 +0930 Subject: [PATCH 2/2] common: downgrade LND 'internal error' properly. Thanks to @zerofeerouting for another report. "desc" here is the sanitized message, eg: "ERROR error channel 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef: internal error" Signed-off-by: Rusty Russell --- common/peer_failed.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/peer_failed.c b/common/peer_failed.c index 96325cf2351b..d3d60114e16f 100644 --- a/common/peer_failed.c +++ b/common/peer_failed.c @@ -88,7 +88,7 @@ void peer_failed_received_errmsg(struct per_peer_state *pps, * prior to 0.11 we would turn this into a warning, and they * would recover after a reconnect. So we downgrade, but snark * about it in the logs. */ - if (!warning && streq(desc, "internal error")) { + if (!warning && strends(desc, "internal error")) { status_unusual("lnd sent 'internal error':" " let's give it some space"); warning = true;