V4 install hangs at starting bitcoind process

I’m having trouble installing version 4 of bitcore. I had version 3 running but i switched to version 4 and the “bitcored” command fails every time and says:

error: Failed to start services
[2016-05-31T05:39:44.776Z] error: RPCError: Bitcoin JSON-RPC: Connection Rejected: 401 Unnauthorized
at Bitcoin._wrapRPCError (/home/kreshendo/mynode/node_modules/bitcore-node/lib/services/bitcoind.js:416:13)
at /home/kreshendo/mynode/node_modules/bitcore-node/lib/services/bitcoind.js:749:28
at IncomingMessage. (/home/kreshendo/mynode/node_modules/bitcoind-rpc/lib/index.js:81:9)
at emitNone (events.js:72:20)
at IncomingMessage.emit (events.js:166:7)
at endReadableNT (_stream_readable.js:913:12)
at nextTickCallbackWith2Args (node.js:442:9)
at process._tickCallback (node.js:356:17)

Have you updated your bitcoin.conf? There are upgrade notes here:

Bitcore upgrade notes (4.0.0):

Bitcoin Core upgrade notes (0.12.0):

yeah everything in it is up to date. I just got the same error again.

I’m not sure if it’s related, but I have similar issue after installing a new bitcore-node. It just shuts down after some time with the same exception. Could it be something related to a firewall?

I have tried a couple more times and it looks like the web service is having issues starting up. What could be causing this because the terminal isn’t printing anything about why the web service won’t start.

Last lines in my debug.log:

2016-05-31 13:52:26 ThreadRPCServer incorrect password attempt from 127.0.0.1:51599
2016-05-31 13:52:26 UpdateTip: new best=0000000000000025e97dca37737d748425daf7e8740520237abea1fea8597caf height=258898 log2_work=72.046124 tx=24088807 date=2013-09-19 21:41:46 progress=0.088775 cache=59.0MiB(81136tx)
2016-05-31 13:52:26 UpdateTip: new best=000000000000000404ed03cd8174c36c58de543d27f89550a23c95c3a7978afc height=258899 log2_work=72.046267 tx=24088935 date=2013-09-19 21:42:46 progress=0.088776 cache=59.0MiB(81172tx)
2016-05-31 13:52:26 UpdateTip: new best=0000000000000013d9bd1ca522aa1ab5ec4db22d682d76d00d0f545d7c55527f height=258900 log2_work=72.04641 tx=24088966 date=2013-09-19 21:45:13 progress=0.088776 cache=59.1MiB(81183tx)
2016-05-31 13:52:26 tor: Thread interrupt
2016-05-31 13:52:26 torcontrol thread exit
2016-05-31 13:52:26 addcon thread interrupt
2016-05-31 13:52:26 opencon thread interrupt
2016-05-31 13:52:26 scheduler thread interrupt
2016-05-31 13:52:26 net thread interrupt
2016-05-31 13:52:27 msghand thread interrupt
2016-05-31 13:52:27 Shutdown: In progress…
2016-05-31 13:52:27 StopNode()
2016-05-31 13:52:27 Shutdown: done

I found this line, maybe it is a root casuse of a problem that password is not taken from config file:
No rpcpassword set - using random cookie authentication

rpcuser and rpcpassword must both be set currently, cookie based auth support could be added (but I may not currently work).

i have rpcuser and rpcpassword set in my bitcoin.conf file but I’m still getting the error.

For /path/to/datadir/bitcoin.conf and not for testnet3 or regtest?

yes. but i’m trying to run a testnet3 node.

Does the debug.log show any problems /path/to/datadir/testnet3/debug.log ?

this was at the bottom of the debub.log file:

2016-05-31 14:29:28 tor: Thread interrupt
2016-05-31 14:29:28 torcontrol thread exit
2016-05-31 14:29:28 net thread interrupt
2016-05-31 14:29:28 addcon thread interrupt
2016-05-31 14:29:28 opencon thread interrupt
2016-05-31 14:29:28 scheduler thread interrupt
2016-05-31 14:29:28 msghand thread interrupt
2016-05-31 14:29:28 Shutdown: In progress…
2016-05-31 14:29:29 StopNode()
2016-05-31 14:29:31 Shutdown: done

The problem is that user and password are set in config file:)

So do I take them out of the config file or what?

Yes, both rpcuser and rpcpassword must currently be included, see: https://github.com/bitpay/bitcore-node/blob/master/lib/services/bitcoind.js#L858-864

they have been in the file the whole time and the error still occurs every time I run bitcored

Do you have another node that it may be trying to connect to? You should see corresponding reject errors in the debug.log (or have a successful connection).

Maybe that’s the problem. I had a node set up and running and I deleted that node directory and began setting up the v4 node and that’s when I got the error. The old bitcoin folder is still in my home directory.

Its still not working. maybe the set up is different for running a testnet node. I haven’t been able to run fully start this bitcoin node all day. how do I down grade to version 3?