lightningequipment / circuitbreaker

MIT License
118 stars 18 forks source link

Mark htlc complete failed: constraint failed: UNIQUE constraint failed #83

Open elf-bot opened 11 months ago

elf-bot commented 11 months ago

Hello, After some hiatus I updated and started running the updated circuitbreaker again. But I see some weird errors. Mark htlc complete failed: constraint failed: UNIQUE constraint failed: forwarding_history.outgoing_channel, forwarding_history.outgoing_htlc_index I tried deleting the circruitbreaker database and trying again, with the same issue popping up, although it's not tagged as an error. I'm running the latest LND 0.17.0-beta on Ubuntu 22.04.2 LTS and a good machine with enough resources.

2023-10-20T10:54:31.133Z        INFO    New peer notification received  {"peer": "02056789..."}
2023-10-20T10:54:31.133Z        INFO    New peer notification received  {"peer": "02156789..."}                                                         
2023-10-20T10:54:31.133Z        INFO    New peer notification received  {"peer": "02256789..."}                                                         
2023-10-20T10:54:31.133Z        INFO    New peer notification received  {"peer": "02356789..."}
2023-10-20T10:54:31.134Z        INFO    New peer notification received  {"peer": "02456789..."}
2023-10-20T10:54:31.134Z        INFO    New peer notification received  {"peer": "02556789..."}       
2023-10-20T11:02:31.186Z        INFO    Forwarded       {"peer": "02656789...", "htlc": 33111, "channel": 601234567891234567, "pending_htlcs": 1}       
2023-10-20T11:02:31.210Z        INFO    Resolved htlc   {"peer": "02656789...", "htlc": 33111, "channel": 601234567891234567, "settled": false, "pending_htlcs": 0}                                                                                                                                                                                                    
2023-10-20T11:13:43.554Z        INFO    Forwarded       {"peer": "03056789...", "htlc": 14389, "channel": 602234567891234567, "pending_htlcs": 1}       
2023-10-20T11:13:43.565Z        INFO    Mark htlc complete failed: constraint failed: UNIQUE constraint failed: forwarding_history.outgoing_channel, forwarding_history.outgoing_htlc_index (2067)      {"peer": "03056789..."}                                                                                                                                        
2023-10-20T11:13:43.565Z        INFO    Resolved htlc   {"peer": "03056789...", "htlc": 14389, "channel": 602234567891234567, "settled": false, "pending_htlcs": 0}                                                                                                                                                                                                    
2023-10-20T11:16:10.724Z        INFO    Forwarded       {"peer": "02656789...", "htlc": 33112, "channel": 601234567891234567, "pending_htlcs": 1}       
2023-10-20T11:16:10.753Z        INFO    Resolved htlc   {"peer": "02656789...", "htlc": 33112, "channel": 601234567891234567, "settled": false, "pending_htlcs": 0}                                                                                                                                                                                                    
2023-10-20T11:16:15.097Z        INFO    Forwarded       {"peer": "02656789...", "htlc": 33113, "channel": 601234567891234567, "pending_htlcs": 1}       
2023-10-20T11:16:15.112Z        INFO    Mark htlc complete failed: constraint failed: UNIQUE constraint failed: forwarding_history.outgoing_channel, forwarding_history.outgoing_htlc_index (2067)      {"peer": "02656789..."}                                                                                                                                        
2023-10-20T11:16:15.112Z        INFO    Resolved htlc   {"peer": "02656789...", "htlc": 33113, "channel": 601234567891234567, "settled": false, "pending_htlcs": 0}                                                                                                                                                                                                    
2023-10-20T11:18:54.224Z        INFO    Forwarded       {"peer": "03156789...", "htlc": 66986, "channel": 701234567891234567, "pending_htlcs": 1}       
2023-10-20T11:18:55.633Z        INFO    Resolved htlc   {"peer": "03156789...", "htlc": 66986, "channel": 701234567891234567, "settled": false, "pending_htlcs": 0}                                                                                                                                                                                                    
2023-10-20T11:22:14.581Z        INFO    Forwarded       {"peer": "02656789...", "htlc": 33114, "channel": 601234567891234567, "pending_htlcs": 1}       
2023-10-20T11:22:14.592Z        INFO    Mark htlc complete failed: constraint failed: UNIQUE constraint failed: forwarding_history.outgoing_channel, forwarding_history.outgoing_htlc_index (2067)      {"peer": "02656789..."}
2023-10-20T11:22:14.592Z        INFO    Resolved htlc   {"peer": "02656789...", "htlc": 33114, "channel": 601234567891234567, "settled": false, "pending_htlcs": 0}
2023-10-20T11:28:24.567Z        INFO    Forwarded       {"peer": "02656789...", "htlc": 33115, "channel": 601234567891234567, "pending_htlcs": 1}
2023-10-20T11:28:24.596Z        INFO    Resolved htlc   {"peer": "02656789...", "htlc": 33115, "channel": 601234567891234567, "settled": false, "pending_htlcs": 0}
2023-10-20T11:29:09.647Z        INFO    Forwarded       {"peer": "03056789...", "htlc": 14390, "channel": 602234567891234567, "pending_htlcs": 1}
2023-10-20T11:29:09.657Z        INFO    Mark htlc complete failed: constraint failed: UNIQUE constraint failed: forwarding_history.outgoing_channel, forwarding_history.outgoing_htlc_index (2067)      {"peer": "03056789..."}
2023-10-20T11:29:09.657Z        INFO    Resolved htlc   {"peer": "03056789...", "htlc": 14390, "channel": 602234567891234567, "settled": false, "pending_htlcs": 0}
2023-10-20T11:33:25.685Z        INFO    Forwarded       {"peer": "02656789...", "htlc": 33116, "channel": 601234567891234567, "pending_htlcs": 1}
2023-10-20T11:33:25.700Z        INFO    Mark htlc complete failed: constraint failed: UNIQUE constraint failed: forwarding_history.outgoing_channel, forwarding_history.outgoing_htlc_index (2067)      {"peer": "02656789..."}
2023-10-20T11:33:25.701Z        INFO    Resolved htlc   {"peer": "02656789...", "htlc": 33116, "channel": 601234567891234567, "settled": false, "pending_htlcs": 0}

(logs sanitized)

Thanks

C-Otto commented 9 months ago

For me the data that cannot be saved always has these values:

{
"outgoing circuit htlc": 0,
"settled": false
}

I guess the outgoing circuit HTLC is always 0 for failures.

carlaKC commented 3 months ago

Managed to totally miss this issue, sorry! Fix is up.