Fabric CLI容器启动的坑

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/zjw6463/article/details/84785226

这个坑是在使用链码的时候发现的,第一次成功了,等到下次再想使用的时候发现cli容器启动不了(启动后又马上关闭了)

下面是截的一段错误:

我是通过下面代码来启动整个开发者模式,其中包括cli容器启动

docker-compose -f docker-compose-simple.yaml up
orderer      | 2018-12-04 03:01:56.867 UTC [grpc] infof -> DEBU 153 transport: loopyWriter.run returning. connection error: desc = "transport is closing"
orderer      | 2018-12-04 03:01:56.868 UTC [common/deliver] Handle -> WARN 154 Error reading from 172.19.0.5:59222: rpc error: code = Canceled desc = context canceled
orderer      | 2018-12-04 03:01:56.868 UTC [orderer/common/server] func1 -> DEBU 155 Closing Deliver stream
orderer      | 2018-12-04 03:01:56.868 UTC [grpc] infof -> DEBU 156 transport: loopyWriter.run returning. connection error: desc = "transport is closing"
peer         | 2018-12-04 03:01:56.960 UTC [gossip/election] waitForMembershipStabilization -> DEBU 177 [243 207 228 28 171 240 246 50 47 126 76 107 39 195 188 89 124 172 71 55 154 250 154 119 204 184 74 34 122 52 159 71] : Exiting, peers found 0
peer         | 2018-12-04 03:01:56.961 UTC [gossip/election] leaderElection -> DEBU 178 [243 207 228 28 171 240 246 50 47 126 76 107 39 195 188 89 124 172 71 55 154 250 154 119 204 184 74 34 122 52 159 71] : Entering
peer         | 2018-12-04 03:01:56.961 UTC [gossip/election] propose -> DEBU 179 [243 207 228 28 171 240 246 50 47 126 76 107 39 195 188 89 124 172 71 55 154 250 154 119 204 184 74 34 122 52 159 71] : Entering
peer         | 2018-12-04 03:01:56.961 UTC [gossip/election] propose -> DEBU 17a [243 207 228 28 171 240 246 50 47 126 76 107 39 195 188 89 124 172 71 55 154 250 154 119 204 184 74 34 122 52 159 71] : Exiting
peer         | 2018-12-04 03:01:56.962 UTC [gossip/election] waitForInterrupt -> DEBU 17b [243 207 228 28 171 240 246 50 47 126 76 107 39 195 188 89 124 172 71 55 154 250 154 119 204 184 74 34 122 52 159 71] : Entering
cli exited with code 1

但没跑多久就出来了 cli exited with code 1,容器退出了

输入

docker logs 容器ID     //查看容器日志

容器ID可通过docker ps -a 查看name为cli的容器ID

在日志后面发现了错误

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

此问题是历史数据未清除干净,可能造成的原因:启动时未关闭之前的镜像,根源是由于有一个已经存在的channel,阻止进一步的执行而引起的。

所有简单粗暴的方法就是把删除所有容器

docker rm $(docker ps -aq)

然后问题解决了,cli容器不会自动退出了。

猜你喜欢

转载自blog.csdn.net/zjw6463/article/details/84785226