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

Failed to start no LNBackendType specified -- login screen #929

Open
hufforguk opened this issue Dec 29, 2024 · 21 comments
Open

Failed to start no LNBackendType specified -- login screen #929

hufforguk opened this issue Dec 29, 2024 · 21 comments

Comments

@hufforguk
Copy link

hufforguk commented Dec 29, 2024

Fresh docker install (ghcr.io/getalby/hub:latest) on Ubuntu LTS

I connected to the server to run through the setup wizard, including linking to the old shared wallet in order to transfer funds to the hub.

The browser screen then went black. Refreshing browser window did nothing so I restarted the docker container.

It now shows the login screen (white/black with the running man silhouette). But it does not let me login with the password, it just shows the error in a red box on the bottom right "Failed to start no LNBackendType specified"

I didn't get round to taking down the 12 words. That was going to be my next task (literally was opening a pad of paper when this happened). I haven't transferred a huge amount in but would still feel a bit sore if it is gone.

@hufforguk
Copy link
Author

Failed to start no LNBackendType specified does appear to be a bug though.

@rolznz
Copy link
Contributor

rolznz commented Dec 29, 2024

@hufforguk the above reply is spam. I have reported them.

What backend did you start with? just the standard setup?

What commands did you use to get started with docker?

This is strange because before starting the node, the backend type is saved to the config (stored locally in sqlite).

@hufforguk
Copy link
Author

Hi @rolznz .
I used the standard docker-compose file and ran it inside Portainer. The only modifications I made was to the port and data location.

@rolznz
Copy link
Contributor

rolznz commented Dec 29, 2024

@hufforguk can you check the data location you set that there is a ldk directory inside it? and you can also use sqlite3 to open the nwc.db file in the data directory to check which keys were saved in the user_configs table. There should be a LNBackendType key in there.

@hufforguk
Copy link
Author

hufforguk commented Dec 29, 2024

@rolznz

  1. Yes there is a ldk directory in the data directory
  2. The nwc.db file does exist - I have checked the keys stored in the user_configs, there is no LNBackendType in there, just 1 - Relay, 2 - JWTSecret, 3 - NostrSecretKey, and 4 - Mnemonic

Thanks

@rolznz
Copy link
Contributor

rolznz commented Dec 29, 2024

@hufforguk this is really strange. We cannot just set this environment variable because you are missing other essential keys (UnlockPasswordCheck, NodeLastStartTime) etc which are required for Alby Hub to run correctly.

If you have any extra info about anything you did let me know. I'll try to reproduce this locally. I don't see why some of the keys would have been saved and some not, especially if you successfully migrated funds, which happens way after initial setup.

@hufforguk
Copy link
Author

Hi @rolznz,
Thanks for you help so far.
I really can't picture what I did that would be unusual.

Is there anyway of recovering the lighting wallet?

Thanks

@rolznz
Copy link
Contributor

rolznz commented Dec 30, 2024

@hufforguk can you confirm the only change you made was to these lines:

  volumes:
      - ./albyhub-data:/data
  ports:
      - "8080:8080"

you probably need to run another temporary alby hub using a different directory but choosing same unlock password, and then copy some entries from this temporary nwc.db to your main nwc.db. (LNBackendType, UnlockPasswordCheck, NodeLastStartTime etc. BUT NOT THE MNEMONIC). This way, you should be able to unlock and start your hub.

Please be very careful here and back up your whole alby hub data directory before proceeding.

@rolznz
Copy link
Contributor

rolznz commented Dec 30, 2024

If possible could you put your whole docker-compose file here so I can check it? if there is anything sensitive in filenames, please just change that part of the path to ommitted

@hufforguk
Copy link
Author

hufforguk commented Dec 30, 2024

@rolznz This is my compose file

services:
  albyhub:
    platform: linux/amd64
    container_name: albyhub
    image: ghcr.io/getalby/hub:latest
    volumes:
      - /tank/alby:/data
    ports:
      - "8066:8080"
    environment:
      - WORK_DIR=/data/albyhub
      - LOG_EVENTS=true

(Edited by rolznz to fix indentation)

@hufforguk
Copy link
Author

hufforguk commented Dec 31, 2024

@rolznz
Thanks for fixing my last post, my markdown-fu is not great.
I have edited the nwc.db file.
New error now:

Failed to start
BuildError: WalletSetupFailed: failed to setup onchain wallet.

@hufforguk
Copy link
Author

Further info: these are the logs I pulled from Portainer.

2024-12-31T18:39:41Z INF msg=Launching LN Backend: LDK

2024-12-31T18:39:41Z INF listening_addresses=["0.0.0.0:9735","[::]:9735"] migrate_storage= msg=Creating node vss_enabled=false

2024-12-31T18:39:41Z ERR error=BuildError: WalletSetupFailed: Failed to setup onchain wallet. msg=Failed to create LDK node

2024-12-31T18:39:41Z ERR error=BuildError: WalletSetupFailed: Failed to setup onchain wallet. msg=Failed to launch LN backend

2024-12-31T18:39:41Z ERR msg=Failed to launch LN backend: BuildError: WalletSetupFailed: Failed to setup onchain wallet.

2024-12-31T18:39:41Z ERR error=BuildError: WalletSetupFailed: Failed to setup onchain wallet. msg=Failed to start node

@rolznz
Copy link
Contributor

rolznz commented Jan 1, 2025

@hufforguk are you sure you used the same unlock password as you did when you originally setup alby hub?

@rolznz
Copy link
Contributor

rolznz commented Jan 1, 2025

Could you also check the logs in the data/ldk/logs folder?

@hufforguk
Copy link
Author

hufforguk commented Jan 1, 2025

@hufforguk are you sure you used the same unlock password as you did when you originally setup alby hub?

@rolznz I did double check this - I put in a junk password (basically just mashed the keyboard) and it gave a wrong password error.

Could you also check the logs in the data/ldk/logs folder?

In my gist here https://gist.github.com/hufforguk/a72267d6f3b2347839dd14538384120f

@rolznz
Copy link
Contributor

rolznz commented Jan 1, 2025

@hufforguk

In my gist here https://gist.github.com/hufforguk/a72267d6f3b2347839dd14538384120f

Is there any other file? this one looks fine - the node was started.

@rolznz I did double check this - I put in a junk password (basically just mashed the keyboard) and it gave a wrong password error.

I mean, did you put the same password when you created the new hub as you did the original one? (because if you copied an UnlockPasswordCheck key from the new hub to the old one, but used a different password, it won't work - because the password will incorrectly decode the original encrypted mnemonic)

@hufforguk
Copy link
Author

hufforguk commented Jan 1, 2025

I mean, did you put the same password when you created the new hub as you did the original one? (because if you copied an UnlockPasswordCheck key from the new hub to the old one, but used a different password, it won't work - because the password will incorrectly decode the original encrypted mnemonic)

Aha, yes. I spun up a fresh docker container with a new directory, logged in and used the same password. I then shut it down. copied all the entries from the nwc.db file to a copy of the original apart from Mnemonic
I then replaced that file back in place and spun the original container back up.
Putting in a nonsense password (keyboard mash) would produce a password error. Putting in the original password will produce the WalletSetupFailed error.

@hufforguk
Copy link
Author

hufforguk commented Jan 1, 2025

@rolznz Further to my last
I have redone everything to check I haven't missed a step.
Using the original folder, I have made the modifications to the original nwc.db file. I have left the original NostrSecretKey Mnemonic and JWTSecret values untouched. The result is this log file: https://gist.github.com/hufforguk/dad0ef9eac079c7ea0de35fcd0f8b86c.

@rolznz
Copy link
Contributor

rolznz commented Jan 1, 2025

@hufforguk hmm, it looks like a different pubkey was generated than expected, which means it's using a different seed phrase than what generated the data in the ldk folder. Did you make sure to stop the "temporary" alby hub and start the "original" hub again?

@hufforguk
Copy link
Author

@rolznz Yes, completely shut down, and then restarted with the original hub.

Is there anyway of manually decrypting the Mnemonic stored in the db with my original password?

@rolznz
Copy link
Contributor

rolznz commented Jan 2, 2025

@hufforguk yes, but it would require being able to run Go. You could write a small go script that uses the AesGcmDecryptWithPassword function from https://github.com/getAlby/hub/blob/master/config/aesgcm.go#L41 to decrypt the encrypted mnemonic using the password and ensure you have a valid mnemonic returned.

But it seems like the mnemonic saved is possibly overwritten, since LDK-node generated a different node pubkey with it. But I could be wrong about the exact issue, so trying to decrypt your mnemonic above could still be a good thing to try.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants