[Bug]: BTCPay invoice not settling after successful Lightning payment (CLN + Lightning Charge)
See original GitHub issueWhat is your BTCPay version?
BTCPay v1.6.11.0-altcoins
How did you deploy BTCPay Server?
BTCPayServer is deployed via Docker containers managed by systemd
services (BTCPay, NBX, Postgres 13). Using the official upstream images.
The CLN node and Lightning Charge are running on a separate machine. Lightning Charge’s HTTP port is port-forwarded to the BTCPay box over an SSH tunnel. An Nginx reverse proxy is running on the BTCPay box (localhost:8080
) and forwarding traffic to Charge.
What happened?
A BTCPay invoice expired after an hour because BTCPay did not recognize a completed Lightning payment. The LN invoice was paid after 10 minutes. Both CLN and Lighting Charge have recognized the payment.
How did you encounter this bug?
A customer emailed us that their BTCPay Checkout window was still showing a Pending invoice, even though they had paid the LN invoice, which was confirmed directly on the CLN node and Lightning Charge.
Relevant log output
2022-11-24T00:23:47.152412857Z info: PayServer: BTC (Lightning): Start listening http://localhost:8080/
2022-11-24T00:32:21.042887068Z fail: PayServer: BTC (Lightning): Error while contacting http://localhost:8080/
2022-11-24T00:32:21.042923138Z System.FormatException: Input string was not in a correct format.
2022-11-24T00:32:21.043852325Z at System.Number.ThrowOverflowOrFormatException(ParsingStatus status, TypeCode type)
2022-11-24T00:32:21.043866297Z at BTCPayServer.Lightning.JsonConverters.LightMoneyJsonConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer)
2022-11-24T00:32:21.044269030Z at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue)
2022-11-24T00:32:21.044523238Z at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
2022-11-24T00:32:21.044533232Z at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
2022-11-24T00:32:21.044776997Z at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
2022-11-24T00:32:21.045027259Z at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
2022-11-24T00:32:21.045323960Z at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
2022-11-24T00:32:21.045334254Z at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
2022-11-24T00:32:21.045611706Z at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
2022-11-24T00:32:21.045621211Z at BTCPayServer.Lightning.Charge.ChargeSession.WaitInvoice(CancellationToken cancellation)
2022-11-24T00:32:21.045756052Z at BTCPayServer.Lightning.Charge.ChargeSession.BTCPayServer.Lightning.ILightningInvoiceListener.WaitInvoice(CancellationToken token)
2022-11-24T00:32:21.045763997Z at BTCPayServer.Payments.Lightning.LightningInstanceListener.Listen(CancellationToken cancellation) in /source/BTCPayServer/Payments/Lightning/LightningListener.cs:line 473
2022-11-24T00:32:21.046617331Z info: PayServer: BTC (Lightning): Stop listening http://localhost:8080/
What browser do you use?
Firefox 107.0
Additional information
Are you sure this is a bug report?
- I confirm this is a bug report
Issue Analytics
- State:
- Created 10 months ago
- Comments:7 (3 by maintainers)
Top GitHub Comments
Hi! It was a one-time failure. It was a slightly larger payment but nothing crazy (0.02714143 BTC).
Latest Lightning Charge CLN 0.12.1
As discussed on Mattermost, this is a conversion problem for float values in our Lightning library.
The JSON from Charge looks like this:
Fixed here: btcpayserver/BTCPayServer.Lightning#114