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
649 stars 402 forks source link

BAD_REQUEST when creating channel, orderer.js #109

Closed jamievaravara closed 6 years ago

jamievaravara commented 6 years ago

Hi,

I'm trying to start the Fabric benchmark, but it all stops when its trying to create the channels.

This is my command + output.

sudo node benchmark/simple/main.js TAP version 13

Caliper Test

docker-compose -f network/fabric/simplenetwork/docker-compose.yaml up -d simplenetwork_ca_1 is up-to-date orderer.example.com is up-to-date ca_peerOrg1 is up-to-date ca_peerOrg2 is up-to-date Starting simplenetwork_peer_1 ... peer1.org1.example.com is up-to-date peer1.org2.example.com is up-to-date peer0.org2.example.com is up-to-date Starting simplenetwork_peer_1 ... done

create mychannel......

error: [Orderer.js]: sendBroadcast - reject with BAD_REQUEST not ok 1 Failed to create channels Error: BAD_REQUEST at ClientDuplexStream. (/home/thesis/Downloads/caliper-master/node_modules/fabric-client/lib/Orderer.js:116:21) at emitOne (events.js:116:13) at ClientDuplexStream.emit (events.js:211:7) at addChunk (_stream_readable.js:263:12) at readableAddChunk (_stream_readable.js:250:11) at ClientDuplexStream.Readable.push (_stream_readable.js:208:10) at readCallback (/home/thesis/Downloads/caliper-master/node_modules/grpc/src/client.js:312:14)

operator: fail
at: channels.reduce.then.then.catch (/home/thesis/Downloads/caliper-master/src/fabric/create-channel.js:160:19)
stack: |-
  Error: Failed to create channels Error: BAD_REQUEST
      at ClientDuplexStream.<anonymous> (/home/thesis/Downloads/caliper-master/node_modules/fabric-client/lib/Orderer.js:116:21)
      at emitOne (events.js:116:13)
      at ClientDuplexStream.emit (events.js:211:7)
      at addChunk (_stream_readable.js:263:12)
      at readableAddChunk (_stream_readable.js:250:11)
      at ClientDuplexStream.Readable.push (_stream_readable.js:208:10)
      at readCallback (/home/thesis/Downloads/caliper-master/node_modules/grpc/src/client.js:312:14)
      at Test.assert [as _assert] (/home/thesis/Downloads/caliper-master/node_modules/tape/lib/test.js:224:54)
      at Test.bound [as _assert] (/home/thesis/Downloads/caliper-master/node_modules/tape/lib/test.js:76:32)
      at Test.fail (/home/thesis/Downloads/caliper-master/node_modules/tape/lib/test.js:317:10)
      at Test.bound [as fail] (/home/thesis/Downloads/caliper-master/node_modules/tape/lib/test.js:76:32)
      at channels.reduce.then.then.catch (/home/thesis/Downloads/caliper-master/src/fabric/create-channel.js:160:19)
      at <anonymous>
      at process._tickCallback (internal/process/next_tick.js:188:7)

... fabric.init() failed, Error: Fabric: Create channel failed at channels.reduce.then.then.catch (/home/thesis/Downloads/caliper-master/src/fabric/create-channel.js:161:31) at at process._tickCallback (internal/process/next_tick.js:188:7) not ok 2 TypeError: Cannot read property 'getUpdates' of undefined

operator: error
expected: |-
  undefined
actual: |-
  [TypeError: Cannot read property 'getUpdates' of undefined]
at: process.onetime (/home/thesis/Downloads/caliper-master/node_modules/tape-promise/node_modules/onetime/index.js:22:12)
stack: |-
  TypeError: Cannot read property 'getUpdates' of undefined
      at update (/home/thesis/Downloads/caliper-master/src/gui/src/demo.js:145:26)
      at Object.demoStopWatch [as stopWatch] (/home/thesis/Downloads/caliper-master/src/gui/src/demo.js:185:5)
      at startPromise.then.then.then.then.then.then.catch (/home/thesis/Downloads/caliper-master/src/comm/bench-flow.js:347:18)
      at <anonymous>
      at process._tickCallback (internal/process/next_tick.js:188:7)

...

1..2

tests 2

pass 0

fail 2

haojun commented 6 years ago

Please try to stop and remove all fabric containers first, then run the test again.

docker stop $(docker ps -aq) docker rm $(docker ps -aq)

jamievaravara commented 6 years ago

Thank you @haojun that saved me. I had to write sudo in front of docker though, so these are the commands I had to run:

sudo docker stop $(sudo docker ps -aq) sudo docker rm $(sudo docker ps -aq)

aklenik commented 6 years ago

@jamievaravara To avoid sudo with docker, follow these steps.

jamievaravara commented 6 years ago

Thank you very much @aklenik