JSON-RPC "couldn't connect to server" via bitcoind CLI (curl works fine)

1

This is an odd one. I am running bitcoind 0.9.1 on Ubuntu 14.04 and have this behaviour:

Doesn't work:

$ bitcoind getinfo
error: couldn't connect to server

(timeout after 30s)

Works fine:

$ curl --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getinfo", "params": [] }' -H 'content-type: text/plain;' http://user:pass@localhost:8332/
{"result":{"version":90100,"protocolversion":70002,"walletversion":60000,"balance":0.00000000,"blocks":311140,"timeoffset":0,"connections":13,"proxy":"","difficulty":17336316978.50783157,"testnet":false,"keypoololdest":1402698503,"keypoolsize":102,"paytxfee":0.00000000,"errors":""},"error":null,"id":"curltest"}

Question:

Why does the bitcoind CLI not connect to the server, but curl does?

Driving me nuts. Something buggy in 0.9.1's JSON-RPC client implementation?

meinhard

Posted 2014-07-17T10:49:38.767

Reputation: 111

I ended up setting up a new Bitcoin node at a different provider. With the same system config and bitcoin.conf there "bitcoind getinfo" works fine. I assume it has to do with firewall or loopback interface settings at the old provider. – meinhard – 2014-07-27T22:33:29.853

I turn off firewall and still get the same, that's not the answear in my opinion :/ – Sebastian Xawery Wiśniowiecki – 2014-12-15T20:54:09.647

same problem when I start via /etc/rc.local (raspberry pi) – tobi – 2017-03-20T20:46:41.363

No answers