部署Hyperledger Fabric 1.0 出现 Attempting to Query PEER0 ...61 secs

这个错误,折磨了我久……
网上的方法都试过了,就是跑不通,宛如大便干燥……

结论先行

是由于Docker镜像的版本号不统一导致的,注意IMAGE ID

错误再现

在first-network目录下执行 byfn.sh -m up 命令

出现了 Query result on PEER0 is INVALID 这个错误,上网上查了一下,各种说法都有,什么二进制文件没安装、docker版本低、docker镜像版本的问题……

我执行docker images 查看镜像,发现版本号都是一样的,也按照网上其他也有说到“将版本号统一”

docker images

为什么还报错呢?一起看日志吧……

root@xxx:Go/src/github.com/hyperledger/fabric-samples/first-network$ byfn.sh -m up 
Starting with channel 'mychannel' and CLI timeout of '10'
Continue (y/n)? y
proceeding ...
/Go/bin/cryptogen

##########################################################
##### Generate certificates using cryptogen tool #########
##########################################################
org1.example.com
org2.example.com

/WorkSpace/Go/bin/configtxgen
##########################################################
#########  Generating Orderer Genesis block ##############
##########################################################
2019-12-02 17:52:43.427 CST [common/configtx/tool] main -> INFO 001 Loading configuration
2019-12-02 17:52:43.448 CST [common/configtx/tool] doOutputBlock -> INFO 002 Generating genesis block
2019-12-02 17:52:43.449 CST [common/configtx/tool] doOutputBlock -> INFO 003 Writing genesis block

#################################################################
### Generating channel configuration transaction 'channel.tx' ###
#################################################################
2019-12-02 17:52:43.485 CST [common/configtx/tool] main -> INFO 001 Loading configuration
2019-12-02 17:52:43.492 CST [common/configtx/tool] doOutputChannelCreateTx -> INFO 002 Generating new channel configtx
2019-12-02 17:52:43.493 CST [common/configtx/tool] doOutputChannelCreateTx -> INFO 003 Writing new channel tx

#################################################################
#######    Generating anchor peer update for Org1MSP   ##########
#################################################################
2019-12-02 17:52:43.531 CST [common/configtx/tool] main -> INFO 001 Loading configuration
2019-12-02 17:52:43.540 CST [common/configtx/tool] doOutputAnchorPeersUpdate -> INFO 002 Generating anchor peer update
2019-12-02 17:52:43.540 CST [common/configtx/tool] doOutputAnchorPeersUpdate -> INFO 003 Writing anchor peer update

#################################################################
#######    Generating anchor peer update for Org2MSP   ##########
#################################################################
2019-12-02 17:52:43.571 CST [common/configtx/tool] main -> INFO 001 Loading configuration
2019-12-02 17:52:43.575 CST [common/configtx/tool] doOutputAnchorPeersUpdate -> INFO 002 Generating anchor peer update
2019-12-02 17:52:43.575 CST [common/configtx/tool] doOutputAnchorPeersUpdate -> INFO 003 Writing anchor peer update

Creating network "net_byfn" with the default driver
Creating volume "net_orderer.example.com" with default driver
Creating volume "net_peer0.org1.example.com" with default driver
Creating volume "net_peer1.org1.example.com" with default driver
Creating volume "net_peer0.org2.example.com" with default driver
Creating volume "net_peer1.org2.example.com" with default driver
Pulling orderer.example.com (hyperledger/fabric-orderer:latest)...
latest: Pulling from hyperledger/fabric-orderer
b8f262c62ec6: Already exists
9c2dad781fe8: Already exists
7e48a048d895: Already exists
4b5f2a9ec0f7: Pull complete
a38d313ebb74: Pull complete
391a02b02202: Pull complete
Digest: sha256:f7715923e2ca67cee526c21638d86b21480e179419e9d6c20078caabb241b20e
Status: Downloaded newer image for hyperledger/fabric-orderer:latest
Pulling peer0.org1.example.com (hyperledger/fabric-peer:latest)...
latest: Pulling from hyperledger/fabric-peer
b8f262c62ec6: Already exists
9c2dad781fe8: Already exists
7e48a048d895: Already exists
4b5f2a9ec0f7: Already exists
9332c2443003: Pull complete
f8823b03421b: Pull complete
Digest: sha256:92c2bef91e80f54f6d73a89b796eab1b616f372e2258431f17d50dd0c2ce316b
Status: Downloaded newer image for hyperledger/fabric-peer:latest
Pulling cli (hyperledger/fabric-tools:latest)...
latest: Pulling from hyperledger/fabric-tools
7ddbc47eeb70: Pull complete
c1bbdc448b72: Pull complete
8c3b70e39044: Pull complete
45d437916d57: Pull complete
b5035666b1cd: Pull complete
94c898b5fdef: Pull complete
bee7bd3eb18f: Pull complete
9dc56c5637b5: Pull complete
31f2b9e8b256: Pull complete
89c4701a4f5f: Pull complete
18467825df3e: Pull complete
Digest: sha256:822418c5ad61473ecfa911dfe4b100264500c504c78def52730106a717be71cb
Status: Downloaded newer image for hyperledger/fabric-tools:latest
Creating peer1.org2.example.com ... done
Creating peer0.org1.example.com ... done
Creating peer0.org2.example.com ... done
Creating peer1.org1.example.com ... done
Creating orderer.example.com    ... done
Creating cli                    ... done

 ____    _____      _      ____    _____
/ ___|  |_   _|    / \    |  _ \  |_   _|
\___ \    | |     / _ \   | |_) |   | |
 ___) |   | |    / ___ \  |  _ <    | |
|____/    |_|   /_/   \_\ |_| \_\   |_|

Build your first network (BYFN) end-to-end test

Channel name : mychannel
Creating channel...
CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key
CORE_PEER_LOCALMSPID=Org1MSP
CORE_PEER_TLS_ENABLED=true
CORE_LOGGING_LEVEL=DEBUG
CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt
CORE_PEER_ID=cli
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp
CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
CORE_PEER_ADDRESS=peer0.org1.example.com:7051
CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
2019-12-02 09:56:43.622 UTC [main] InitCmd -> WARN 001 CORE_LOGGING_LEVEL is no longer supported, please use the FABRIC_LOGGING_SPEC environment variable
2019-12-02 09:56:43.673 UTC [main] SetOrdererEnv -> WARN 002 CORE_LOGGING_LEVEL is no longer supported, please use the FABRIC_LOGGING_SPEC environment variable
2019-12-02 09:56:43.687 UTC [channelCmd] InitCmdFactory -> INFO 003 Endorser and orderer connections initialized
2019-12-02 09:56:43.737 UTC [cli.common] readBlock -> INFO 004 Received block: 0
===================== Channel "mychannel" is created successfully =====================

Having all peers join the channel...
CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key
CORE_PEER_LOCALMSPID=Org1MSP
CORE_PEER_TLS_ENABLED=true
CORE_LOGGING_LEVEL=DEBUG
CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt
CORE_PEER_ID=cli
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp
CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
CORE_PEER_ADDRESS=peer0.org1.example.com:7051
CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
2019-12-02 09:56:44.085 UTC [main] InitCmd -> WARN 001 CORE_LOGGING_LEVEL is no longer supported, please use the FABRIC_LOGGING_SPEC environment variable
2019-12-02 09:56:44.236 UTC [main] SetOrdererEnv -> WARN 002 CORE_LOGGING_LEVEL is no longer supported, please use the FABRIC_LOGGING_SPEC environment variable
2019-12-02 09:56:44.257 UTC [channelCmd] InitCmdFactory -> INFO 003 Endorser and orderer connections initialized
2019-12-02 09:56:44.364 UTC [channelCmd] executeJoin -> INFO 004 Successfully submitted proposal to join channel
===================== PEER0 joined on the channel "mychannel" =====================

CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key
CORE_PEER_LOCALMSPID=Org1MSP
CORE_PEER_TLS_ENABLED=true
CORE_LOGGING_LEVEL=DEBUG
CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt
CORE_PEER_ID=cli
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp
CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
CORE_PEER_ADDRESS=peer1.org1.example.com:7051
CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
2019-12-02 09:56:47.466 UTC [main] InitCmd -> WARN 001 CORE_LOGGING_LEVEL is no longer supported, please use the FABRIC_LOGGING_SPEC environment variable
2019-12-02 09:56:47.506 UTC [main] SetOrdererEnv -> WARN 002 CORE_LOGGING_LEVEL is no longer supported, please use the FABRIC_LOGGING_SPEC environment variable
2019-12-02 09:56:47.518 UTC [channelCmd] InitCmdFactory -> INFO 003 Endorser and orderer connections initialized
2019-12-02 09:56:47.584 UTC [channelCmd] executeJoin -> INFO 004 Successfully submitted proposal to join channel
===================== PEER1 joined on the channel "mychannel" =====================

CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key
CORE_PEER_LOCALMSPID=Org2MSP
CORE_PEER_TLS_ENABLED=true
CORE_LOGGING_LEVEL=DEBUG
CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt
CORE_PEER_ID=cli
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp
CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt
CORE_PEER_ADDRESS=peer0.org2.example.com:7051
CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
2019-12-02 09:56:50.657 UTC [main] InitCmd -> WARN 001 CORE_LOGGING_LEVEL is no longer supported, please use the FABRIC_LOGGING_SPEC environment variable
2019-12-02 09:56:50.706 UTC [main] SetOrdererEnv -> WARN 002 CORE_LOGGING_LEVEL is no longer supported, please use the FABRIC_LOGGING_SPEC environment variable
2019-12-02 09:56:50.716 UTC [channelCmd] InitCmdFactory -> INFO 003 Endorser and orderer connections initialized
2019-12-02 09:56:50.759 UTC [channelCmd] executeJoin -> INFO 004 Successfully submitted proposal to join channel
===================== PEER2 joined on the channel "mychannel" =====================

CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key
CORE_PEER_LOCALMSPID=Org2MSP
CORE_PEER_TLS_ENABLED=true
CORE_LOGGING_LEVEL=DEBUG
CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt
CORE_PEER_ID=cli
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp
CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt
CORE_PEER_ADDRESS=peer1.org2.example.com:7051
CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
2019-12-02 09:56:53.849 UTC [main] InitCmd -> WARN 001 CORE_LOGGING_LEVEL is no longer supported, please use the FABRIC_LOGGING_SPEC environment variable
2019-12-02 09:56:53.906 UTC [main] SetOrdererEnv -> WARN 002 CORE_LOGGING_LEVEL is no longer supported, please use the FABRIC_LOGGING_SPEC environment variable
2019-12-02 09:56:53.934 UTC [channelCmd] InitCmdFactory -> INFO 003 Endorser and orderer connections initialized
2019-12-02 09:56:53.993 UTC [channelCmd] executeJoin -> INFO 004 Successfully submitted proposal to join channel
===================== PEER3 joined on the channel "mychannel" =====================

Updating anchor peers for org1...
CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key
CORE_PEER_LOCALMSPID=Org1MSP
CORE_PEER_TLS_ENABLED=true
CORE_LOGGING_LEVEL=DEBUG
CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt
CORE_PEER_ID=cli
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp
CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
CORE_PEER_ADDRESS=peer0.org1.example.com:7051
CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
2019-12-02 09:56:57.097 UTC [main] InitCmd -> WARN 001 CORE_LOGGING_LEVEL is no longer supported, please use the FABRIC_LOGGING_SPEC environment variable
2019-12-02 09:56:57.140 UTC [main] SetOrdererEnv -> WARN 002 CORE_LOGGING_LEVEL is no longer supported, please use the FABRIC_LOGGING_SPEC environment variable
2019-12-02 09:56:57.148 UTC [channelCmd] InitCmdFactory -> INFO 003 Endorser and orderer connections initialized
2019-12-02 09:56:57.175 UTC [channelCmd] update -> INFO 004 Successfully submitted channel update
===================== Anchor peers for org "Org1MSP" on "mychannel" is updated successfully =====================

Updating anchor peers for org2...
CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key
CORE_PEER_LOCALMSPID=Org2MSP
CORE_PEER_TLS_ENABLED=true
CORE_LOGGING_LEVEL=DEBUG
CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt
CORE_PEER_ID=cli
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp
CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt
CORE_PEER_ADDRESS=peer0.org2.example.com:7051
CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
2019-12-02 09:57:00.250 UTC [main] InitCmd -> WARN 001 CORE_LOGGING_LEVEL is no longer supported, please use the FABRIC_LOGGING_SPEC environment variable
2019-12-02 09:57:00.322 UTC [main] SetOrdererEnv -> WARN 002 CORE_LOGGING_LEVEL is no longer supported, please use the FABRIC_LOGGING_SPEC environment variable
2019-12-02 09:57:00.335 UTC [channelCmd] InitCmdFactory -> INFO 003 Endorser and orderer connections initialized
2019-12-02 09:57:00.360 UTC [channelCmd] update -> INFO 004 Successfully submitted channel update
===================== Anchor peers for org "Org2MSP" on "mychannel" is updated successfully =====================

Installing chaincode on org1/peer0...
CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key
CORE_PEER_LOCALMSPID=Org1MSP
CORE_PEER_TLS_ENABLED=true
CORE_LOGGING_LEVEL=DEBUG
CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt
CORE_PEER_ID=cli
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp
CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
CORE_PEER_ADDRESS=peer0.org1.example.com:7051
CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
2019-12-02 09:57:03.509 UTC [main] InitCmd -> WARN 001 CORE_LOGGING_LEVEL is no longer supported, please use the FABRIC_LOGGING_SPEC environment variable
2019-12-02 09:57:03.559 UTC [main] SetOrdererEnv -> WARN 002 CORE_LOGGING_LEVEL is no longer supported, please use the FABRIC_LOGGING_SPEC environment variable
2019-12-02 09:57:03.580 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 003 Using default escc
2019-12-02 09:57:03.580 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 004 Using default vscc
2019-12-02 09:57:04.069 UTC [chaincodeCmd] install -> INFO 005 Installed remotely response:<status:200 payload:"OK" >
===================== Chaincode is installed on remote peer PEER0 =====================

Install chaincode on org2/peer2...
CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key
CORE_PEER_LOCALMSPID=Org2MSP
CORE_PEER_TLS_ENABLED=true
CORE_LOGGING_LEVEL=DEBUG
CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt
CORE_PEER_ID=cli
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp
CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt
CORE_PEER_ADDRESS=peer0.org2.example.com:7051
CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
2019-12-02 09:57:04.152 UTC [main] InitCmd -> WARN 001 CORE_LOGGING_LEVEL is no longer supported, please use the FABRIC_LOGGING_SPEC environment variable
2019-12-02 09:57:04.197 UTC [main] SetOrdererEnv -> WARN 002 CORE_LOGGING_LEVEL is no longer supported, please use the FABRIC_LOGGING_SPEC environment variable
2019-12-02 09:57:04.221 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 003 Using default escc
2019-12-02 09:57:04.221 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 004 Using default vscc
2019-12-02 09:57:04.588 UTC [chaincodeCmd] install -> INFO 005 Installed remotely response:<status:200 payload:"OK" >
===================== Chaincode is installed on remote peer PEER2 =====================

Instantiating chaincode on org2/peer2...
CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key
CORE_PEER_LOCALMSPID=Org2MSP
CORE_PEER_TLS_ENABLED=true
CORE_LOGGING_LEVEL=DEBUG
CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt
CORE_PEER_ID=cli
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp
CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt
CORE_PEER_ADDRESS=peer0.org2.example.com:7051
CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
2019-12-02 09:57:04.678 UTC [main] InitCmd -> WARN 001 CORE_LOGGING_LEVEL is no longer supported, please use the FABRIC_LOGGING_SPEC environment variable
2019-12-02 09:57:04.717 UTC [main] SetOrdererEnv -> WARN 002 CORE_LOGGING_LEVEL is no longer supported, please use the FABRIC_LOGGING_SPEC environment variable
2019-12-02 09:57:04.750 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 003 Using default escc
2019-12-02 09:57:04.750 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 004 Using default vscc
===================== Chaincode Instantiation on PEER2 on channel 'mychannel' is successful =====================

Querying chaincode on org1/peer0...
===================== Querying on PEER0 on channel 'mychannel'... =====================
CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key
CORE_PEER_LOCALMSPID=Org1MSP
CORE_PEER_TLS_ENABLED=true
CORE_LOGGING_LEVEL=DEBUG
CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt
CORE_PEER_ID=cli
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp
CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
CORE_PEER_ADDRESS=peer0.org1.example.com:7051
CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
Attempting to Query PEER0 ...3 secs
Attempting to Query PEER0 ...37 secs
Attempting to Query PEER0 ...40 secs
Attempting to Query PEER0 ...43 secs
Attempting to Query PEER0 ...46 secs
Attempting to Query PEER0 ...49 secs
Attempting to Query PEER0 ...52 secs
Attempting to Query PEER0 ...56 secs
Attempting to Query PEER0 ...59 secs
Attempting to Query PEER0 ...62 secs

2019-12-02 09:59:01.545 UTC [main] InitCmd -> WARN 001 CORE_LOGGING_LEVEL is no longer supported, please use the FABRIC_LOGGING_SPEC environment variable
2019-12-02 09:59:01.615 UTC [main] SetOrdererEnv -> WARN 002 CORE_LOGGING_LEVEL is no longer supported, please use the FABRIC_LOGGING_SPEC environment variable
100
!!!!!!!!!!!!!!! Query result on PEER0 is INVALID !!!!!!!!!!!!!!!!
================== ERROR !!! FAILED to execute End-2-End Scenario ==================

其实,仔细查看上面的日志会发现:

...
Pulling orderer.example.com (hyperledger/fabric-orderer:latest)...
...
Pulling peer0.org1.example.com (hyperledger/fabric-peer:latest)...
...
Pulling cli (hyperledger/fabric-tools:latest)...
...

我们在看看docker镜像,会发现……

$   docker images
REPOSITORY                     TAG                 IMAGE ID            CREATED             SIZE
hyperledger/fabric-tools       latest              7552e1968c0b        2 weeks ago         1.49GB
hyperledger/fabric-ccenv       latest              ca4780293e4c        2 weeks ago         1.37GB
hyperledger/fabric-orderer     latest              dbc9f65443aa        2 weeks ago         120MB
hyperledger/fabric-peer        latest              9756aed98c6b        2 weeks ago         128MB
hyperledger/fabric-baseos      amd64-0.4.18        c256a6aad46f        3 weeks ago         80.8MB
hyperledger/fabric-tools       x86_64-1.0.0        0403fd1c72c7        2 years ago         1.32GB
hyperledger/fabric-couchdb     x86_64-1.0.0        2fbdbf3ab945        2 years ago         1.48GB
hyperledger/fabric-kafka       x86_64-1.0.0        dbd3f94de4b5        2 years ago         1.3GB
hyperledger/fabric-zookeeper   x86_64-1.0.0        e545dbf1c6af        2 years ago         1.31GB
hyperledger/fabric-orderer     x86_64-1.0.0        e317ca5638ba        2 years ago         179MB
hyperledger/fabric-peer        x86_64-1.0.0        6830dcd7b9b5        2 years ago         182MB
hyperledger/fabric-javaenv     x86_64-1.0.0        8948126f0935        2 years ago         1.42GB
hyperledger/fabric-ccenv       x86_64-1.0.0        7182c260a5ca        2 years ago         1.29GB
hyperledger/fabric-ca          x86_64-1.0.0        a15c59ecda5b        2 years ago         238MB

注意imageID! 注意imageID! 注意imageID!

是的,的确和猜想一样,下载了标签为latest的镜像,这有的是用x86_64-1.0.0,有的用的是latest,怎么可能统一嘛

解决方案

下面操作会用到 docker tag命令,不会的看这里

  1. 先记录都有那个镜像是latest的
  2. 然后删除latest镜像docker rmi 7552e1968c0b ca4780293e4c dbc9f65443aa 9756aed98c6b(注意要填写你自己的image id)
  3. 将现有的x86_64-1.0.0的镜像,改tag为latest。比如我的需要改fabric-tools、fabric-ccenv、fabric-peer、fabric-orderer
docker tag  hyperledger/fabric-tools:x86_64-1.0.0 hyperledger/fabric-tools:latest
docker tag  hyperledger/fabric-ccenv:x86_64-1.0.0 hyperledger/fabric-ccenv:latest
docker tag  hyperledger/fabric-peer:x86_64-1.0.0 hyperledger/fabric-peer:latest
docker tag  hyperledger/fabric-orderer:x86_64-1.0.0 hyperledger/fabric-orderer:latest

改过之后,查看一下镜像docker images

REPOSITORY                            TAG                 IMAGE ID            CREATED             SIZE
hyperledger/fabric-baseos             amd64-0.4.18        c256a6aad46f        3 weeks ago         80.8MB
hyperledger/fabric-tools              latest              0403fd1c72c7        2 years ago         1.32GB
hyperledger/fabric-tools              x86_64-1.0.0        0403fd1c72c7        2 years ago         1.32GB
hyperledger/fabric-couchdb            x86_64-1.0.0        2fbdbf3ab945        2 years ago         1.48GB
hyperledger/fabric-kafka              x86_64-1.0.0        dbd3f94de4b5        2 years ago         1.3GB
hyperledger/fabric-zookeeper          x86_64-1.0.0        e545dbf1c6af        2 years ago         1.31GB
hyperledger/fabric-orderer            latest              e317ca5638ba        2 years ago         179MB
hyperledger/fabric-orderer            x86_64-1.0.0        e317ca5638ba        2 years ago         179MB
hyperledger/fabric-peer               latest              6830dcd7b9b5        2 years ago         182MB
hyperledger/fabric-peer               x86_64-1.0.0        6830dcd7b9b5        2 years ago         182MB
hyperledger/fabric-javaenv            x86_64-1.0.0        8948126f0935        2 years ago         1.42GB
hyperledger/fabric-ccenv              latest              7182c260a5ca        2 years ago         1.29GB
hyperledger/fabric-ccenv              x86_64-1.0.0        7182c260a5ca        2 years ago         1.29GB
hyperledger/fabric-ca                 x86_64-1.0.0        a15c59ecda5b        2 years ago         238MB
hyperledger/fabric-baseos             x86_64-0.3.1        4b0cab202084        2 years ago         157MB

注意imageID! 注意imageID! 注意imageID!

现在再执行一下byfn.sh -m up

...
...
...
===================== Chaincode is installed on remote peer PEER3 =====================

Querying chaincode on org2/peer3...
===================== Querying on PEER3 on channel 'mychannel'... =====================
CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt
CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key
CORE_PEER_LOCALMSPID=Org2MSP
CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt
CORE_PEER_TLS_ENABLED=true
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp
CORE_PEER_ID=cli
CORE_LOGGING_LEVEL=DEBUG
CORE_PEER_ADDRESS=peer1.org2.example.com:7051
Attempting to Query PEER3 ...3 secs

2019-12-02 10:23:37.604 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP
2019-12-02 10:23:37.605 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity
2019-12-02 10:23:37.605 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 003 Using default escc
2019-12-02 10:23:37.605 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 004 Using default vscc
2019-12-02 10:23:37.605 UTC [msp/identity] Sign -> DEBU 005 Sign: plaintext: 0A91070A6708031A0C08A9CC93EF0510...6D7963631A0A0A0571756572790A0161
2019-12-02 10:23:37.605 UTC [msp/identity] Sign -> DEBU 006 Sign: digest: E132D9A02A23EAC394FA7048DBA18E34CAACE178C9683614447AAE95F489A291
Query Result: 90
2019-12-02 10:24:01.358 UTC [main] main -> INFO 007 Exiting.....
===================== Query on PEER3 on channel 'mychannel' is successful =====================

========= All GOOD, BYFN execution completed ===========


 _____   _   _   ____
| ____| | \ | | |  _ \
|  _|   |  \| | | | | |
| |___  | |\  | | |_| |
|_____| |_| \_| |____/

有木有上完厕所,浑身轻松的感觉?

总结

由于粗心,没有仔细查看日志。找到网上说的解决方案后,没有仔细对比IMAGE ID

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 206,378评论 6 481
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 88,356评论 2 382
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 152,702评论 0 342
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 55,259评论 1 279
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 64,263评论 5 371
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 49,036评论 1 285
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 38,349评论 3 400
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 36,979评论 0 259
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 43,469评论 1 300
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 35,938评论 2 323
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 38,059评论 1 333
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 33,703评论 4 323
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 39,257评论 3 307
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 30,262评论 0 19
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 31,485评论 1 262
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 45,501评论 2 354
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 42,792评论 2 345

推荐阅读更多精彩内容