question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: The node is not in a connected state

See original GitHub issue

Hello everybody,

I have difficulty getting NBXplorer to connect to a running bitcoind instance running in Docker. I setup NBXplorer and bitcoind in docker instances, both running on the same machine.

Bitcoind is setup with rpc username and password. When I use the standard docker-compose file, I get the message fail: Configuration: BTC: Error connecting to RPC server Response status code does not indicate success: 401 (Unauthorized). Which makes sense of course. I tried to add username and password directly to the docker-compose file via: NBXPLORER_BTCRPCURL: http://username:password@bitcoind:18443/ Which gave the same result.

I then added the information to the settings.config file like this: btc.rpc.user=username btc.rpc.password=password

The result is this error message:

info: Configuration:  Data Directory: /datadir
info: Configuration:  Configuration File: /datadir/RegTest/settings.config
info: Configuration:  Network: Regtest
info: Configuration:  Supported chains: BTC
info: Configuration:  Network: Regtest
info: Configuration:  Supported chains: BTC
info: Configuration:  BTC: Testing RPC connection to http://172.18.0.2:18443/
Hosting environment: Production
Content root path: /app/
Now listening on: http://0.0.0.0:32838
Application started. Press Ctrl+C to shut down.
info: Configuration:  BTC: RPC connection successful
info: Configuration:  BTC: Full node version detected: 170000
info: Configuration:  BTC: Trying to connect via the P2P protocol to trusted node (bitcoind:3000)...
info: Explorer:       BTC: TCP Connection succeed, handshaking...
fail: Configuration:  BTC: Unhandled in Waiter loop
System.OperationCanceledException: Loading the chain from the node timed out ---> System.InvalidOperationException: The node is not in a connected state
   at NBitcoin.Protocol.NodeListener.ReceivePayload[TPayload](CancellationToken cancellationToken)
   at NBitcoin.Protocol.Node.VersionHandshake(NodeRequirement requirements, CancellationToken cancellationToken)
   at NBXplorer.BitcoinDWaiter.ConnectToBitcoinD(CancellationToken cancellation)
   --- End of inner exception stack trace ---
   at NBXplorer.BitcoinDWaiter.ConnectToBitcoinD(CancellationToken cancellation) in /source/NBXplorer/BitcoinDWaiter.cs:line 530
   at NBXplorer.BitcoinDWaiter.StepAsync(CancellationToken token) in /source/NBXplorer/BitcoinDWaiter.cs:line 305
   at NBXplorer.BitcoinDWaiter.StartLoop(CancellationToken token, Signaler tick) in /source/NBXplorer/BitcoinDWaiter.cs:line 208
info: Configuration:  BTC: Testing again in 5 seconds

The notification The node is not in a connected state is not clear to me as I can connect via ElectrumX with no problem.

Any idea what I might do wrong here? Your help is much appreciated!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:13 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
MyNameIsOkacommented, Jan 10, 2020

Thank you for that tip! In the end it was so easy…

port needed to be specifically defined for regtest. I changed port=39388 to regtest.port=39388 and then it worked. Note, I previously used port=3000 but that resulted in a different error resulting from a script running within the container.

Thanks a lot for your support!

0reactions
php-wizardcommented, Apr 14, 2021

Please try

bitcoin-cli -rpcuser=user -rpcpassword=pass help

This has probably nothing to do with NBXplorer, but how you set up your bitcoin node.

Hello i seem to have the same issue https://github.com/dgarage/NBXplorer/issues/310 , and the rpc credentials seem correct:

 litecoin-cli -rpcuser=xxx -rpcpassword=yyy getbalance
0.00000000 
Read more comments on GitHub >

github_iconTop Results From Across the Web

'The node is not in a connected state' error when trying to ...
When attempting an OP_RETURN transaction in NBitcoin, is it necessary to add the miner fees into the TransactionBuilder manually? Is there a way ......
Read more >
Node "node02" is not in "connected" state after giveback.
EMS message stating node is not in a "connected" state after giveback. ... pausedErr:error]: The automated update of the cluster has been ...
Read more >
CVO Upgrade paused on error 'node is not in connected ...
pausedErr:error]: The automated update of the cluster has been paused due to the following reason: Node "node-01": Error: {Node "node-02" is  ...
Read more >
Error messages when a cluster group online
Describes how to resolve the error messages when you try to bring a cluster group ... The cluster node is not the owner...
Read more >
Requests can only be made in the LoggedIn state, not ...
Try checking and reporting connection errors, i.e.: connection.on("connect", function (err) { if(err) { console.log('Error: ', err) } else ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found