原文: https://blog.csdn.net/raogeeg/article/details/82752613

安装方法详见:https://github.com/hyperledger/caliper

hyperledger caliper 使用过程的一些坑以及解决办法

not ok 2 Failed to join peers, TypeError: Cannot read property ‘getConnectivityState’ of undefined at EventHub._checkConnection

# create mychannel......
ok 1 created mychannel successfully
# Sleep 5s......
# Join channel......
# join mychannel
not ok 2 Failed to join peers, TypeError: Cannot read property 'getConnectivityState' of undefined at EventHub._checkConnection (/Users/rjj/go/src/github.com/hyperledger/caliper/node_modules/fabric-client/lib/EventHub.js:479:39) at EventHub.registerBlockEvent (/Users/rjj/go/src/github.com/hyperledger/caliper/node_modules/fabric-client/lib/EventHub.js:658:8) at Promise (/Users/rjj/go/src/github.com/hyperledger/caliper/src/fabric/join-channel.js:139:20) at new Promise (<anonymous>) at eventhubs.forEach (/Users/rjj/go/src/github.com/hyperledger/caliper/src/fabric/join-channel.js:136:29) at Array.forEach (<anonymous>) at Client.newDefaultKeyValueStore.then.then.then.then (/Users/rjj/go/src/github.com/hyperledger/caliper/src/fabric/join-channel.js:135:19) at <anonymous>
---
operator: fail
at: channels.reduce.then.catch (/Users/rjj/go/src/github.com/hyperledger/caliper/src/fabric/join-channel.js:215:19)
stack: |-
Error: Failed to join peers, TypeError: Cannot read property 'getConnectivityState' of undefined
at EventHub._checkConnection (/Users/rjj/go/src/github.com/hyperledger/caliper/node_modules/fabric-client/lib/EventHub.js:479:39)
at EventHub.registerBlockEvent (/Users/rjj/go/src/github.com/hyperledger/caliper/node_modules/fabric-client/lib/EventHub.js:658:8)
at Promise (/Users/rjj/go/src/github.com/hyperledger/caliper/src/fabric/join-channel.js:139:20)
at new Promise (<anonymous>)
at eventhubs.forEach (/Users/rjj/go/src/github.com/hyperledger/caliper/src/fabric/join-channel.js:136:29)
at Array.forEach (<anonymous>)
at Client.newDefaultKeyValueStore.then.then.then.then (/Users/rjj/go/src/github.com/hyperledger/caliper/src/fabric/join-channel.js:135:19)
at <anonymous>
at Test.assert [as _assert] (/Users/rjj/go/src/github.com/hyperledger/caliper/node_modules/tape/lib/test.js:224:54)
at Test.bound [as _assert] (/Users/rjj/go/src/github.com/hyperledger/caliper/node_modules/tape/lib/test.js:76:32)
at Test.fail (/Users/rjj/go/src/github.com/hyperledger/caliper/node_modules/tape/lib/test.js:317:10)
at Test.bound [as fail] (/Users/rjj/go/src/github.com/hyperledger/caliper/node_modules/tape/lib/test.js:76:32)
at channels.reduce.then.catch (/Users/rjj/go/src/github.com/hyperledger/caliper/src/fabric/join-channel.js:215:19)
at <anonymous>
...
fabric.init() failed, Error: Fabric: Join channel failed
at channels.reduce.then.catch (/Users/rjj/go/src/github.com/hyperledger/caliper/src/fabric/join-channel.js:216:31)
at <anonymous>
[Transaction Info] - Submitted: 0 Succ: 0 Fail:0 Unfinished:0
unexpected error, Error: Fabric: Join channel failed
at channels.reduce.then.catch (/Users/rjj/go/src/github.com/hyperledger/caliper/src/fabric/join-channel.js:216:31)
at <anonymous>
docker-compose -f network/fabric/simplenetwork/docker-compose.yaml down;docker rm $(docker ps -aq);docker rmi $(docker images dev* -q)
/Users/rjj/go/src/github.com/hyperledger/caliper/node_modules/fabric-client/lib/EventHub.js:308
if(self._stream) state = self._stream.call.channel_.getConnectivityState();
^

TypeError: Cannot read property 'getConnectivityState' of undefined
at ClientDuplexStream.<anonymous> (/Users/rjj/go/src/github.com/hyperledger/caliper/node_modules/fabric-client/lib/EventHub.js:308:56)
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 Object.onReceiveMessage (/Users/rjj/go/src/github.com/hyperledger/caliper/node_modules/grpc/src/client_interceptors.js:1276:19)
at InterceptingListener.recvMessageWithContext (/Users/rjj/go/src/github.com/hyperledger/caliper/node_modules/grpc/src/client_interceptors.js:603:19)
at /Users/rjj/go/src/github.com/hyperledger/caliper/node_modules/grpc/src/client_interceptors.js:702:14

解决方法:

使用grpc version 1.10.1 代替之前的1.13.1版本
npm install grpc@1.10.1
2:not ok 1 Failed to create channels Error: create status is BAD_REQUEST at channel.organizations.reduce.then.then.then

# create mychannel......
not ok 1 Failed to create channels Error: create status is BAD_REQUEST at channel.organizations.reduce.then.then.then (/Users/rjj/go/src/github.com/hyperledger/caliper/src/fabric/create-channel.js:145:43) at <anonymous> at process._tickCallback (internal/process/next_tick.js:188:7)
---
operator: fail
at: channels.reduce.then.then.catch (/Users/rjj/go/src/github.com/hyperledger/caliper/src/fabric/create-channel.js:159:19)
stack: |-
Error: Failed to create channels Error: create status is BAD_REQUEST
at channel.organizations.reduce.then.then.then (/Users/rjj/go/src/github.com/hyperledger/caliper/src/fabric/create-channel.js:145:43)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
at Test.assert [as _assert] (/Users/rjj/go/src/github.com/hyperledger/caliper/node_modules/tape/lib/test.js:224:54)
at Test.bound [as _assert] (/Users/rjj/go/src/github.com/hyperledger/caliper/node_modules/tape/lib/test.js:76:32)
at Test.fail (/Users/rjj/go/src/github.com/hyperledger/caliper/node_modules/tape/lib/test.js:317:10)
at Test.bound [as fail] (/Users/rjj/go/src/github.com/hyperledger/caliper/node_modules/tape/lib/test.js:76:32)
at channels.reduce.then.then.catch (/Users/rjj/go/src/github.com/hyperledger/caliper/src/fabric/create-channel.js:159: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 (/Users/rjj/go/src/github.com/hyperledger/caliper/src/fabric/create-channel.js:160:31)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
[Transaction Info] - Submitted: 0 Succ: 0 Fail:0 Unfinished:0
unexpected error, Error: Fabric: Create channel failed
at channels.reduce.then.then.catch (/Users/rjj/go/src/github.com/hyperledger/caliper/src/fabric/create-channel.js:160:31)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
docker-compose -f network/fabric/simplenetwork/docker-compose.yaml down;docker rm $(docker ps -aq);docker rmi $(docker images dev* -q)```

解决办法:

和之前搭建fabric环境遇到的问题一样,BAD_REQUEST 经常是当前要创建的channel 已经存在所以会出现这个错误,
我们可以通过docker rm -f $(docker ps -q -a)
移除之前的容器,但是如果不是channnel 已存在的问题 ,暂时就不知道怎么解决了
error: [Peer.js]: sendProposal - timed out after:120000

# Instantiate chaincode......
error: [Peer.js]: sendProposal - timed out after:120000
error: [Peer.js]: sendProposal - timed out after:120000
error: [Peer.js]: sendProposal - timed out after:120000
error: [Peer.js]: sendProposal - timed out after:120000
error: [client-utils.js]: sendPeersProposal - Promise is rejected: Error: REQUEST_TIMEOUT
at Timeout._onTimeout (/Users/rjj/go/src/github.com/hyperledger/caliper/node_modules/fabric-client/lib/Peer.js:124:19)
at ontimeout (timers.js:498:11)
at tryOnTimeout (timers.js:323:5)
at Timer.listOnTimeout (timers.js:290:5)
error: [client-utils.js]: sendPeersProposal - Promise is rejected: Error: REQUEST_TIMEOUT
at Timeout._onTimeout (/Users/rjj/go/src/github.com/hyperledger/caliper/node_modules/fabric-client/lib/Peer.js:124:19)
at ontimeout (timers.js:498:11)
at tryOnTimeout (timers.js:323:5)
at Timer.listOnTimeout (timers.js:290:5)
error: [client-utils.js]: sendPeersProposal - Promise is rejected: Error: REQUEST_TIMEOUT
at Timeout._onTimeout (/Users/rjj/go/src/github.com/hyperledger/caliper/node_modules/fabric-client/lib/Peer.js:124:19)
at ontimeout (timers.js:498:11)
at tryOnTimeout (timers.js:323:5)
at Timer.listOnTimeout (timers.js:290:5)
error: [client-utils.js]: sendPeersProposal - Promise is rejected: Error: REQUEST_TIMEOUT
at Timeout._onTimeout (/Users/rjj/go/src/github.com/hyperledger/caliper/node_modules/fabric-client/lib/Peer.js:124:19)
at ontimeout (timers.js:498:11)
at tryOnTimeout (timers.js:323:5)
at Timer.listOnTimeout (timers.js:290:5)
not ok 4 Failed to instantiate chaincodes, Error: Failed to send instantiate due to error: Error: Failed to send instantiate Proposal or receive valid response. Response null or status is not 200. exiting... at Client.newDefaultKeyValueStore.then.then.then.then (/Users/rjj/go/src/github.com/hyperledger/caliper/src/fabric/e2eUtils.js:372:19) at <anonymous> at process._tickCallback (internal/process/next_tick.js:188:7) at Client.newDefaultKeyValueStore.then.then.then.then.then (/Users/rjj/go/src/github.com/hyperledger/caliper/src/fabric/e2eUtils.js:385:15) at <anonymous> at process._tickCallback (internal/process/next_tick.js:188:7)
---
operator: fail
at: chaincodes.reduce.then.catch (/Users/rjj/go/src/github.com/hyperledger/caliper/src/fabric/instantiate-chaincode.js:60:19)
stack: |-
Error: Failed to instantiate chaincodes, Error: Failed to send instantiate due to error: Error: Failed to send instantiate Proposal or receive valid response. Response null or status is not 200. exiting...
at Client.newDefaultKeyValueStore.then.then.then.then (/Users/rjj/go/src/github.com/hyperledger/caliper/src/fabric/e2eUtils.js:372:19)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
at Client.newDefaultKeyValueStore.then.then.then.then.then (/Users/rjj/go/src/github.com/hyperledger/caliper/src/fabric/e2eUtils.js:385:15)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
at Test.assert [as _assert] (/Users/rjj/go/src/github.com/hyperledger/caliper/node_modules/tape/lib/test.js:224:54)
at Test.bound [as _assert] (/Users/rjj/go/src/github.com/hyperledger/caliper/node_modules/tape/lib/test.js:76:32)
at Test.fail (/Users/rjj/go/src/github.com/hyperledger/caliper/node_modules/tape/lib/test.js:317:10)
at Test.bound [as fail] (/Users/rjj/go/src/github.com/hyperledger/caliper/node_modules/tape/lib/test.js:76:32)
at chaincodes.reduce.then.catch (/Users/rjj/go/src/github.com/hyperledger/caliper/src/fabric/instantiate-chaincode.js:60:19)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
...
fabric.installSmartContract() failed, Error: Fabric: instantiate chaincodes failed
at chaincodes.reduce.then.catch (/Users/rjj/go/src/github.com/hyperledger/caliper/src/fabric/instantiate-chaincode.js:61:31)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
[Transaction Info] - Submitted: 0 Succ: 0 Fail:0 Unfinished:0
unexpected error, Error: Fabric: instantiate chaincodes failed
at chaincodes.reduce.then.catch (/Users/rjj/go/src/github.com/hyperledger/caliper/src/fabric/instantiate-chaincode.js:61:31)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
docker-compose -f network/fabric/simplenetwork/docker-compose.yaml down;docker rm $(docker ps -aq);docker rmi $(docker images dev* -q)

解决办法:

这个问题算是比较坑的了,在网上找了很久,看到github 有一个一样的问题
https://github.com/hyperledger/caliper/issues/137
有一条评论提到,因为机器性能问题,开启的peer 较多,两分钟不足以在本机上实例化chaincode 但是照着上面的方式修改了
文件:github.com/hyperledger/caliper/src/fabric/e2eUtils.js#211中的request_time 时间
运行后还是没有解决这个问题,经过一天时间,巧合看到一篇文章提到修改文件:github.com/hyperledger/caliper/node_modules/fabric-client/config/default.json
配置文件中的request_time 运行成功
---------------------
作者:PoormaJin
来源:CSDN
原文:https://blog.csdn.net/raogeeg/article/details/82752613
版权声明:本文为博主原创文章,转载请附上博文链接!

【转载】【爬坑记录】hyperledger caliper 性能测试工具使用的一些问题记录的更多相关文章

  1. 【转载】8.2.1 CPU性能测试工具

    (KVM连载) 8.2.1 CPU性能测试工具 01/08/2013master 1 Comment 8.2.1 CPU性能测试工具 CPU是计算机系统中最核心的部件,CPU的性能直接决定了系统的计算 ...

  2. mybatis-generator 详细配置及使用,爬坑记录

    mybatis-generator 详细配置及使用,爬坑记录 提示:如果不成功一定是项目路径和 数据库配置出问题,本篇基于 MySQL 8.0.13,调试没有问题. 如果失败,建议使用相同的项目结构, ...

  3. 03、Swagger2和Springmvc整合详细记录(爬坑记录)

    时间 内容 备注 2018年6月18日 基本使用 spirngmvc整合swagger2 开始之前这个系列博文基本是,在项目的使用中一些模块的内容记录,但是后期逐渐优化,不单单是整合内容. swagg ...

  4. centos7安装Mysql爬坑记录

    centos7安装Mysql爬坑记录   查看是否已安装 使用下列命令查看是否已经安装过mysql/mariadb/PostgreSQL 如果未安装,不返回任何结果(ECS的centos镜像默认未安装 ...

  5. elasticsearch 单节点搭建与爬坑记录

    elasticsearch 单节点搭建与爬坑记录   prepare   虚拟机或者云服务器(这里用的是阿里云ECS) linux---centos7 安装完毕的jdk 相应的安装包(在https:/ ...

  6. [转载]性能测试工具 2 步解决 too many open files 的问题,让服务器支持更多连接数

    [转载]性能测试工具 2 步解决 too many open files 的问题,让服务器支持更多连接数 大话性能 · 2018年10月09日 · 最后由 大话性能 回复于 2018年10月09日 · ...

  7. 网络性能测试工具iperf详细使用图文教程【转载】

    原文:http://blog.163.com/hlz_2599/blog/static/142378474201341341339314/ 参考:http://man.linuxde.net/iper ...

  8. Apache性能测试工具ab使用详解~转载

    Apache自带性能测试工具ab使用详解 一. Apache的下载 1. http://www.apache.org/,进入Apache的官网 2. 将页面拖到最下方“Apache Project L ...

  9. 【转载】python3安装scrapy之windows32位爬坑

    python3安装scrapy之windows32位爬坑 原创 2016年11月06日 01:38:08 标签: scrapy / windows / python / 开源框架 / 网络爬虫   早 ...

随机推荐

  1. android之VideoView和视频播放View的扩展

    1.概念及扩展 VideoView 是android 系统提供的一个媒体播放显示和控制的控件.其结构层次如下: 原型:VideoView extends SurfaceView implements  ...

  2. ffmpeg编码h264只包含I帧P帧的方法

    ffmpeg使用avcodc_encode_video编码,默认产生的h264包含B帧,在安防行业很多地方是不需要用到B帧的. 1.基础知识充电 这就涉及到h264的各种profile格式了,参考 h ...

  3. java基础知识(4)---设计模式

    设计模式:解决问题最行之有效的思想.是一套被反复使用.多数人知晓的.经过分类编目的.代码设计经验的总结.使用设计模式是为了可重用代码.让代码更容易被他人理解.保证代码可靠性. java中有23种设计模 ...

  4. [FATAL_ERROR] Uncaught PDOException: There is already an active transaction

    [FATAL_ERROR] Uncaught PDOException: There is already an active transaction ... $mysql->beginTran ...

  5. k8s 基础(4) k8s安装

    转自 http://www.cnblogs.com/informatics/p/7389806.html 安装和配置 从github.com/kubernetes/kubernetes上下载1.6.8 ...

  6. linux日常管理-linux日志

    通过系统日志获得相关信息,出现错误,突发情况可以通过查看日志获得有用的信息.遇到故障,看日志是最常用的方法,在日常工作中一定要养成看日志的习惯. 最核心的日志在这个目录下 日志会无限生成,占用的内存会 ...

  7. 伪分布模式 hive查询

    [root@node1 ~]# lscpu Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian ...

  8. React中state与props介绍与比较

    一.state 1.state的作用 state是React中组件的一个对象.React把用户界面当做是状态机,想象它有不同的状态然后渲染这些状态,可以轻松让用户界面与数据保持一致. React中,更 ...

  9. structs2---OGNL表达式

    技术分析之OGNL表达式概述(了解) 1. OGNL是Object Graphic Navigation Language(对象图导航语言)的缩写 * 所谓对象图,即以任意一个对象为根,通过OGNL可 ...

  10. hadoop-2.3.0-cdh5.1.0完全分布式搭建(基于centos)

    先参考:<hadoop-2.3.0-cdh5.1.0伪分布安装(基于centos)> http://blog.csdn.net/jameshadoop/article/details/39 ...