当前位置:   article > 正文

fabric 启动过程常见问题_container exited with status 1

container exited with status 1
错误信息

Error response from daemon: Cannot start container web: iptables failed: iptables -t nat -A DOCKER -p tcp -d 0/0 –dport 32797 -j DNAT –to-destination 172.17.0.30:5000 ! -i docker0: iptables: No chain/target/match by that name.

解决办法:重建docker0网络恢复

依次执行下面的命令:

pkill docker 
iptables -t nat -F 
ifconfig docker0 down 
brctl delbr docker0 
docker -d 
service docker restart
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6

执行
./peer.sh chaincode package demo-pack.out -n demo -v 0.0.1 -s -S -p github.com/introclass/hyperledger-fabric-chaincodes/demo
  • 1
错误信息
Error: error getting chaincode code demo: error getting chaincode package bytes: Error obtaining dependencies for github.com/hyperledger/fabric/core/chaincode/lib/cid: command <go list -f {{ join .Deps "\n"}} github.com/hyperledger/fabric/core/chaincode/lib/cid>: failed with error: "exit status 1"
can't load package: package github.com/hyperledger/fabric/core/chaincode/lib/cid: cannot find package "github.com/hyperledger/fabric/core/chaincode/lib/cid" in any of:
	/opt/go/src/github.com/hyperledger/fabric/core/chaincode/lib/cid (from $GOROOT)
	/opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/lib/cid (from $GOPATH)


docker cp /Users/qifei/syswin/fabric-deploy/fabric1.4.0/fabric-samples/chaincode/abac/go/vendor/github.com/hyperledger/fabric/core/chaincode/shim/ext/cid  cli:/opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/lib
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7

解决npm ERR! 过程出现 Unexpected end of JSON input while parsing near
  1. 删掉package.lock.json
  2. 清除cache
npm cache clean --force
  • 1
  1. 还原官方镜像
npm set registry https://registry.npmjs.org/
  • 1

Handshake failed with fatal error SSL_ERROR_SSL

ssl证书错误,找到对应证书或不适用加密连接


服务启动时好时坏,环境清理之后解决

docker rm -f $(docker ps -aq)
docker rmi -f $(docker images | grep fabcar | awk ‘{print $3}’)
rm -rf channel-artifacts crypto-config
mkdir channel-artifacts crypto-config
docker volume prune
docker network rm net_byfn
./byfn.sh generate

./byfn.sh restart


错误信息

2019-10-12 08:04:58.663 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
Error: got unexpected status: BAD_REQUEST – error validating channel creation transaction for new channel ‘mychannel’, could not succesfully apply update to template configuration: error authorizing update: error validating DeltaSet: policy for [Group] /Channel/Application not satisfied: implicit policy evaluation failed - 0 sub-policies were satisfied, but this policy requires 1 of the ‘Admins’ sub-policies to be satisfied

CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE 需要配置


端口bind失败

lsof -i:7050
然后kill

初始化合约失败

调用 peer chaincode instantiate响应错误:

Error: could not assemble transaction, err proposal response was not successful, error code 500, msg chaincode registration failed: container exited with 1

原因是使用java编写的链码,不能出现中文字符。
在初始化合约时,fabric会启动一个hyperledger/fabric-javaenv 的容器对合约进行下载依赖包及编译。编译过程可以查看日志,而编译结束,无论成功失败,容器都会被删掉。

Gradle build
Starting a Gradle Daemon, 1 incompatible and 1 stopped Daemons could not be reused, use --status for details
:compileJava
Download https://repo.maven.apache.org/maven2/org/hyperledger/fabric-chaincode-java/fabric-chaincode-shim/maven-metadata.xml
Download https://repo.maven.apache.org/maven2/org/hyperledger/fabric-chaincode-java/fabric-chaincode-shim/1.4.3/fabric-chaincode-shim-1.4.3.pom
Download https://repo.maven.apache.org/maven2/com/alibaba/fastjson/maven-metadata.xml
Download https://repo.maven.apache.org/maven2/com/alibaba/fastjson/1.2.62/fastjson-1.2.62.pom
Download https://repo.maven.apache.org/maven2/io/grpc/grpc-core/maven-metadata.xml
Download https://repo.maven.apache.org/maven2/io/netty/netty-codec-http2/maven-metadata.xml
Download https://repo.maven.apache.org/maven2/com/alibaba/fastjson/1.2.62/fastjson-1.2.62.jar
/chaincode/input/src/src/main/java/com/zhengtoon/chaincode/fuzhou/IntegralChaincode.java:42: error: unmappable character for encoding ASCII
            _logger.info("time???" + stub.getTxTimestamp().getNano());
                              ^
/chaincode/input/src/src/main/java/com/zhengtoon/chaincode/fuzhou/IntegralChaincode.java:42: error: unmappable character for encoding ASCII
            _logger.info("time???" + stub.getTxTimestamp().getNano());
                               ^
/chaincode/input/src/src/main/java/com/zhengtoon/chaincode/fuzhou/IntegralChaincode.java:42: error: unmappable character for encoding ASCII
            _logger.info("time???" + stub.getTxTimestamp().getNano());
                                ^
/chaincode/input/src/src/main/java/com/zhengtoon/chaincode/fuzhou/IntegralChaincode.java:44: error: unmappable character for encoding ASCII
            _logger.info(new String("operater???" + creator));
                                             ^
/chaincode/input/src/src/main/java/com/zhengtoon/chaincode/fuzhou/IntegralChaincode.java:44: error: unmappable character for encoding ASCII
            _logger.info(new String("operater???" + creator));
                                              ^
/chaincode/input/src/src/main/java/com/zhengtoon/chaincode/fuzhou/IntegralChaincode.java:44: error: unmappable character for encoding ASCII
            _logger.info(new String("operater???" + creator));
                                               ^
Note: /chaincode/input/src/src/main/java/com/zhengtoon/chaincode/fuzhou/IntegralChaincode.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /chaincode/input/src/src/main/java/com/zhengtoon/chaincode/fuzhou/IntegralChaincode.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/繁依Fanyi0/article/detail/511565
推荐阅读
相关标签
  

闽ICP备14008679号