5

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
christo4ferris
  • 4,039
  • 1
  • 17
  • 30
Katiyman
  • 827
  • 2
  • 12
  • 32

1 Answers1

3

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

  • The above log had couchdb connection error I resolved it, by modifying my /etc/hosts file 127.0.0.1 localhost 127.0.1.1 Openwhisk-Node2-172 172.18.0.3 couchdb 172.18.0.5 peer0.org1.example.com 172.18.0.2 orderer.example.com 172.18.0.4 ca.example.com but **still same issue**. The new logs are attached below https://pastebin.com/1CH6ikqe – Katiyman Aug 02 '17 at 05:48
  • Can this be any certificate or proxy issue?... Need pointers as to how to debug. Thanks – Katiyman Aug 03 '17 at 07:35
  • Is the client on the same machine as the Docker containers? – Gari Singh Aug 04 '17 at 12:22
  • Yes client is on the same machine – Katiyman Aug 07 '17 at 04:02
  • Latest Logs of docker logs -f peer0.org1.example.com https://pastebin.com/rt8bnTKR – Katiyman Aug 07 '17 at 04:54