Lots of trouble migrating to new server. #9070
-
I have been failing to migrate a node with LND for a over a week now. Seriously stuck. LND on a BTCPAY install. Data from all the docker volumes are copied across to new server, so all of the LND folder data is there. All the configurations are the same. Everything boots up as it should but LND show 0 channels.
I have run this past BTCPAY support and have confirmed the migration process completed as expected. I have run this multiple times and always same result. For reference here are the backup and restore scripts used by BTCPAY . As you can see its fairly straight forward.
The new BTCPAY instance on new server has all the same versions as old. New server is aarch_64 and old is x86_64 in case that has any bearing on the situation. So the question is. What could be preventing my channels from being picked up by the new install, and what can I do to bring those channels in? Help hugely appreciated as I have been struggling with this for some time now. |
Beta Was this translation helpful? Give feedback.
Replies: 11 comments 36 replies
-
Easy solution might be to
There are two backup scripts, the other one is btcpay-backup.sh Both broadly do the same: they dump the database, shutdown btcpay, backup selected docker volumes and restart btcpay, so LND needs to be disabled before starting backup. If both LND instances are up at the same time this is going to confuse the network or if the channel state gets out of sync with the backup then funds can be lost. |
Beta Was this translation helpful? Give feedback.
-
Some more points. Disabling LND should leave LND docker volume in place. You need to be careful a 'clean' operation with restore does not delete the LND docker volume of the currently disabled LND container. |
Beta Was this translation helpful? Give feedback.
-
If I was going ahead with an actual migration and using the same web site DNS address, rather than testing the migration process:
|
Beta Was this translation helpful? Give feedback.
-
With regard to redirecting a web site during maintenance:
As far as I can make out so far, there is only one From https://docs.corelightning.org/docs/backup#backup
Further down it is stated Static Channel Backup (SCB) is only updated when a new channel is opened. I assume it is also updated when a channel is closed. The purpose is to recover funds stuck in a channel. Also further down:
A way to do a sucessful migration without funds getting stuck in a channel (requiring closure ro recover funds) is to:
If a lightning server crashes then with Static Channel Backup funds can be recovered (if file backed up externally). But don't expect business to just carry on as after some downtime, as if nothing happened. |
Beta Was this translation helpful? Give feedback.
-
OK another run on backup and restore with modified sh scripts to remove btcpayup. After backup and restore with all services down on both servers I get a checksum match on channel.backup: old server
new server
btcpay-up and still it is not picking up the lightning channels.
Because the new server has not once managed to load in channels and therefore has been unable to perform any channel activity I have been able to restart the old server after failed migration attempts and continue running my node with ALL channels present. I think at this point I would like to know how it is possible for LND on the new server instance to not be able to pick up the channels when it is running on the exact same data as the old server that can pick up the channels. Here are some LND logs on boot that might point to an issue:
Quite a few of these:
But no obvious errors. |
Beta Was this translation helpful? Give feedback.
-
First it is good the previous server came up with all channels open. Hence the new server was incorrect about closed channels. These suggest the lightning network has a security feature to refuse to route to a new IP address between peers once a channel between peers is opened. Does it make sense? It does not seem to. After all, keys can be re-exchanged to establlsh authenticity. |
Beta Was this translation helpful? Give feedback.
-
Issue posted to BTCPAY in regards to LND ip address issues -> btcpayserver/btcpayserver-docker#927 Not sure if this is the cause of channels not being picked up, but having that issue resolved would help debug this issue as IP address could be set explicitly instead of having to hope for correct dns resolution/propagation. |
Beta Was this translation helpful? Give feedback.
-
Might as well start the ball rolling on how the tests will be conducted. The two VPS servers are each 4 vCPU, 6GB RAM, 600GB SSD in Sydney with Contabo. They are currently both at 91% synced to BTC. LND is the lightning software. Their LN alias names are set to be au8b and au8c. The pruning is set to The intention is to make as few changes as practical. I probably won't even enable BTC on BTCPay, only lightning on one strore on each server. That is all that is necessary. One difference from the norm is that I will use my own reverse proxy with nginx, because that is what I am used to:
The sequence of tests will be:
|
Beta Was this translation helpful? Give feedback.
-
Pre testing channel state below au8b and au8c are listed in 1ml.com Their channel peer connections to random public nodes Caffeine (for au8b) and Cappero (for au8c) are currently not showing in 1ml.com. Anyone who wants to open a channel for passive observation is welcome but not advised. I will be taking down the nodes in a few weeks. Of particular interest might be observing what happens when nodes are migrated, as discussed above. Remember ip addresses will hopefully be sucessfully swapped! Keys from 1ml.com or For au8b For au8c |
Beta Was this translation helpful? Give feedback.
-
The first phase of the tests are successful, which is backing up each server and restoring to self. The LND server was disabled before backup on each server and remained disabled after restore. The LND server on each server was enabled after restore. All LN channels came back up again. No alterations were made to backup and restore scripts. I might leave the next phase until tomorrow. |
Beta Was this translation helpful? Give feedback.
-
Delete line 113 of file btcpay-backup.sh
Pull Request created at btcpayserver/btcpayserver-docker#928 |
Beta Was this translation helpful? Give feedback.
Delete line 113 of file btcpay-backup.sh
Pull Request created at btcpayserver/btcpayserver-docker#928