lnd icon indicating copy to clipboard operation
lnd copied to clipboard

StateUpdateCodeClientBehind watchtower client error

Open bota87 opened this issue 3 years ago • 1 comments
trafficstars

Background

From some days I have this error every 5 minutes on lnd logs

[WRN] WTCL: (legacy) SessionQueue() unable to upload state update to tower=023bad37e5795654cecc69b43599da8bd5789ac633c098253f60494bde602b60bf@iiu4epqzm6cydqhezueenccjlyzrqeruntlzbx47mlmdgfwgtrll66qd.onion:9911: received error code StateUpdateCodeClientBehind in StateUpdateReply for seqnum=1 [ERR] WTCL: (legacy) SessionQueue() unable to send state update: received error code StateUpdateCodeClientBehind in StateUpdateReply for seqnum=1

I've tried to remove the watchtower but I can't

lncli wtclient remove 023bad37e5795654cecc69b43599da8bd5789ac633c098253f60494bde602b60bf [lncli] rpc error: code = Unknown desc = tower has unacked updates

so I just stopped lnd, removed the wtclient.db and added the watchtower again, unlucky after some minutes the error showed up again

Your environment

  • lnd 0.15
  • Linux 5.15.32-v8+ 1538 SMP PREEMPT Thu Mar 31 19:40:39 BST 2022 aarch64 GNU/Linux
  • bitcoind 23

Steps to reproduce

Add a watchtower and monitor the logs, I use the one provided by lightningnetwork.plus

Expected behaviour

No errors in the log

Actual behaviour

StateUpdateCodeClientBehind errors each 5 minutes

bota87 avatar Jul 31 '22 21:07 bota87

This indicates that your watchtower client is somehow out of sync or lost track about which updates it has sent to the watchtower. Unsure if there's a way to signal to a watchtower that it should delete a session such that one could start over from scratch.

bitromortac avatar Aug 01 '22 09:08 bitromortac

Would you mind sharing logs for this? Either your node or the watchtower has data loss or a bug

Crypt-iQ avatar Aug 23 '22 18:08 Crypt-iQ

Hi @bota87 - I think this can happen if you perhaps deleted your wtclient.db. Do you recall ever doing that? I know you said in your original post that you did delete it but that was only after encountering this error. Did you perhaps also delete the db before encountering the error?

ellemouton avatar Mar 23 '23 15:03 ellemouton

Hi @ellemouton, yes I had to delete the wtclient.db even before this error. Before using the lightningnetwork.plus watchtower I used many others that became unreliables and deleting the db file was the only solution that worked. Now I'm not using the LN+ WT anymore, using a private WT I don't have this problem so if you want to close the issue is fine for me.

bota87 avatar Mar 26 '23 12:03 bota87

no need to close - other people have run into this too. I just wanted to confirm my suspicion of the cause :) working on fix that will help others in this state

ellemouton avatar Mar 27 '23 06:03 ellemouton

Fixed in https://github.com/lightningnetwork/lnd/pull/7541 :)

ellemouton avatar Mar 31 '23 15:03 ellemouton