bitcoin-cli failed with error: incorrect rpcuser or rpcpassword

1

1

When I run this command

bitcoind -testnet -printtoconsole -rpcuser=123456 -rpcpassword=123456

After bitcoind is up. I run this on the same Ubuntu 17.10

bitcoin-cli -testnet -rpcuser=123456 -rpcpassword=123456 getbalance

I get this result: error: incorrect rpcuser or rpcpassword (authorization failed) The second day I tried exactly the same way. I get the correct result. It is really weird.

I try to put these two lines in /home/user/.bitcoin/bitcoin.conf

rpcuser=123456
rpcpassword=123456

And I run this command

bitcoind -testnet -printtoconsole -conf=/home/gogogo237/.bitcoin/bitcoin.conf

And this

bitcoin-cli -testnet -rpcuser=123456 -rpcpassword=1234564 getbalance

notice that I intentionally changed -rpcpassword to a wrong password. But I still can get a correct result. This is really unpredictable and obviously a mistake. Anyone can explain this error? Thanks!

user2813549

Posted 2017-09-12T00:49:43.350

Reputation: 13

interesting, but for sure not the default behavious. I am normally on OpenSuSE. I have self compiled and downloaded full clients. Please provide some more info: did you use bitcoin core from website? Self compiled? apt-get? Did you check download files (hash)? I think I have a fresh Ubuntu virtual machine, where I could try to install the one you where using...pebwindkraft 2017-09-12T17:26:23.940

Self compiled from the newest source code.user2813549 2017-09-13T07:04:15.277

similiar discussion here, as bitcoin15 is not yet released: https://bitcointalk.org/index.php?topic=2172765.0. You downloaded from https://github.com/bitcoin/bitcoin?

pebwindkraft 2017-09-13T14:48:57.807

just downloaded from github, and couldn't compile, cause autoconf throws already some errors. And for sure ./configure as well. Damn, wanting to help, and now need help myself ...pebwindkraft 2017-09-13T18:04:03.640

To avoid others doing same error (RTFM correctly, not in a rush): autogen.sh, not autoconf !! Now it's compiling. Update to follow.pebwindkraft 2017-09-13T18:35:38.280

Answers

2

re-compiled on an Ubuntu system, fresh from github.com:

$ uname -a
Linux ubuntu-ae 4.10.0-19-generic

$ bitcoind -version
Bitcoin Core Daemon version v0.15.99.0-g96ac26e5662

$ bitcoind -testnet -printtoconsole -rpcuser=123456 -rpcpassword=123456

$ bitcoin-cli -testnet -rpcuser=123456 -rpcpassword=123456 getaccountaddress "myaccount"
n2r1aQiA37LLgy4qWjuLHXqA9ZhtcX4KG6

$ bitcoin-cli -testnet -rpcuser=123456 -rpcpassword=123456 getbalance
0.00000000

and with wrong password:

$ bitcoin-cli -testnet -rpcuser=123456 -rpcpassword=1234564 getbalance
error: incorrect rpcuser or rpcpassword (authorization failed)

so s.th. is wrong with the sources? Or with Ubuntu setup. What kernel do you have (uname -a) ?

pebwindkraft

Posted 2017-09-12T00:49:43.350

Reputation: 4 568

just compiled the newest version. Here is my command $ bitcoind -testnet -printtoconsole -rpcuser=123456 -rpcpassword=123456 bitcoin-cli -testnet getbalance It just work! Wierd.user2813549 2017-09-22T02:57:55.867