admin管理员组

文章数量:1642153

HyperLedger Fabric 实践错误收集

 

在ubuntu中通过docker-compose启动容器的时候报错

ERROR: for cli  Cannot create container for service cli: Conflict. The container name "/cli" is already in use by container 
"50c55d747c3c5a8563219d0404bcd49945fc45ebc69d6cd432d7570512d0ed4a".
 You have to remove (or rename) that container to be able to reuse that name.
ERROR: Encountered errors while bringing up the project.

原因: cli的名字冲突了,
解决办法: 删掉cli容器或者在docker-compose-cli.yaml文件中对命名进行修改,但是我并没有发现有cli容器,所以就进行了命名的修改.

修改cli的名称.png


启动容器:

$ docker-compose -f docker-compose-cli.yaml up -d

 

启动成功.png

创建channel的时候报错

Endorser and orderer connections initialized
Error: got unexpected status: BAD_REQUEST -- error authorizing update: error validating DeltaSet: policy for [Group]  /Channel/Application not satisfied: Failed to reach implicit threshold of 1 sub-policies, required 1 remaining

查找错误的原因思路: 创建通道肯定是客户端要做的事情,所以就在客户端的环境变量设置这块去入手, 发现了问题所在:

 

img.png

 

cli要连接的节点所属的组织ID写错了, 在configtx.yaml中是这样写的

 

img.png

创建channel文件或者创世区块文件报错

Error reading configuration:  While parsing config: yaml: line 117: did not find expected key
panic: Error reading configuration:  While parsing config: yaml: line 117: did not find expected key [recovered]
    panic: Error reading configuration:  While parsing config: yaml: line 117: did not find expected key

错误原因:高度怀疑是使用Xcode来打开了configtx.yaml文件, 造成了格式上的错乱 (虽然看起来一点变化都没有,使用二分大法确实能验证出来是有错误,但就是找不到错误在哪),要知道, yaml文件的缩进只支持空格缩进,并不支持tab缩进.

解决办法:
先将configtx.yaml文件的内容剪切出来,放在象印笔记上粘贴,再关闭configtx.yaml文件
打开configtx.yaml文件, 从象印笔记上把内容再粘贴回到configtx.yaml文件.
如果上面方法不行的话,重新创建一个configtx.yaml文件,重新写部署代码.


创建channel文件时报错

Error: failed to create deliver client: orderer client failed to connect to orderer.test:7050: failed to create new connection: context deadline exceeded

出现这个错误时,首先看一看orderer服务有没有开启,如果是开启的状态,那就是docker-compose.yaml文件的问题了, 检查一下环境变量有没有写对, 如果都没问题的话,那就是yaml文件格式的问题了.


创建channel文件时报错

Endorser and orderer connections initialized
Error: got unexpected status: BAD_REQUEST -- error authorizing update: error validating ReadSet: readset expected key [Group]  /Channel/Application at version 0, but got version 1

创建通道的时候,报这个错!! 已经存在通道了,就不要再添加了,可以通过 peer channel list来查看通道.


将节点加入到通道中报错

Error: error getting endorser client for channel: endorser client failed to connect to peer0go.test:7051: failed to create new connection: context deadline exceeded

Mac和ubuntu之间会发生这个问题,暂时不知道解决方案.
Mac和centos之间也会发生这个问题,但是关闭centos的防火墙就可以解决问题.

$ firewall-cmd --state #查看默认防火墙状态(关闭后显示notrunning,开启后显示running)
$ systemctl stop firewalld.service #停止firewall
$ firewall-cmd --state #查看默认防火墙状态(关闭后显示notrunning,开启后显示running)

启动容器的时候

ERROR: Failed to Setup IP tables: Unable to enable SKIP DNAT rule:  (iptables failed: iptables --wait -t nat -I DOCKER -i br-70aea9556247 -j RETURN: iptables: No chain/target/match by that name.

执行docker-compose up -d 启动容器的时候, 报这个错,解决办法: 重启docker

service docker restart

本文标签: 错误HyperledgerFabric