Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting connection failed in Hyperledger Fabric sample

Hello i am new to Hyperledger Fabric.

I have just started to work with it, i was doing the very first sample from http://hyperledger-fabric.readthedocs.io/en/latest/write_first_app.html

I followed prerequisite installation from http://hyperledger-fabric.readthedocs.io/en/latest/prereqs.html

my OS is ubuntu 16.04 and i am behind proxy

When i Run node query.js i get below error

Create a client and set the wallet location
Set wallet path, and associate user PeerAdmin with application
Check user is enrolled, and set a query URL in the network
Make query
Assigning transaction_id: a85d2111f5d6e5eef064f87de42be677e69849724b1242dca0503be84d397f5d
error: [client-utils.js]: sendPeersProposal - Promise is rejected: Error: Connect Failed
at /home/nokia/hyperledger/firstApp/fabric-samples/fabcar/node_modules/grpc/src/node/src/client.js:434:17
returned from query
Query result count = 1
error from query = { Error: Connect Failed
at /home/nokia/hyperledger/firstApp/fabric-samples/fabcar/node_modules/grpc/src/node/src/client.js:434:17 code: 14, metadata: Metadata { _internal_repr: {} } }
Response is Error: Connect Failed
like image 524
Katiyman Avatar asked Oct 17 '22 08:10

Katiyman


1 Answers

When the peer goes down or not responsive we see this error. I could recreate the same issue by stopping the peer. once it is started again.

$ docker stop peer0.org1.example.com
peer0.org1.example.com

$ node query.js
Create a client and set the wallet location
Set wallet path, and associate user  PeerAdmin  with application
Check user is enrolled, and set a query URL in the network
Make query
Assigning transaction_id:  c450608388799e3ca76e20b96010283202832c31ba9ae62c1ae4648c6353334b
error: [client-utils.js]: sendPeersProposal - Promise is rejected: Error: Connect Failed
    at /home/ibmadmin/fabric-samples/fabcar/node_modules/grpc/src/node/src/client.js:434:17
returned from query
Query result count =  1
error from query =  { Error: Connect Failed
    at /home/ibmadmin/fabric-samples/fabcar/node_modules/grpc/src/node/src/client.js:434:17 code: 14, metadata: Metadata { _internal_repr: {} } }
Response is  Error: Connect Failed

Could see the response for the query, once the peer is started

$docker start peer0.org1.example.com
peer0.org1.example.com

    $node query.js
    Create a client and set the wallet location
    Set wallet path, and associate user  PeerAdmin  with application
    Check user is enrolled, and set a query URL in the network
    Make query
    Assigning transaction_id:  21a6cc3cd27e098da355da00ba3aa8819e84bc4c2e81768dba2a88a8125b380c
    returned from query
    Query result count =  1
    Response is  [{"Key":"CAR0", "Record":{"colour":"blue","make":"Toyota","model":"Prius","owner":"Tomoko"}},{"Key":"CAR1", "Record":{"colour":"red","make":"Ford","model":"Mustang","owner":"Brad"}},{"Key":"CAR2", "Record":{"colour":"green","make":"Hyundai","model":"Tucson","owner":"Jin Soo"}},{"Key":"CAR3", "Record":{"colour":"yellow","make":"Volkswagen","model":"Passat","owner":"Max"}},{"Key":"CAR4", "Record":{"colour":"black","make":"Tesla","model":"S","owner":"Adriana"}},{"Key":"CAR5", "Record":{"colour":"purple","make":"Peugeot","model":"205","owner":"Michel"}},{"Key":"CAR6", "Record":{"colour":"white","make":"Chery","model":"S22L","owner":"Aarav"}},{"Key":"CAR7", "Record":{"colour":"violet","make":"Fiat","model":"Punto","owner":"Pari"}},
{"Key":"CAR8", "Record":{"colour":"indigo","make":"Tata","model":"Nano","owner":"Valeria"}},{"Key":"CAR9", "Record":{"colour":"brown","make":"Holden","model":"Barina","owner":"Shotaro"}}]

However, in your case peer seems to be running. To understand more, can you share the peer logs please.

docker logs -f peer0.org1.example.com

like image 187
Ratnakar Asara Avatar answered Oct 21 '22 04:10

Ratnakar Asara