error: couldn't connect to server, but all on one server

0 votes

I've got an `error: couldn't connect to server` by doing `multichain-cli -datadir=xxxxx -port=xxx -rpcport=xxx getinfo`.
I've read http://www.multichain.com/qa/1181/error-couldnt-connect-to-server this Q&A, but the most different thing is that I have all the nodes on the same server, by the way I saw in another Q&A. (so I am connecting to a local address&port)

My `ps -x | grep multichain` looks like this;

19976 ?        SLsl   4:34 multichaind test_coin -datadir=/home/me/.multichain/administer -rpcport=47047 -port=60098 -daemon
22441 ?        SLsl   1:13 multichaind test_coin -datadir=/home/me/.multichain/node2 -rpcport=49875 -port=43441 -daemon
26075 ?        SLsl   0:01 multichaind test_coin@192.168.11.9:60098 -datadir=/home/me/.multichain/the_new_node -rpcport=55386 -port=36831 -daemon

So there were 2 nodes already, and it seems I successfully added the third one, it gave me "you need to be granted" messages and I did from the administer node. But the third node could not connect to the server.
The administer node and the second node can communicate well. I can send assets between each other.

This thing sometimes happen. What can be the reason, and how can I work around?
One information I can provide is that I had my server shutdown yesterday, I started that again, and then added the third node. Of course, I restarted the administer node beforehand. The admin/second nodes communicates after the server restart.

asked Mar 30, 2016 by ndac_todoroki

2 Answers

0 votes

I'm not sure from your description if the problem is witth multichaind not connecting to the other nodes, or multichain-cli not being able to connect to multichaind.

If the first problem, there's currently an issue with node auto-discovery and node auto-reconnection if you have multiple nodes running on the same IP address, and you need to use the addnode API to do this manually each time the node starts up. We're aware of this and will fix it in a future version.

If the second problem, you need to make sure you're using the right port numbers to talk to each node. The easiest way to do this is to put the rpcport inside the multichain.conf file for that chain on each node, then both mutichaind and multichain-cli will share the same source of the information, based on the datadir. You need to shut down and restart multichaind for this to take effect.

answered Mar 30, 2016 by MultiChain
Thanks for the answer, and I wanted to test those two, but I had the server rebooted again (before testing), killing all the multichaind.
And after restarting, the 'Cannot connect to server' didn't happen, but another curious issue happened: the node with admin and issue permissions could not grant permissions to new nodes no more. Furthermore, any nodes with receive permissions would not receive assets, but the sender loses their assets. I don't think any mining is occurring too. I now have no idea about what is going on..
Mining stops if you have mining-requires-peers switched on, and a mining node is not connected to any other peers. That would also explain why you're not seeing the transactions propagate - your nodes have become disconnected. We need to fix the problem with multiple nodes on the same IP address, hopefully in the next alpha.
Thanks for the reply. Does that mean I cannot recover from this situation?
I think this isn't a situation in a production mode, since all nodes on one server are rather ridiculous, but it may occur when in a servers' upgrades or something, so I am looking forwards for it.
You should be able to use addnode to recover from it, by manually adding peers, and this should cause the blockchain to regain consensus.

We hope to address this problem with multiple nodes on one IP address in the next alpha, or at worst the one after that.
0 votes
FYI this should be fixed in alpha 20, just released.
answered May 3, 2016 by MultiChain
...