问题1:阿里云服务器bug不兼容fabric
阿里云的服务器启动会报错如下:
Error: error getting endorser client for channel: endorser client failed to connect to peer0.org1.example.com:7051: failed to create new connection: connection error: desc = "transport: error while dialing: dial tcp: lookup peer0.org1.example.com: no such host"
peer0.org1 failed to join the channel, Retry after 3 seconds
解决如下:
vim /usr/local/go/src/github.com/hyperledger/fabric-samples/first-network/base/docker-compose-base.yaml
在每个environment下面都追加下面的参数,然后重新up就搞定。
- GODEBUG=netdns=go
问题2:peer节点启动报错
WARNING: The COMPOSE_PROJECT_NAME variable is not set. Defaulting to a blank string.
WARNING: The IMAGE_TAG variable is not set. Defaulting to a blank string.
ERROR: no such image: hyperledger/fabric-orderer:: invalid reference format
解决方法:把orderer生成证书目录重新全部拷贝到peer节点再启动成功。
问题3: 创建通道报错:
1、Error: got unexpected status: FORBIDDEN -- implicit policy evaluation failed - 0 sub-policies were satisfied, but this policy requires 1 of the 'Writers' sub-policies to be satisfied: permission denied
或者:
Error: got unexpected status: BAD_REQUEST -- error applying config update to existing channel 'mychannel': error authorizing update: error validating ReadSet: proposed update requires that key [Group] /Channel/Application be at version 0, but it is currently at version 1
解决办法:fabric版本和证书配置文件不一致
2、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
解决办法:这个问题是由于配置文件指定的角色和hosts下的IP对应有误
还有peer配置文件中services和cli下面的参数对应的组织要一致
- CORE_PEER_LOCALMSPID=Org2MSP
问题4 :orderer启动报错:
Failed validating bootstrap block: initializing channelconfig failed: could not create channel Orderer sub-group config: setting up the MSP manager failed: the supplied identity is not valid: x509: certificate signed by unknown authority
问题3和问题4的解决方法一致:
1、停止orderer程序
2、删除first下面的证书目录(crypto-config)
3、重新执行下面步骤:
./bin/cryptogen generate --config=./crypto-config.yaml
./bin/configtxgen -profile TwoOrgsOrdererGenesis -outputBlock ./channel-artifacts/genesis.block
./bin/configtxgen -profile TwoOrgsChannel -outputCreateChannelTx ./channel-artifacts/mychannel.tx -channelID mychannel
4、scp 到各peer节点
Error: failed to create deliver client: orderer client failed to connect to orderer.example.com:7050: failed to create new connection: context deadline exceeded
解决方法:重启orderer的docker不行的话就把orderer工作目录重新替换掉peer节点。
问题5:安装智能合约报错
Error: Bad response: 500 - error installing chaincode code mycc:1.0(chaincode /var/hyperledger/production/chaincodes/mycc.1.0 exists)
解决方法:拉取源码fabric链码go文件
问题6:orderer日志报错:
ERROR: Get https://registry-1.docker.io/v2/: dial tcp: lookup registry-1.docker.io on [::1]:53: read udp [::1]:54170->[::1]:53: read: connection refused
服务器没连上外网
问题7:
ServerHandshake -> ERRO 025 TLS handshake failed with error tls: oversized record received with length
解决方法:修改配置文件参数:
- ORDERER_GENERAL_TLS_ENABLED=true(orderer)