Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restoring Channels on RTL fails, Error Code 404 #614

Closed
silvester235 opened this issue Feb 28, 2021 · 19 comments · Fixed by #650
Closed

Restoring Channels on RTL fails, Error Code 404 #614

silvester235 opened this issue Feb 28, 2021 · 19 comments · Fixed by #650
Assignees
Labels
bug Something isn't working LND

Comments

@silvester235
Copy link

Mynodebtc v.0.2.27
Lightning v0.12.1
RTL v0.10.1- beta

Restoring Channels on RTL fails, Error Code 404

I uploaded the backup file "Backup-Channel-All.bak" to /mnt/hdd/mynode/rtl_backup/restore

Backup file shows as restore option in the RTL GUI.

However when I choose restore I receive "Error Code 404, Error Message Unknown Error, API URL ./api/lnd/channels/backup/restore/hannel:All"

Screenshots attached.

Do you have any idea how to restore the channels?
Screen Shot 2021-02-27 at 20 01 25
Screen Shot 2021-02-27 at 20 01 39

@saubyk saubyk added bug Something isn't working LND labels Mar 14, 2021
@saubyk saubyk added this to the Release 0.11.0-beta milestone Mar 14, 2021
@ShahanaFarooqui
Copy link
Collaborator

@silvester235,
Please note that the file name to restore all channels backup should be channel-all.bak NOT Backup-Channel-All.bak. RTL, by default, creates the backup file as channel-all.bak.

The user should NOT rename any of the backup files created by RTL as the UI distinguishes these backups by their file names. We expect these files to be copied as is, in the 'restore' folder for proper channel restoration.

Also, please remove the trailing slash from the channelBackupPath in your RTL-Config.json. The value should be /mnt/hdd/mynode/rtl_backup in your case. Although, it is not the reason of current failure, it might cause other issues in the future.

@ShahanaFarooqui ShahanaFarooqui added troubleshooting and removed bug Something isn't working labels Apr 8, 2021
@silvester235
Copy link
Author

silvester235 commented Apr 8, 2021

@ShahanaFarooqui,

thanks for your reply. I removed the trailing slash as advised.

I tried both file names channel-all.bak and later Backup-Channel-All.bak however in both cases the result is an 404 error (in the API URL is in both cases the first letter missing).

I have this problem with Mynodebtc & RTL installation. Currently I am setting up Raspiblitz & RTL and will try again with my channel-all.bak file.

@ShahanaFarooqui
Copy link
Collaborator

@silvester235,

If RTL finds a file named channel-all.bak in the restore folder, it shows the Restore All button on top of the table NOT as a row in the table.

The retore page table should only show the individual channel backup files showing their channel point values. In below example, my restore folder contains 3 files, I can either choose to restore a single channel from the table or all channels by clicking Restore All button. However, trying to restore all channels from the first row of the table (hannel:All), will throw 404 Unknown Error.

image

image

@ShahanaFarooqui ShahanaFarooqui self-assigned this Apr 10, 2021
@ShahanaFarooqui ShahanaFarooqui removed this from the Release 0.10.2-beta milestone Apr 10, 2021
@ShahanaFarooqui
Copy link
Collaborator

Removing the issue from the release milestone. For now, we are considring it as a troubleshooting issue not a bug.

@silvester235
Copy link
Author

silvester235 commented Apr 10, 2021

@ShahanaFarooqui
thanks for the update

on my latest Mynodebtc & RTL installation the "RESTORE ALL" button didn't show even if the channel-all.bak file was stored at restore folder location.

Only the "RESTORE" button under "Actions"

I am currently setting up Raspiblitz and see if it works.
Thanks for your clarification.
Screen Shot 2021-03-10 at 00 20 33

@ShahanaFarooqui
Copy link
Collaborator

I failed to reproduce the issue at my end, where channel-all.bak file exists but the 'Restore All' button does not show up.

Please take your time and let us know if the problem persists.

@RhinoAK
Copy link

RhinoAK commented Apr 12, 2021

@silvester235,
Please note that the file name to restore all channels backup should be channel-all.bak NOT Backup-Channel-All.bak. RTL, by default, creates the backup file as channel-all.bak.

The user should NOT rename any of the backup files created by RTL as the UI distinguishes these backups by their file names. We expect these files to be copied as is, in the 'restore' folder for proper channel restoration.

Also, please remove the trailing slash from the channelBackupPath in your RTL-Config.json. The value should be /mnt/hdd/mynode/rtl_backup in your case. Although, it is not the reason of current failure, it might cause other issues in the future.

When the backup is created it does in fact give the file name of Backup-Channel-All.bak at which point you're able to download it to your computer for safe keeping. I've been able to reproduce the same issue. I've even gone as far as having to create the restore directory, copying the file from pc to admin user home directory /home/admin via SCP, renamed the file to channel-all.bak, mv over to /mnt/hdd/mynode/rtl_backup/restore/ resulting in the same error. I thought it was an issue with permissions so I then assigned the restore permissions for the bitcoin user. Doing so still resulted in the same issue "Error Code 404"

@ShahanaFarooqui ShahanaFarooqui added bug Something isn't working and removed troubleshooting labels Apr 12, 2021
@ShahanaFarooqui ShahanaFarooqui added this to the Release 0.10.2-beta milestone Apr 12, 2021
ShahanaFarooqui added a commit that referenced this issue Apr 12, 2021
Downloaded all channels backup fails to restore #614
ShahanaFarooqui added a commit that referenced this issue Apr 12, 2021
Downloaded all channels backup fails to restore #614
@ShahanaFarooqui ShahanaFarooqui linked a pull request Apr 12, 2021 that will close this issue
@ShahanaFarooqui
Copy link
Collaborator

@RhinoAK & @silvester235 Thank you for the details. I was finally able to reproduce the issue after realizing that you were copying the downloaded file into restore folder. I kept testing it by copying the file directly from the backup folder. These were 3 main issues which are fixed and merged with PR #650.

1: We were renaming the file from channel-all.bak to Backup-Channel-All.bak while downloading the file. Now, the downloaded file will also be named as channel-all.bak to avoid any future confusion.

2: The file name check was case-sensitive making Channel-All.bak different from channel-all.bak. We have fixed the issue by
- Making the file names case in-sensitive AND
- Adding both file names (channel-all & backup-channel-all) as valid restorable files.

3: The file generated by 'Backup All' button (channel-all.bak) was utf-8 encoded and was able to restore the channels successfully. However, the file downloaded by 'Download All' button (Backup-Channel-All.bak) was in utf-8 BOM encoding and was failing to restore these channels. The fix will now download the file in utf-8 format only.

image

Please feel free to test the fix from Release-0.10.2 branch or it will be released soon with release v0.10.2.

@silvester235
Copy link
Author

@ShahanaFarooqui

Thanks for the update.

I have only the file Backup-Channel-All.bak downloaded by 'Download All' button in utf-8 BOM encoding.

"However, the file downloaded by 'Download All' button (Backup-Channel-All.bak) was in utf-8 BOM encoding and was failing to restore these channels."

Does it mean I will not be able to restore?
Or ist here a way to change the format from utf-8 BOM to utf8?

@ShahanaFarooqui
Copy link
Collaborator

ShahanaFarooqui commented Apr 13, 2021

A lot of text editors can change the encoding very easily. For example, notepad++.

I successfully restored from my Backup-Channel-All.bak file after renaming it to ‘channel-all.bak’ and changing the encoding from ‘utf-8 BOM’ to ‘utf-8’ via notepad++. Please note that these edits are required till v0.10.1.

ShahanaFarooqui added a commit that referenced this issue Apr 24, 2021
High CPU usage by browser when session inactivity dialog is showing #624
Block Altcoins #627
Remove slide right animation on route change #642
Update the initiator field for Loop APIs #643
Filter Bug fix #623
Transaction id for pending waiting channel #603
Empty cookie security risk bug fix #610
Material container repositions on Mac Firefox #268 & #619 
Mask config file passwords #636
Downloaded all channels backup fails to restore #614
CLT Routing list disappears on navigation #652
Update Bump Fee modal #628
LND Paying zero amount invoice fails #657
Open channel fails after adding peer with uri #662
Update Fee Policy Bug Fix #659
Changed default password from `changeme` to `password` (#653) (Contributed By: Andrew Leschinsky <[email protected]>)
@lazyrudi
Copy link

I have a similar problem right now. The backup file created on my old node (name „Pinsel") has the name "channel-all-5.bak". Five, because I had 5 channels. I copied the file to the "Restore" folder of my new node (name „PinselNeu"). I get this shown in the RTL-Backup-Restore, but during the execution the error message 400 is displayed. Where is the error?
Bildschirmfoto 2022-10-29 um 17 13 24
Bildschirmfoto 2022-10-29 um 11 43 51

@ShahanaFarooqui
Copy link
Collaborator

Number 5 is not related to your number of channels. This is the node index taken from your RTL-Config.json file. We create backup files for all LND nodes configured in the application and name them uniquely with their node index.

Also the error message is indicating that this file doesn’t contain all channels backup. It is a single channel backup file.

@lazyrudi
Copy link

lazyrudi commented Oct 29, 2022 via email

@ShahanaFarooqui
Copy link
Collaborator

ShahanaFarooqui commented Oct 29, 2022

  • Ensure that your backup file location is correct.
  • Ensure that your backup file is corresponding to the correct node index.
  • Do NOT rename any file before copying it into the restore folder.
  • If the restore folder has single channel backup file then RTL will show it in the grid on restore page.
  • If the folder has multi channel backup file, then it will show it on the top of restore page.
  • Restore selected or all channels according to your preference.

I am unable to check your backup file but for 5 channels backup, it should looks similar to this:

{
   "single_chan_backups":{
      "chan_backups":[
         {
            "chan_point":{
               "funding_txid_bytes":"Viv...Edg=",
               "output_index":0
            },
            "chan_backup":"qjo...XZE"
         },
         {
            "chan_point":{
               "funding_txid_bytes":"85s...Iz0=",
               "output_index":0
            },
            "chan_backup":"F6r...hSP"
         },
         {
            "chan_point":{
               "funding_txid_bytes":"KpS...evI=",
               "output_index":0
            },
            "chan_backup":"2M7...fxA=="
         },
         {
            "chan_point":{
               "funding_txid_bytes":"Uu/...wQQ=",
               "output_index":1
            },
            "chan_backup":"Rz9...WQ6"
         },
         {
            "chan_point":{
               "funding_txid_bytes":"/dd...3dI=",
               "output_index":0
            },
            "chan_backup":"kDj...JJJ"
         }
      ]
   },
   "multi_chan_backup":{
      "chan_points":[
         {
            "funding_txid_bytes":"Viv...Edg=",
            "output_index":0
         },
         {
            "funding_txid_bytes":"85s...Iz0=",
            "output_index":0
         },
         {
            "funding_txid_bytes":"KpS...evI=",
            "output_index":0
         },
         {
            "funding_txid_bytes":"Uu/...wQQ=",
            "output_index":1
         },
         {
            "funding_txid_bytes":"/dd...3dI=",
            "output_index":0
         }
      ],
      "multi_chan_backup":"E8S...TAV"
   }
}

Could you please confirm your lnd & RTL versions also? I just tested the backup & restore feature with RTL 0.13.1 and LND 0.15.3 and it worked without any issue.

@lazyrudi
Copy link

lazyrudi commented Oct 30, 2022 via email

@ShahanaFarooqui
Copy link
Collaborator

  • The file should NOT be renamed.
  • It is not possible to suggest anything else with these little details.

@lazyrudi
Copy link

lazyrudi commented Oct 30, 2022 via email

@lazyrudi
Copy link

lazyrudi commented Oct 30, 2022 via email

@saubyk
Copy link
Collaborator

saubyk commented Oct 30, 2022

Hi @lazyrudi please respond on the discussion page below:
#1125

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working LND
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants