[Data] : Error inserting closure: UNIQUE constraint failed: gui_closures.funding_txid, gui_closures.funding_index
microlancer opened this issue · comments
Hello,
I noticed my data on the LNDg dashboard seemed a bit stale, so I checked the logs and saw this:
Sat Jan 13 00:16:52 2024 : [Data] : Starting data execution...
Sat Jan 13 00:16:55 2024 : [Data] : Updating forwards, have 156690
Sat Jan 13 00:16:55 2024 : [Data] : Added 0 new forwards to DB...
Sat Jan 13 00:16:57 2024 : [Data] : Error inserting closure: UNIQUE constraint failed: gui_closures.funding_txid, gui_closures.funding_index
Sat Jan 13 00:16:57 2024 : [Data] : Data execution completed...sleeping for 20 seconds
Sat Jan 13 00:17:00 2024 : [Rebalancer] : Queue manager is starting...
Sat Jan 13 00:17:00 2024 : [Rebalancer] : Queue currently has 0 items...
Sat Jan 13 00:17:00 2024 : [Rebalancer] : There are currently 0 tasks in progress...
Sat Jan 13 00:17:00 2024 : [Rebalancer] : Queue manager is checking for more work...
Sat Jan 13 00:17:00 2024 : [Rebalancer] : Queue is still empty, stoping the rebalancer...
Sat Jan 13 00:17:00 2024 : [Rebalancer] : Queue manager has shut down...
Sat Jan 13 00:17:03 2024 : [Rebalancer] : Manager and workers have stopped...
Sat Jan 13 00:17:03 2024 : [Rebalancer] : Rebalancer successfully exited...sleeping for 20 seconds
Sat Jan 13 00:17:17 2024 : [Data] : Starting data execution...
Sat Jan 13 00:17:19 2024 : [Data] : Updating forwards, have 156690
Sat Jan 13 00:17:19 2024 : [Data] : Added 0 new forwards to DB...
Sat Jan 13 00:17:21 2024 : [Data] : Error inserting closure: UNIQUE constraint failed: gui_closures.funding_txid, gui_closures.funding_index
Sat Jan 13 00:17:21 2024 : [Data] : Data execution completed...sleeping for 20 seconds
Is there any reason I'm getting this UNIQUE constraint failed? Any way to resolve it?
Running v1.8.0
Thanks!
In this case, the duplicates should be removed and lndg will try to reinsert the row on the next run but other data fields should still be able to process their data without issue.
How can I remove the duplicates?
This happens in the code already after the error, it tries to resolve the issue by deleting the duplicate record.
https://github.com/cryptosharks131/lndg/blob/master/jobs.py#L450-L451
You could also check lncli closedchannels
to see if the source list has any duplicates.
If you would like to clear the closures table completely and let lndg rebuild the list, you can go to this page and clear it manually: /reset