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

Trouble creating macaroon file (lncli create+rpc error) #3115

Closed
zhongtan opened this issue May 24, 2019 · 14 comments
Closed

Trouble creating macaroon file (lncli create+rpc error) #3115

zhongtan opened this issue May 24, 2019 · 14 comments

Comments

@zhongtan
Copy link

Background

I am working through the tutorial to build from source but got stuck at running LND using the btcd backend. I ran this command and got the prompt to create or unlock a wallet:

lnd --bitcoin.active --bitcoin.testnet --debuglevel=debug --bitcoin.node=bitcoind --bitcoind.rpcuser=<username> --bitcoind.rpcpass=<password> --bitcoind.zmqpubrawblock=tcp://127.0.0.1:28332 --bitcoind.zmqpubrawtx=tcp://127.0.0.1:28333 --externalip=<my computer's ip>

I tried running lncli create but I keep getting this RPC error:

[lncli] rpc error: code = Unavailable desc = all SubConns are in TransientFailure, latest connection error: connection error: desc = "transport: Error while dialing dial tcp 127.0.0.1:10009: connect: connection refused"

I include a new seed mnemonic every time I try to create a new wallet. I think I must have missed out on some configurations but I'm not entirely sure where they are.

I looked at this similar issue and tried downgrading RPC to version 1.17.0 but still ran into the same error.

Your environment

  • version of lnd
    lnd v0.6.1-beta

  • which operating system
    MacOS Mojave 10.14.5

  • version of btcd, bitcoind, or other backend
    btcd version 0.12.0-beta

  • version of go
    go1.12.4 darwin/amd64

  • bitcoin.conf
    testnet=1
    server=1
    daemon=1
    zmqpubrawblock=tcp://127.0.0.1:28332
    zmqpubrawtx=tcp://127.0.0.1:28333

Expected behaviour

Macaroon file should be created

Actual behaviour

All subConns in TransientFailure

@molxyz
Copy link

molxyz commented May 24, 2019

@zhongtan You have --bitcoind.rpcuser=<username> --bitcoind.rpcpass=<password> in your lnd.conf but not in bitcoin.conf. You need to set the same credentials in both. For bitcoin.conf it should be

rpcuser=<username>
rpcpassword=<password>

@zhongtan
Copy link
Author

My bad, I was supposed to run lnd in another session while creating the wallet. I included the credentials in my bitcoin.conf and ran the lnd command again with all the flags. I got a different error instead:

[lncli] rpc error: code = Unknown desc = wrong seed version

I tried deleting the entire LND folder and started over but still got the same error above. Any ideas on what might be wrong?

@zhongtan
Copy link
Author

I ended up not using an existing cipher seed and let lnd generate a new seed for me. Not getting the error anymore, thanks!

@cfromknecht
Copy link
Contributor

wrong seed version

This sounds like you're not using a proper cipher seed?

@gnipping
Copy link

I meet the samiliar question. I can use lncli create and lncli unlock, but when I use other commands. It feeds back the error.
[lncli] rpc error: code = Unavailable desc = all SubConns are in TransientFailure, latest connection error: connection error: desc = "transport: Error while dialing dial tcp 127.0.0.1:10009: connect: connection refused"

@cfromknecht
Copy link
Contributor

@gnipping when lnd first starts up, only the WalletUnlocker rpcserver is active. Once authentication is successful, it gets replaced by the full Lightning rpcserver. That error looks more like you were trying to connect to the rpcserver while lnd was done (or crashed), though it is possible you issued the command while the switchover between rpcservers happens.

@OpenSystemCode
Copy link

@gnipping @cfromknecht I have the same problem on my rasperberry pi.

sudo journalctl -u lnd -f -n20

Jan 31 16:28:09 "" systemd[1]: Started LND Lightning Daemon.
Jan 31 16:28:10 "" lnd[1380]: Attempting automatic RPC configuration to bitcoind
Jan 31 16:28:10 "" lnd[1380]: Automatically obtained bitcoind's RPC credentials
Jan 31 16:28:10 "" lnd[1380]: 2020-01-31 16:28:10.250 [INF] LTND: Version: 0.9.0-beta commit=v0.9.0-beta, build=production, logging=default
Jan 31 16:28:10 "" lnd[1380]: 2020-01-31 16:28:10.251 [INF] LTND: Active chain: Bitcoin (network=mainnet)
Jan 31 16:40:30 "" systemd[1]: Stopping LND Lightning Daemon...
Jan 31 16:40:30 "" lnd[1380]: 2020-01-31 16:40:30.760 [INF] LTND: Received terminated
Jan 31 16:40:30 "" lnd[1380]: 2020-01-31 16:40:30.874 [INF] LTND: Shutting down...
Jan 31 16:40:30 "" lnd[1380]: 2020-01-31 16:40:30.966 [INF] LTND: Gracefully shutting down.
Jan 31 16:43:30 "" systemd[1]: lnd.service: State 'stop-sigterm' timed out. Killing.
Jan 31 16:43:30 "" systemd[1]: lnd.service: Killing process 1380 (lnd) with signal SIGKILL.
Jan 31 16:43:30 "" systemd[1]: lnd.service: Main process exited, code=killed, status=9/KILL
Jan 31 16:43:30 "" systemd[1]: Stopped LND Lightning Daemon.
Jan 31 16:43:30 "" systemd[1]: lnd.service: Unit entered failed state.
Jan 31 16:43:30 "" systemd[1]: lnd.service: Failed with result 'timeout'.
Jan 31 16:43:49 "" systemd[1]: Started LND Lightning Daemon.
Jan 31 16:43:50 "" lnd[1749]: Attempting automatic RPC configuration to bitcoind
Jan 31 16:43:50 "" lnd[1749]: Automatically obtained bitcoind's RPC credentials
Jan 31 16:43:50 "" lnd[1749]: 2020-01-31 16:43:50.349 [INF] LTND: Version: 0.9.0-beta commit=v0.9.0-beta, build=production, logging=default
Jan 31 16:43:50 "" lnd[1749]: 2020-01-31 16:43:50.350 [INF] LTND: Active chain: Bitcoin (network=mainnet)

can you help to resolve this?

@guggero
Copy link
Collaborator

guggero commented Jan 31, 2020

@OpenSystemCode from your log it looks like lnd doesn't have enough time to start.
We added change to the way the databases are handled in v0.9.0 that uses less memory but takes longer to start. You can disable that behavior: Try setting the sync-freelist=1 option in the lnd.conf file or the --sync-freelist command line flag.

The other option is to give lnd more time to start. Perhaps your systemd script needs a longer wait timeout or something. Is this the RaspiBlitz software?

@OpenSystemCode
Copy link

Hey @guggero thanks for you reply. It's RaspiBolt Software. I waited a few minutes until the message Waiting for wallet encryption password. Use lncli createto create a wallet,lncli unlockto unlock an existing wallet, orlncli changepassword to change the password of an existing wallet and unlock it.

After this message the cmd lncli unlock went through.

@A-qiu161203
Copy link

I meet the samiliar question. I can use lncli create and lncli unlock, but when I use other commands. It feeds back the error.
[lncli] rpc error: code = Unavailable desc = all SubConns are in TransientFailure, latest connection error: connection error: desc = "transport: Error while dialing dial tcp 127.0.0.1:10009: connect: connection refused"

so am I. Have you resoved it?

@Smiggel
Copy link

Smiggel commented Dec 4, 2020

I meet the samiliar question. I can use lncli create and lncli unlock, but when I use other commands. It feeds back the error.
[lncli] rpc error: code = Unavailable desc = all SubConns are in TransientFailure, latest connection error: connection error: desc = "transport: Error while dialing dial tcp 127.0.0.1:10009: connect: connection refused"

Did you find the solution for this? I have the same issue now after upgrading RaspiBlitz from 1.6.1 to 1.6.2.

@Smiggel
Copy link

Smiggel commented Dec 4, 2020

I meet the samiliar question. I can use lncli create and lncli unlock, but when I use other commands. It feeds back the error.
[lncli] rpc error: code = Unavailable desc = all SubConns are in TransientFailure, latest connection error: connection error: desc = "transport: Error while dialing dial tcp 127.0.0.1:10009: connect: connection refused"

so am I. Have you resoved it?

Were you able to resolve this?

@viertelb
Copy link

viertelb commented Jun 17, 2021

I have a similar problem after beeing unable to remove macaroon files and upgrading on a RaspiBolt: https://github.com/Stadicus/RaspiBolt/issues/734

admin@RPi4:~/rust/electrs $ lncli getinfo
[lncli] rpc error: code = Unavailable desc = all SubConns are in TransientFailure, latest connection error: connection error: desc = "transport: Error while dialing dial tcp 127.0.0.1:10009: connect: connection refused"

But I have to say that I used their recommendations of how to upgrade and I am unsure if this is up-to-date because LND seems to just do it with a docker now.

@getacat
Copy link

getacat commented Oct 20, 2023

I ended up not using an existing cipher seed and let lnd generate a new seed for me. Not getting the error anymore, thanks!

how to let lnd generate a new seed? I meet the same error as you.

[lncli] rpc error: code = Unknown desc = wrong seed version

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

10 participants