Fabic: Issue connection refused 7050 - hyperledger-fabric

I am trying to create a network from the hyperledger fabic tutorial. I get the following error:
Error: failed to create deliver client for orderer: orderer client failed to connect to localhost:7050: failed to create new connection: connection error: desc = "transport: error while dialing: dial tcp [::1]:7050: connect: connection refused"
I opened up the port on the Centos 7 Virtual machine and still no luck. The docker container is exposing the port to the host.
I removed all docker containers, images and volumes. I even rebuilt the VM from scratch.
Any help would be great.
Thanks,

This situation is happened because you called a gRPC to orderer server but your call failed to hit the server. This situation may happen for many reasons, but for most of the cases the situation is happened due to server down(orderer server exit or down due to misconfiguration) or your call failed to hit the server due to misconfiguration.

I somehow encounter this problem before and the port was opened. Somehow it was a mistake where I forgot to put '-a' in command (launch cerificate authorities). Hope it help.
You might also refer this : https://hyperledger-fabric.readthedocs.io/en/release-2.0/build_network.html

Related

rafthttp: dial tcp timeout on etcd 3-node cluster creation

I don't have an access to the etcd part of the project's source code, however I do have access to the /var/log/syslog.
The goal is to setup up 3-node cluster.
(1)The very first etcd error that comes up is:
rafthttp: failed to dial 76e7ffhh20007a98 on stream MsgApp v2 (dial tcp 10.0.0.134:2380: i/o timeout)
Before continuing, I would say that I can ping all three nodes from each of the nodes. As well as I have tried to open the 2380 TCP ports and still no success - same error.
(2)So, before that error I had following messages from the etcd, which in my opinion confirm that cluster is setup correctly:
etcdserver/membership: added member 76e7ffhh20007a98 [https://server2:2380]
etcdserver/membership: added member 222e88db3803e816 [https://server1:2380]
etcdserver/membership: added member 999115e00e17123d [https://server3:2380]
In /etc/hosts file these DNS names are resolved as:
server2 10.0.0.135
server1 10.0.0.134
server3 10.0.0.136
(3)The initial setup, however (on each nodes looks like this):
embed: listening for peers on https://127.0.0.1:2380
embed: listening for client requests on 127.0.0.1:2379
So, to sum up, each node have got this initial setup log (3) and then adds members (2) then once these steps are done it fails with (1). As I know the etcd cluster creation is following this pattern: https://etcd.io/docs/v3.5/tutorials/how-to-setup-cluster/
Without knowing the source code is really hard to debug, however maybe some ideas on the error and what could cause it?
UPD: etcdctl cluster-health output (ETCDCTL_ENDPOINT is exported):
cluster may be unhealthy: failed to list members Error: client: etcd
cluster is unavailable or misconfigured; error #0: client: endpoint
http://127.0.0.1:2379 exceeded header timeout ; error #1: dial tcp
127.0.0.1:4001: connect: connection refused
error #0: client: endpoint http://127.0.0.1:2379 exceeded header
timeout error #1: dial tcp 127.0.0.1:4001: connect: connection refused

How to install MongoDB Enterprise 4.4 on remote redhat server?

I followed the instructions listed here, https://docs.mongodb.com/manual/tutorial/install-mongodb-enterprise-on-red-hat/, and tried to install on a remote server from my local machine. I ssh from my local machine into the server and performed the steps for installation.
I'm not sure if there are additional steps that need to be completed or whether you have to set Directory Paths that are not the default ones since you are using a server instead of local machine. My current error is when I run mongo from my terminal and I get this error
Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed: SocketException: Error connecting to 127.0.0.1:27017 :: caused by :: Connection refused :
connect#src/mongo/shell/mongo.js:374:17
#(connect):2:6
exception: connect failed
exiting with code 1
[h699972#csc2cxp00020938 ~]$ mongo --host
sudo vim /etc/mongod.conf and setting bindIp: 0.0.0.0 did not work. Any help would be appreciated.

Errors seen when setting up logspout in Hyperledger fabric 2.2

Following steps described here to setup logspout:
https://hyperledger-fabric.readthedocs.io/en/release-2.2/deploy_chaincode.html
Running this produces below errors:
./monitordocker.sh net_test
Starting monitoring on all containers on the network net_test
xxxx
docker: Error response from daemon: network net_test not found.
curl: (7) Failed to connect to 127.0.0.1 port 8000: Connection refused
xxx#xxxx:/home/fabric/fabric-samples/test-network#
xxx#xxxx:/home/fabric/fabric-samples/test-network# ./monitordocker.sh
Starting monitoring on all containers on the network basicnetwork_basic
xxxx
docker: Error response from daemon: network basicnetwork_basic not found.
curl: (7) Failed to connect to 127.0.0.1 port 8000: Connection refused
xxx#xxxx:/home/fabric/fabric-samples/test-network#
xxxx#xxxx:/home/fabric/fabric-samples/test-network# ./monitordocker.sh net_basic
Starting monitoring on all containers on the network net_basic
xxxx
docker: Error response from daemon: network net_basic not found.
curl: (7) Failed to connect to 127.0.0.1 port 8000: Connection refused
Few questions:
there is no process running in default port 8000. So connection refused error is expected. Do we need to use any other port ?
what is the name of the network to be given when running monitordocker.sh ?
Any other troubleshooting info is appreciated.
Ok, found the issue. The network name is fabric_test. So I issued command like
./monitordocker.sh fabric_test
This resolved the problem.

Hyperledger Fabric, javascript fabcar chaincode error. Transport: error while dialing: dial tcp 127.0.0.1:7051: connect: connection refused

I am having the same problem with Hyperledger fabric 2.1.1, but I am able to run test network with default options, but when I try to run Fabcar javascript chaincode I get an error:
Error: error getting endorser client for channel: endorser client failed to connect to localhost:7051: failed to create new connection: connection error: desc = "transport: error while dialing: dial tcp 127.0.0.1:7051: connect: connection refused"
I have tried everything mentioned in thread Error deploying Fabric test-network fabcar chaincode, removed docker images, ran prune, removed organizations data and fired ./network.sh up createChannel -ca -c mychannel -s couchdb -i 2.1.1, but the error is still there. Also, my RAM is 16Gb, so the problem is not there. Any other suggestion, please ?
This situation is happened because you called a gRPC to 127.0.0.1:7051 server but your call failed to hit the server. This situation may happen for many reasons, but for most of the cases the situation is happened due to server down(server exit or down due to misconfiguration) or for wrong certificate or your call failed to hit the server due to misconfiguration.
Please check the following docker container and ensure that is running properly.

Issues while testing a node.js server with siege

I was doing some load testing for my node.js server(a small webapp) using siege. I could see that for even small number of concurrent connection like 300, it showed some errors
siege -c 300 -n myserver.com:3000
Then I could see some results like
[error] socket: read error Connection reset by peer sock.c:460: Connection reset by peer
[error] socket: read error Connection reset by peer sock.c:460: Connection reset by peer
[error] socket: read error Connection reset by peer sock.c:460: Connection reset by peer
[error] socket: read error Connection reset by peer sock.c:460: Connection reset by peer
[error] socket: read error Connection reset by peer sock.c:460: Connection reset by peer
[error] socket: read error Connection reset by peer sock.c:460: Connection reset by peer
[error] socket: read error Connection reset by peer sock.c:460: Connection reset by peer
[error] socket: read error Connection reset by peer sock.c:460: Connection reset by peer
I could see that the server is closing the connections. Why is it so. How can I debug it. I have a server running on Macbook pro with 4GB memory. I want to let you know that I have used websockets. That is the clients visit a page returned by the web server running on node.js . This page then uses websockets to connect to the same server for two way communication. What could cause such issue?
When running into a situation where you belive you may be running out of sockets, there are two things to confirm.
Check that you are closing your sockets explicitly. In some languages the garbage collector's finalization logic will clean up after you, but this involves lag and is sloppy; in other languages that don't do this, your application will "leak" sockets (and thus file handles) until it terminates.
Make your OS allows your application's user account enough peak sockets for your test.
To address point 1: Are you closing your sockets? I am not a heavy node.js user, but I think:
var conn = new net.Socket();
conn.destroy(); //Are you doing this?
To address point 2: Set the hard and soft open file limit to something high enough to stay out of your way:
launchctl limit maxfiles 8192 8192
Running sudo launchctl limit with no arguments should print out your current limits. Check out the Apple documentation for launchctl for more details.

Resources