Skip to content

Instantly share code, notes, and snippets.

@hvram1
Last active May 15, 2017 13:35
Show Gist options
  • Save hvram1/aff4891f5fda9c11032dc855b2cc33f0 to your computer and use it in GitHub Desktop.
Save hvram1/aff4891f5fda9c11032dc855b2cc33f0 to your computer and use it in GitHub Desktop.
Hyperledger chaincode instantiation error
===================== Chaincode is installed on remote peer PEER0 =====================
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=peer0.org2.example.com:7051
2017-05-15 10:07:54.093 UTC [msp] getMspConfig -> INFO 001 intermidiate certs folder not found at [/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp/intermediatecerts]. Skipping.: [stat /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp/intermediatecerts: no such file or directory]
2017-05-15 10:07:54.094 UTC [msp] getMspConfig -> INFO 002 crls folder not found at [/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp/intermediatecerts]. Skipping.: [stat /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp/crls: no such file or directory]
2017-05-15 10:07:54.094 UTC [msp] getMspConfig -> INFO 003 MSP configuration file not found at [/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp/config.yaml]: [stat /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp/config.yaml: no such file or directory]
2017-05-15 10:07:54.135 UTC [msp] GetLocalMSP -> DEBU 004 Returning existing local MSP
2017-05-15 10:07:54.135 UTC [msp] GetDefaultSigningIdentity -> DEBU 005 Obtaining default signing identity
2017-05-15 10:07:54.135 UTC [golang-platform] collectChaincodeFiles -> DEBU 006 not using input for hash computation for path:"github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02" name:"mycc" version:"1.0"
2017-05-15 10:07:54.135 UTC [golang-platform] getCodeFromFS -> DEBU 007 getCodeFromFS github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02
2017-05-15 10:07:54.135 UTC [util] HashFilesInDir -> DEBU 008 hashFiles /opt/gopath/src/github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02
2017-05-15 10:07:54.139 UTC [golang-platform] writeGopathSrc -> INFO 009 rootDirectory = /opt/gopath/src
2017-05-15 10:07:54.139 UTC [container] WriteFolderToTarPackage -> INFO 00a rootDirectory = /opt/gopath/src
2017-05-15 10:07:54.277 UTC [msp] Sign -> DEBU 00b Sign: plaintext: 0AA2070A5C08031A0C08FAFBE5C80510...CBF867000000FFFFF0824D67001C0000
2017-05-15 10:07:54.277 UTC [msp] Sign -> DEBU 00c Sign: digest: F29D2F6A6E9C675517075370387168384D7C03937737B173038D123780723BE6
2017-05-15 10:07:54.281 UTC [chaincodeCmd] install -> DEBU 00d Installed remotely response:<status:200 payload:"OK" >
2017-05-15 10:07:54.282 UTC [main] main -> INFO 00e Exiting.....
===================== Chaincode is installed on remote peer PEER2 =====================
Instantiating chaincode on Peer2/Org2 ...
+ PEER=2
+ setGlobals 2
+ '[' 2 -eq 0 -o 2 -eq 1 ']'
+ CORE_PEER_LOCALMSPID=Org2MSP
+ 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_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp
+ '[' 2 -eq 2 ']'
+ CORE_PEER_ADDRESS=peer0.org2.example.com:7051
+ env
+ grep CORE
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=peer0.org2.example.com:7051
+ '[' -z true -o true = false ']'
+ peer chaincode instantiate -o orderer.example.com:7050 --tls true --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/cacerts/ca.example.com-cert.pem -C harichan -n mycc -v 1.0 -c '{"Args":["init","a","100","b","200"]}' -P 'OR ('\''Org1MSP.member'\'','\''Org2MSP.member'\'')'
+ res=1
+ cat log.txt
2017-05-15 10:07:54.377 UTC [msp] getMspConfig -> INFO 001 intermidiate certs folder not found at [/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp/intermediatecerts]. Skipping.: [stat /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp/intermediatecerts: no such file or directory]
2017-05-15 10:07:54.377 UTC [msp] getMspConfig -> INFO 002 crls folder not found at [/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp/intermediatecerts]. Skipping.: [stat /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp/crls: no such file or directory]
2017-05-15 10:07:54.377 UTC [msp] getMspConfig -> INFO 003 MSP configuration file not found at [/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp/config.yaml]: [stat /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp/config.yaml: no such file or directory]
2017-05-15 10:07:54.419 UTC [msp] GetLocalMSP -> DEBU 004 Returning existing local MSP
2017-05-15 10:07:54.419 UTC [msp] GetDefaultSigningIdentity -> DEBU 005 Obtaining default signing identity
2017-05-15 10:07:54.428 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 006 Using default escc
2017-05-15 10:07:54.428 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 007 Using default vscc
2017-05-15 10:07:54.429 UTC [msp] Sign -> DEBU 008 Sign: plaintext: 0AAC070A6608031A0C08FAFBE5C80510...324D53500A04657363630A0476736363
2017-05-15 10:07:54.429 UTC [msp] Sign -> DEBU 009 Sign: digest: 1478467FB4600A3D2DF5DE6270C7D8027457F70CFA4E1BB39CB7C1EFE8B46FF5
Error: Error endorsing chaincode: rpc error: code = 2 desc = Error starting container: Failed to generate platform-specific docker build: Error creating container: no such image
Usage:
peer chaincode instantiate [flags]
λ docker ps --format "{{.ID}} : {{.Image}} : {{.Status}} : {{.Names}}"
e96f9c901b58 : hyperledger/fabric-testenv : Up 4 minutes : cli
9bf8a7757d9b : hyperledger/fabric-orderer : Up 4 minutes : orderer.example.com
11894105db83 : hyperledger/fabric-peer : Up 4 minutes : peer0.org1.example.com
508e72d611ab : hyperledger/fabric-peer : Up 4 minutes : peer1.org2.example.com
efb062adff31 : hyperledger/fabric-peer : Up 4 minutes : peer1.org1.example.com
705b026fa6a2 : hyperledger/fabric-peer : Up 4 minutes : peer0.org2.example.com
5524f0c0baca : hyperledger/fabric-ca:x86_64-1.0.0-alpha : Up 4 minutes : ca_peerOrg1
3be3f3e371f1 : hyperledger/fabric-ca:x86_64-1.0.0-alpha : Up 4 minutes : ca_peerOrg2
E:\projects\hyperledger-local\e2e_cli
λ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
10.200.208.11:5000/hyperledger/fabric-ccenv latest b5948741383b 8 days ago 1.29 GB
hyperledger/fabric-ccenv 1.0.0-snapshot-f5987e2 b5948741383b 8 days ago 1.29 GB
hyperledger/fabric-ccenv latest b5948741383b 8 days ago 1.29 GB
hyperledger/fabric-testenv latest 4a487b93966f 8 days ago 1.4 GB
hyperledger/fabric-orderer latest 377e857c0436 8 days ago 182 MB
hyperledger/fabric-peer latest 36cf446acc15 8 days ago 185 MB
hyperledger/fabric-ca x86_64-1.0.0-alpha 35311d8617b4 8 weeks ago 240 MB
hyperledger/fabric-baseos x86_64-0.3.0 c3a4cf3b3350 3 months ago 161 MB
d4w/nsenter latest 9e4f13a0901e 7 months ago 83.8 kB
2017-05-15 10:07:54.433 UTC [chaincode] launchAndWaitForRegister -> DEBU 420 start container with env:
CORE_CHAINCODE_ID_NAME=mycc:1.0
CORE_PEER_TLS_ENABLED=true
CORE_CHAINCODE_LOGLEVEL=WARNING
CORE_CHAINCODE_LOGFORMAT=%{color}%{time:2006-01-02 15:04:05.000 MST} [%{module}] %{shortfunc} -> %{level:.4s} %{id:03x}%{color:reset} %{message}
2017-05-15 10:07:54.433 UTC [container] lockContainer -> DEBU 421 waiting for container(dev-peer0.org2.example.com-mycc-1.0) lock
2017-05-15 10:07:54.433 UTC [container] lockContainer -> DEBU 422 got container (dev-peer0.org2.example.com-mycc-1.0) lock
2017-05-15 10:07:54.433 UTC [dockercontroller] Start -> DEBU 423 Cleanup container dev-peer0.org2.example.com-mycc-1.0
2017-05-15 10:07:54.434 UTC [dockercontroller] stopInternal -> DEBU 424 Stop container dev-peer0.org2.example.com-mycc-1.0(No such container: dev-peer0.org2.example.com-mycc-1.0)
2017-05-15 10:07:54.435 UTC [dockercontroller] stopInternal -> DEBU 425 Kill container dev-peer0.org2.example.com-mycc-1.0 (No such container: dev-peer0.org2.example.com-mycc-1.0)
2017-05-15 10:07:54.435 UTC [dockercontroller] stopInternal -> DEBU 426 Remove container dev-peer0.org2.example.com-mycc-1.0 (No such container: dev-peer0.org2.example.com-mycc-1.0)
2017-05-15 10:07:54.435 UTC [dockercontroller] Start -> DEBU 427 Start container dev-peer0.org2.example.com-mycc-1.0
2017-05-15 10:07:54.435 UTC [dockercontroller] getDockerHostConfig -> DEBU 428 docker container hostconfig NetworkMode: e2ecli_default
2017-05-15 10:07:54.436 UTC [dockercontroller] createContainer -> DEBU 429 Create container: dev-peer0.org2.example.com-mycc-1.0
2017-05-15 10:07:54.438 UTC [dockercontroller] Start -> DEBU 42a start-could not find image ...attempt to recreate image no such image
2017-05-15 10:07:54.440 UTC [chaincode-platform] generateDockerfile -> DEBU 42b
FROM hyperledger/fabric-baseos:x86_64-0.3.0
ADD binpackage.tar /usr/local/bin
LABEL org.hyperledger.fabric.chaincode.id.name="mycc" \
org.hyperledger.fabric.chaincode.id.version="1.0" \
org.hyperledger.fabric.chaincode.type="GOLANG" \
org.hyperledger.fabric.version="1.0.0-snapshot-f5987e2" \
org.hyperledger.fabric.base.version="0.3.0"
ENV CORE_CHAINCODE_BUILDLEVEL=1.0.0-snapshot-f5987e2
ENV CORE_PEER_TLS_ROOTCERT_FILE=/etc/hyperledger/fabric/peer.crt
COPY peer.crt /etc/hyperledger/fabric/peer.crt
2017-05-15 10:07:54.456 UTC [chaincode-platform] func1 -> ERRO 42c Failed to generate platform-specific docker build: Error creating container: no such image
2017-05-15 10:07:54.456 UTC [dockercontroller] deployImage -> ERRO 42d Error building images: Failed to generate platform-specific docker build: Error creating container: no such image
2017-05-15 10:07:54.456 UTC [dockercontroller] deployImage -> ERRO 42e Image Output:
********************
********************
2017-05-15 10:07:54.456 UTC [container] unlockContainer -> DEBU 42f container lock deleted(dev-peer0.org2.example.com-mycc-1.0)
2017-05-15 10:07:54.456 UTC [chaincode] Launch -> ERRO 430 launchAndWaitForRegister failed Error starting container: Failed to generate platform-specific docker build: Error creating container: no such image
2017-05-15 10:07:54.456 UTC [lockbasedtxmgr] Done -> DEBU 431 Done with transaction simulation / query execution [e5c0c063-d4d6-4dcf-95aa-43084f435fd0]
2017-05-15 10:07:55.756 UTC [deliveryClient] StopDeliverForChannel -> DEBU 432 This peer will stop pass blocks from orderer service to other peers
2017-05-15 10:07:55.756 UTC [blocksProvider] DeliverBlocks -> WARN 433 Receive error: Client is closing
@hvram1
Copy link
Author

hvram1 commented May 15, 2017

Hyperledger logs

@hvram1
Copy link
Author

hvram1 commented May 15, 2017

In case anybody is hitting this gist from google then this problem is solved .
I had to tag the ccenv image as hyperledger/fabric-ccenv:x86_64-1.0.0-snapshot-f5987e2 . I had done only 1.0.0-snapshot-f5987e2 . (i.e.) I missed the x86_64- prefix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment