hyperledger / caliper

A blockchain benchmark framework to measure performance of multiple blockchain solutions https://wiki.hyperledger.org/display/caliper
https://hyperledger.github.io/caliper/
Apache License 2.0
650 stars 402 forks source link

SyntaxError: Unexpected end of JSON input & ERR_IPC_CHANNEL_CLOSED #168

Closed dharuq closed 5 years ago

dharuq commented 6 years ago

I am trying to test a fabric network with caliper that have 2 orgs, each with 10 peers. But I am getting the following error.

create mychannel......

ok 1 created mychannel successfully

Sleep 5s......

Join channel......

join mychannel

ok 2 Successfully joined mychannel

install all chaincodes......

info: [packager/Golang.js]: packaging GOLANG from contract/fabric/createuser info: [packager/Golang.js]: packaging GOLANG from contract/fabric/createuser ok 3 Installed chaincode createuser_go successfully in all peers

Instantiate chaincode......

The chaincode instantiate transaction was valid. ok 4 Instantiated chaincode createuser_go successfully

Sleep 5s...

testing 'createUser'

----test round 0---- undefined:1 [{"Id":"47b37e1cb1df1df3497f812f2e2668a5958e393e73980d2ab16c96a785a5d8aa","Names":["/dev-peer5.org1.example.com-createuser_go-1"],"Image":"dev-peer5.org1.example.com-createuser_go-1-6a589914fdab6004e4b9ddadcf4574c3d7cf9d53b8256f9d55cdff4111913ad2","ImageID":"sha256:e5ea61dd6c86c114c78648d7e3e4024c020fea4732d56845f5f5966e5ebd0dd0","Command":"chaincode -peer.address=peer5.org1.example.com:7052","Created":1535119903,"Ports":[],"Labels":{"org.hyperledger.fabric.base.version":"0.4.6","org.hyperledger.fabric.chaincode.id.name":"createuser_go","org.hyperledger.fabric.chaincode.id.version":"1","org.hyperledger.fabric.chaincode.type":"GOLANG","org.hyperledger.fabric.version":"1.1.0"},"State":"running","Status":"Up 9 seconds","HostConfig":{"NetworkMode":"emr-network_default"},"NetworkSettings":{"Networks":{"emr-network_default":{"IPAMConfig":null,"Links":null,"Aliases":null,"NetworkID":"a3028a6d30d789fd3efcc0361e64c5892373aae606575935f12d6e3fb44e7425","EndpointID":"c35fa7b27efc8bd6db17ecc6c41834d8d605c231

SyntaxError: Unexpected end of JSON input at JSON.parse (<anonymous>) at Socket.socket.on (caliper/node_modules/systeminformation/lib/dockerSocket.js:44:23) at emitNone (events.js:111:20) at Socket.emit (events.js:208:7) at endReadableNT (_stream_readable.js:1064:12) at _combinedTickCallback (internal/process/next_tick.js:138:11) at process._tickCallback (internal/process/next_tick.js:180:9) ~/caliper$ doTest() with: { type: 'test', label: 'createUser', rateControl: { type: 'fixed-rate', opts: { tps: 10 } }, trim: 0, cb: 'benchmark/drm/query.js', config: 'benchmark/drm/fabric3.json', numb: 40, roundIdx: 1, totalClients: 1, clients: 1, clientargs: {}, clientIdx: 0 } Info: client 30278 start test runFixedNumber():Insert users. *** { type: 'fixed-rate', opts: { tps: 10 } } events.js:183 throw er; // Unhandled 'error' event ^

Error [ERR_IPC_CHANNEL_CLOSED]: channel closed at process.target.send (internal/child_process.js:588:16) at Timeout.txUpdate [as _onTimeout] (/src/comm/client/local-client.js:47:13) at ontimeout (timers.js:498:11) at tryOnTimeout (timers.js:323:5) at Timer.listOnTimeout (timers.js:290:5)

The fabric network is running correctly. This configuration is working for 16 peers but not with 20.

panyu4 commented 5 years ago

Did you use the composer? If you did, it is important to note that the current framework has been written to support: Hyperledger Composer v0.19.0 and higher Hyperledger Fabric v1.1.0

Or it may be a sdk compatibility issue. Please install fabric sdk v1.1.0 and retry the test. For example, npm install grpc@1.10.1 fabric-ca-client@1.1.0 fabric-client@1.1.0

aklenik commented 5 years ago

@dharuq Does the issue still persists? How is your network deployed?