IBM BLUEMIX BLOCKCHAIN SDK-DEMO failing

0 votes

I have been working with HFC SDK for Node.js and it used to work, but since last night I am having some problems.

When running helloblockchain.js only few times works, most time I get this error when it tries to enroll a new user:

E0113 11:56:05.983919636    5288 handshake.c:128]            Security handshake failed: {"created":"@1484304965.983872199","description":"Handshake read failed","file":"../src/core/lib/security/transport/handshake.c","file_line":237,"referenced_errors":[{"created":"@1484304965.983866102","description":"FD shutdown","file":"../src/core/lib/iomgr/ev_epoll_linux.c","file_line":948}]}

Error:  Failed to register and enroll JohnDoe: Error

Other times, the enroll works and the failure appears deploying the chaincode:

Enrolled and registered JohnDoe successfully

Deploying chaincode ...
E0113 12:14:27.341527043    5455 handshake.c:128]            Security handshake failed: {"created":"@1484306067.341430168","description":"Handshake read failed","file":"../src/core/lib/security/transport/handshake.c","file_line":237,"referenced_errors":[{"created":"@1484306067.341421859","description":"FD shutdown","file":"../src/core/lib/iomgr/ev_epoll_linux.c","file_line":948}]}

Failed to deploy chaincode: request={"fcn":"init","args":["a","100","b","200"],"chaincodePath":"chaincode","certificatePath":"/certs/peer/cert.pem"}, error={"error":{"code":14,"metadata":{"_internal_repr":{}}},"msg":"Error"}

Or:

Enrolled and registered JohnDoe successfully

Deploying chaincode ...
E0113 12:15:27.448867739    5483 handshake.c:128]            Security handshake failed: {"created":"@1484306127.448692244","description":"Handshake read failed","file":"../src/core/lib/security/transport/handshake.c","file_line":237,"referenced_errors":[{"created":"@1484306127.448668047","description":"FD shutdown","file":"../src/core/lib/iomgr/ev_epoll_linux.c","file_line":948}]}
events.js:160
  throw er; // Unhandled 'error' event
  ^

Error
at ClientDuplexStream._emitStatusIfDone (/usr/lib/node_modules/hfc/node_modules/grpc/src/node/src/client.js:189:19)
at ClientDuplexStream._readsDone (/usr/lib/node_modules/hfc/node_modules/grpc/src/node/src/client.js:158:8)
at readCallback (/usr/lib/node_modules/hfc/node_modules/grpc/src/node/src/client.js:217:12)
E0113 12:15:27.563487641    5483 handshake.c:128]            Security handshake failed: {"created":"@1484306127.563437122","description":"Handshake read failed","file":"../src/core/lib/security/transport/handshake.c","file_line":237,"referenced_errors":[{"created":"@1484306127.563429661","description":"FD shutdown","file":"../src/core/lib/iomgr/ev_epoll_linux.c","file_line":948}]}

This code worked yesterday, so I don't know what could be happening.

Does anybody know how can I fix it?

Thanks, Javier.

Aug 3, 2018 in Blockchain by aryya
• 7,460 points
689 views

1 answer to this question.

0 votes

These types of intermittent issues are usually related to GRPC. An initial suggestion is to ensure that you are using at least GRPC version 1.0.0.

If you are using a Mac, then the maximum number of open file descriptors should be checked (using ulimit -n). Sometimes this is initially set to a low value such as 256, so increasing the value could help.

There are a couple of GRPC issues with similar symptoms.

There is a grpc.initial_reconnect_backoff_ms property that is mentioned in some of these issues. Increasing the value past the 1000 ms level might help reduce the frequency of issues. Below are instructions for how the helloblockchain.js file can be modified to set this property to a higher value.

  1. Open the helloblockchain.js file in the Hyperledger Fabric Client example and find the enrollAndRegisterUsers function.
  2. Add “grpc.initial_reconnect_backoff_ms": 5000 to the setMemberServicesUrl call.

    chain.setMemberServicesUrl(ca_url, {
            pem: cert, "grpc.initial_reconnect_backoff_ms": 5000
    });
    
  3. Add “grpc.initial_reconnect_backoff_ms": 5000 to the addPeer call.

    chain.addPeer("grpcs://" + peers[i].discovery_host + ":" + peers[i].discovery_port, 
    {pem: cert, "grpc.initial_reconnect_backoff_ms": 5000
    });       
    

Note that setting the grpc.initial_reconnect_backoff_ms property may reduce the frequency of issues, but it will not necessarily eliminate all issues.

The connection to the eventhub that is made in the helloblockchain.js file can also be a factor. There is an earlier version of the Hyperledger Fabric Client that does not utilize the eventhub. This earlier version could be tried to determine if this makes a difference. After running git clone https://github.com/IBM-Blockchain/SDK-Demo.git, run git checkout b7d5195 to use this prior level. Before running node helloblockchain.js from a Node.js command window, the git status command can be used to check the code level that is being used.

answered Aug 3, 2018 by charlie_brown
• 7,720 points

Related Questions In Blockchain

+1 vote
1 answer

How do i change the names of validating peers in IBM Bluemix blockchain?

IBM Bluemix Blockchain service Hyperledger Fabric v0.6 will ...READ MORE

answered Apr 11, 2018 in Blockchain by Perry
999 views
+1 vote
1 answer

Car lease demo database location in IBM blockchain

Firstly, yes you can change the default DB ...READ MORE

answered Jun 7, 2018 in Blockchain by Christine
• 15,790 points
1,460 views
0 votes
1 answer

Not being able to deploy blockchain demo app on bluemix

The car lease demo's "Deploy to Bluemix" ...READ MORE

answered Jul 11, 2018 in Blockchain by Shashank
• 10,400 points
743 views
+4 votes
4 answers

What are the implementations of IBM blockchain?

IBM is an open source community of ...READ MORE

answered Mar 30, 2018 in Blockchain by Christine
• 15,790 points
1,170 views
0 votes
1 answer

Hyperledger Sawtooth vs Quorum in concurrency and speed Ask

Summary: Both should provide similar reliability of ...READ MORE

answered Sep 26, 2018 in IoT (Internet of Things) by Upasana
• 8,620 points
1,469 views
0 votes
1 answer

Invalid Batch or signature in Savtooth

This will solve your problem import org.apache.commons.codec.binary.Hex; Transaction txn ...READ MORE

answered Aug 1, 2018 in Blockchain by digger
• 26,740 points
1,036 views
+1 vote
1 answer
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP