fabirc1.2 e2e_cli遇到的问题
昨天遇到了一个很奇怪的问题,新拉下来的Fabric代码,指定1.2版本后,启动e2e_cli demo,突然orderer不可用了!
并且在本机mac上做了测试,可用;最近的两台云主机都尚未运行过fabric,应该不是什么文件残留的问题;并且重装云服务器系统后,也还是改问题。
- 具体报错如下,单独运行orderer容器,得到输出日志,看到是证书验证失败
Attempting to fetch system channel 'e2e-orderer-syschan' ...58 secs
Attempting to fetch system channel 'e2e-orderer-syschan' ...61 secs
2019-02-25 03:07:41.702 UTC [main] InitCmd -> WARN 001 CORE_LOGGING_LEVEL is no longer supported, please use the FABRIC_LOGGING_SPEC environment variable
2019-02-25 03:07:41.705 UTC [main] InitCmd -> ERRO 002 Cannot run peer because error when setting up MSP of type bccsp from directory /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp: could not load a valid signer certificate from directory /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/signcerts: stat /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/signcerts: no such file or directory
!!!!!!!!!!!!!!! Ordering Service is not available, Please try again ... !!!!!!!!!!!!!!!!
================== ERROR !!! FAILED to execute End-2-End Scenario ==================
查找资料,发现有人遇到过是版本的问题;突然想到,我的mac之前是有残留镜像的,并且fabric使用的都是latest标签的镜像,这就把镜像版本问题掩藏了,好像看起来都没问题,尝试更换镜像,结果ok!
- 更换fabric docker镜像
如下命令会下载fabric-example,并拉取1.2.0的相关镜像;
如果因为墙的问题,curl获取不到该脚本,可通过配置代理,或者复制文末脚本(chmod +x test.sh && ./test.sh 1.2.0
)
curl -sSL http://bit.ly/2ysbOFE | bash -s 1.2.0
- 再次启动e2e_cli
root@node2:~/go/src/github.com/hyperledger/fabric/examples/e2e_cli# ./network_setup.sh up
setting to default channel 'mychannel'
mychannel
Using cryptogen -> /root/go/src/github.com/hyperledger/fabric/examples/e2e_cli/../../release/linux-amd64/bin/cryptogen
##########################################################
##### Generate certificates using cryptogen tool #########
##########################################################
org1.example.com
org2.example.com
...
Creating network "e2e_default" with the default driver
Creating peer1.org1.example.com ... done
Creating peer0.org2.example.com ... done
Creating peer0.org1.example.com ... done
Creating zookeeper1 ... done
Creating zookeeper0 ... done
Creating peer1.org2.example.com ... done
Creating zookeeper2 ... done
Creating kafka2 ... done
Creating kafka1 ... done
Creating kafka0 ... done
Creating kafka3 ... done
Creating orderer.example.com ... done
Creating cli ... done
____ _____ _ ____ _____ _____ ____ _____
/ ___| |_ _| / \ | _ \ |_ _| | ____| |___ \ | ____|
\___ \ | | / _ \ | |_) | | | _____ | _| __) | | _|
___) | | | / ___ \ | _ < | | |_____| | |___ / __/ | |___
|____/ |_| /_/ \_\ |_| \_\ |_| |_____| |_____| |_____|
Channel name : mychannel
Check orderering service availability...
Attempting to fetch system channel 'e2e-orderer-syschan' ...3