1
I'm building a service which does some automatic Bitcoin transactions and balance checking. In the system I now created some logging, which told me that my bitcoind daemon (running on Ubuntu 14.04 server) gave an error code -9 when running the following command bitcoind getbalance. In the bitcoind source I found error code 9 described as:
RPC_CLIENT_NOT_CONNECTED = -9, // Bitcoin is not connected
About this I have 3 simple questions:
- First: what does this mean? I'm running the command on the same machine where the daemon is running, so no remote connection needed.
- Secondly; how can this happen? Why does a stable running bitcoind daemon suddenly gets disconnected?
- And most importantly; how can I prevent this from happening?
All tips are welcome!
Execute
getconnectioncountwhen this error occurs, it should return zero. A client can get disconnected when the node(s) it is connected to become unavailable. Try manually connecting to one or more fallback/trusted nodes. – George Kimionis – 2014-09-09T23:00:45.903@GeorgeKimionis - Thank you for your answer. Do you mean that my Bitcoin daemon is not connected to any other nodes on the Bitcoin network anymore? I just checked and I am now connected to 87 other nodes. How can it be that the connection count dropped to 0? Is there any way to prevent this from happening? Force more connections if it drops below a certain threshold or something? All tips are welcome! – kramer65 – 2014-09-10T14:05:21.023
It would help if you could execute
getconnectioncountwhen this happens so we'll know for sure that your client gets disconnected from the bitcoin network. Getting from 87 to 0 though is not something usual nor expected. I would suggest you check your server's connectivity, as many things could go wrong at this level. – George Kimionis – 2014-09-10T18:18:51.667BTW this is the code that controls how bitcoin accepts new connections: https://github.com/bitcoin/bitcoin/blob/master/src/net.cpp#L927
– George Kimionis – 2014-09-10T18:26:18.473