IBM-Blockchain-Archive / ibm-blockchain-issues

Having issues with the IBM Blockchain Bluemix service? Let us know!
13 stars 12 forks source link

No chaincode instance is created with successful deployment response. #103

Closed mochechan closed 6 years ago

mochechan commented 7 years ago

The chaincode deployment is described as the following bash script:

========================= Start of bash script

#!/bin/bash
URL="https://4813636a88d7450da8f10b7f7c177f9c-vp0.us.blockchain.ibm.com:5003/"

curl -X GET --header "Accept: application/json" "{$URL}chain"

curl -X POST --header "Content-Type: application/json" --header "Accept: application/json" -d "{  \"enrollId\": \"admin\",  \"enrollSecret\": \"9b2a366f46\"}" "{$URL}registrar"

#curl -X POST --header "Content-Type: application/json" --header "Accept: application/json" -d "{ \"jsonrpc\": \"2.0\", \"method\": \"deploy\", \"params\": { \"type\": 1, \"chaincodeID\": { \"path\": \"http://gopkg.in/ibm-blockchain/example02.v2/chaincode\" }, \"ctorMsg\": { \"function\": \"init\", \"args\": [ \"a\", \"100\", \"b\", \"200\" ] }, \"secureContext\": \"admin\" }, \"id\": 1 }"  "{$URL}chaincode"

curl -X POST --header "Content-Type: application/json" --header "Accept: application/json" -d "{ \"jsonrpc\": \"2.0\", \"method\": \"deploy\", \"params\": { \"type\": 1, \"chaincodeID\": { \"path\": \"https://github.com/mochechan/chaincodes\" }, \"ctorMsg\": { \"function\": \"init\", \"args\": [ \"fusions360bank\", \"10000\" ] }, \"secureContext\": \"admin\" }, \"id\": 1 }"  "{$URL}chaincode"
# response: {"jsonrpc":"2.0","result":{"status":"OK","message":"7e6197023b527d2c351bb5650024d0c23db5c01fca7be86323c3abf6ee1a73c13a61c3bfbaca8a0389e4f11ba12af34c9ed025d51e9ab209d2fbe10dd63596d9"},"id":1}

curl -X POST --header "Content-Type: application/json" --header "Accept: application/json" -d "{ \"jsonrpc\": \"2.0\", \"method\": \"invoke\", \"params\": { \"type\": 1, \"chaincodeID\": { \"path\": \"https://github.com/mochechan/chaincodes\" }, \"ctorMsg\": { \"function\": \"init\", \"args\": [ \"fusions360bank\", \"10000\" ] }, \"secureContext\": \"admin\" }, \"id\": 1 }"  "{$URL}chaincode"

========================== End of bash script

The response has chaincode ID, so I decide the deployment should be correct. However, no any chaincode instance is created. I checked the log and found the following:

========================== Start of partial log OUT - 03:20:49.974 [rest] Register -> INFO 02d REST client login... OUT - 03:20:49.974 [rest] Register -> INFO 02e Local data store for client loginToken: /var/hyperledger/production/client/ OUT - 03:20:49.974 [rest] Register -> INFO 02f Logging in user 'admin' on REST interface... OUT - 03:20:49.974 [crypto] RegisterClient -> INFO 030 Registering client [admin] with name [admin]... OUT - 03:20:50.259 [crypto] Info -> INFO 031 [client.admin] Register crypto engine... OUT - 03:20:50.260 [crypto] Info -> INFO 032 [client.admin] Register crypto engine...done. OUT - 03:20:50.260 [crypto] RegisterClient -> INFO 033 Registering client [admin] with name [admin]...done! OUT - 03:20:50.260 [rest] Register -> INFO 034 Storing login token for user 'admin'. OUT - 03:20:50.260 [rest] Register -> INFO 035 Login successful for user 'admin'. OUT - 03:20:57.251 [rest] ProcessChaincode -> INFO 036 REST processing chaincode request... OUT - 03:20:57.251 [rest] processChaincodeDeploy -> INFO 037 REST deploying chaincode... OUT - 03:20:57.252 [rest] processChaincodeDeploy -> INFO 038 Local user 'admin' is already logged in. Retrieving login token. OUT - 03:21:18.474 [container] WriteGopathSrc -> INFO 039 rootDirectory = /opt/gopath/src OUT - 03:21:18.474 [container] WriteFolderToTarPackage -> INFO 03a rootDirectory = /opt/gopath/src OUT - 03:21:20.322 [crypto] InitClient -> INFO 03b Initializing client [admin]... OUT - 03:21:20.351 [crypto] InitClient -> INFO 03c Initializing client [admin]...done! OUT - 03:21:20.650 [crypto] closeClientInternal -> INFO 03d Closing client [admin]... OUT - 03:21:20.692 [rest] processChaincodeDeploy -> INFO 03e Successfully deployed chainCode: 9d73c5dc6f52a90930200879b285461aa69fb05c42d14ecc934295df0867f3973a6ae69e5fc65d83a98e005bc1cbbfc7b1004572e25e219f369643de493835d1 OUT - 03:21:20.692 [rest] ProcessChaincode -> INFO 03f REST successfully deploy chaincode: {"jsonrpc":"2.0","result":{"status":"OK","message":"9d73c5dc6f52a90930200879b285461aa69fb05c42d14ecc934295df0867f3973a6ae69e5fc65d83a98e005bc1cbbfc7b1004572e25e219f369643de493835d1"},"id":1} OUT - 03:21:21.876 [consensus/pbft] ProcessEvent -> INFO 040 Replica 0 batch timer expired OUT - 03:21:21.877 [consensus/pbft] sendBatch -> INFO 041 Creating batch with 1 requests OUT - 03:21:22.170 [consensus/pbft] executeOne -> INFO 042 Replica 0 executing/committing request batch for view=0/seqNo=1 and digest XyOut1W/JfW4Dw+cg/BmHpXs9bwEHp1FS6chpt92oq9g3hweaocf4byhe47PHoh74HbKERaeuG7VDUJqzx29rQ== OUT - 03:21:27.722 [dockercontroller] deployImage -> ERRO 043 Error building images: The command '/bin/sh -c go install github.com/mochechan/chaincodes && cp src/github.com/hyperledger/fabric/peer/core.yaml $GOPATH/bin && mv $GOPATH/bin/chaincodes $GOPATH/bin/9d73c5dc6f52a90930200879b285461aa69fb05c42d14ecc934295df0867f3973a6ae69e5fc65d83a98e005bc1cbbfc7b1004572e25e219f369643de493835d1' returned a non-zero code: 1 OUT - 03:21:27.722 [dockercontroller] deployImage -> ERRO 044 Image Output: OUT - **** OUT - Step 1 : FROM hyperledger/fabric-baseimage OUT - ---> 21cb00fb27f4 OUT - Step 2 : COPY src $GOPATH/src OUT - ---> 2821a02055e2 OUT - Step 3 : WORKDIR $GOPATH OUT - ---> Running in ebe625d0d750 OUT - ---> 6dc615e9de58 OUT - Step 4 : RUN go install github.com/mochechan/chaincodes && cp src/github.com/hyperledger/fabric/peer/core.yaml $GOPATH/bin && mv $GOPATH/bin/chaincodes $GOPATH/bin/9d73c5dc6f52a90930200879b285461aa69fb05c42d14ecc934295df0867f3973a6ae69e5fc65d83a98e005bc1cbbfc7b1004572e25e219f369643de493835d1 OUT - ---> Running in dc6ffaf58794 OUT - src/github.com/mochechan/chaincodes/pay2v1.0.go:55:2: cannot find package "github.com/hyperledger/fabric/protos/peer" in any of: OUT - /opt/go/src/github.com/hyperledger/fabric/protos/peer (from $GOROOT) OUT - /opt/gopath/src/github.com/hyperledger/fabric/protos/peer (from $GOPATH) OUT -  OUT - **** OUT - 03:21:27.927 [dockercontroller] Start -> ERRO 045 start-could not recreate container API error (500): Error: image library/39d365367de9442fab8b2ff699e232af-vp0-9d73c5dc6f52a90930200879b285461aa69fb05c42d14ecc934295df0867f3973a6ae69e5fc65d83a98e005bc1cbbfc7b1004572e25e219f369643de493835d1:latest not found OUT - 03:21:27.928 [chaincode] Launch -> ERRO 046 launchAndWaitForRegister failed Error starting container: API error (500): Error: image library/39d365367de9442fab8b2ff699e232af-vp0-9d73c5dc6f52a90930200879b285461aa69fb05c42d14ecc934295df0867f3973a6ae69e5fc65d83a98e005bc1cbbfc7b1004572e25e219f369643de493835d1:latest not found OUT - 03:21:27.928 [consensus/pbft] execDoneSync -> INFO 047 Replica 0 finished execution 1, trying next OUT - 03:24:38.977 [rest] Register -> INFO 048 REST client login... OUT - 03:24:38.977 [rest] Register -> INFO 049 Local data store for client loginToken: /var/hyperledger/production/client/ OUT - 03:24:38.977 [rest] Register -> INFO 04a User 'admin' is already logged in. OUT - 03:25:14.483 [rest] ProcessChaincode -> INFO 04b REST processing chaincode request... OUT - 03:25:14.484 [rest] processChaincodeDeploy -> INFO 04c REST deploying chaincode... OUT - 03:25:14.484 [rest] processChaincodeDeploy -> INFO 04d Local user 'admin' is already logged in. Retrieving login token. OUT - 03:25:37.045 [container] WriteGopathSrc -> INFO 04e rootDirectory = /opt/gopath/src OUT - 03:25:37.045 [container] WriteFolderToTarPackage -> INFO 04f rootDirectory = /opt/gopath/src OUT - 03:25:38.810 [crypto] InitClient -> INFO 050 Initializing client [admin]... OUT - 03:25:38.909 [crypto] InitClient -> INFO 051 Initializing client [admin]...done! OUT - 03:25:38.944 [crypto] closeClientInternal -> INFO 052 Closing client [admin]... OUT - 03:25:38.949 [rest] processChaincodeDeploy -> INFO 053 Successfully deployed chainCode: 07a7e3a49d1adad432b13fb213f21b6c0cb70a59bb475d97ce5d8408d973ac7ab856160823dc8368f3ba1e854cbb8a45ee9e051f41b5194257607db13b17ef36 OUT - 03:25:38.949 [rest] ProcessChaincode -> INFO 054 REST successfully deploy chaincode: {"jsonrpc":"2.0","result":{"status":"OK","message":"07a7e3a49d1adad432b13fb213f21b6c0cb70a59bb475d97ce5d8408d973ac7ab856160823dc8368f3ba1e854cbb8a45ee9e051f41b5194257607db13b17ef36"},"id":1} OUT - 03:25:40.129 [consensus/pbft] ProcessEvent -> INFO 055 Replica 0 batch timer expired OUT - 03:25:40.130 [consensus/pbft] sendBatch -> INFO 056 Creating batch with 1 requests OUT - 03:25:40.339 [consensus/pbft] executeOne -> INFO 057 Replica 0 executing/committing request batch for view=0/seqNo=2 and digest B6bLrsfwUZFVB7s+Y0rMYAFKQMfYAOW5A+Y7/emSoZCNUF4CFNN9cHutBsh/GWbadOGmLzdb/WylQYHKMS7OJQ== OUT - 03:25:46.787 [dockercontroller] deployImage -> ERRO 058 Error building images: The command '/bin/sh -c go install github.com/mochechan/chaincodes && cp src/github.com/hyperledger/fabric/peer/core.yaml $GOPATH/bin && mv $GOPATH/bin/chaincodes $GOPATH/bin/07a7e3a49d1adad432b13fb213f21b6c0cb70a59bb475d97ce5d8408d973ac7ab856160823dc8368f3ba1e854cbb8a45ee9e051f41b5194257607db13b17ef36' returned a non-zero code: 1 OUT - 03:25:46.788 [dockercontroller] deployImage -> ERRO 059 Image Output: OUT - **** OUT - Step 1 : FROM hyperledger/fabric-baseimage OUT - ---> 21cb00fb27f4 OUT - Step 2 : COPY src $GOPATH/src OUT - ---> 17bee5c0cf99 OUT - Step 3 : WORKDIR $GOPATH OUT - ---> Running in 4e33e858fed7 OUT - ---> b12581dcc731 OUT - Step 4 : RUN go install github.com/mochechan/chaincodes && cp src/github.com/hyperledger/fabric/peer/core.yaml $GOPATH/bin && mv $GOPATH/bin/chaincodes $GOPATH/bin/07a7e3a49d1adad432b13fb213f21b6c0cb70a59bb475d97ce5d8408d973ac7ab856160823dc8368f3ba1e854cbb8a45ee9e051f41b5194257607db13b17ef36 OUT - ---> Running in b23d90d4b172 OUT - src/github.com/mochechan/chaincodes/pay2v1.0.go:55:2: cannot find package "github.com/hyperledger/fabric/protos/peer" in any of: OUT - /opt/go/src/github.com/hyperledger/fabric/protos/peer (from $GOROOT) OUT - /opt/gopath/src/github.com/hyperledger/fabric/protos/peer (from $GOPATH) OUT -  OUT - **** OUT - 03:25:50.757 [dockercontroller] Start -> ERRO 05a start-could not recreate container API error (500): Error: image library/39d365367de9442fab8b2ff699e232af-vp0-07a7e3a49d1adad432b13fb213f21b6c0cb70a59bb475d97ce5d8408d973ac7ab856160823dc8368f3ba1e854cbb8a45ee9e051f41b5194257607db13b17ef36:latest not found OUT - 03:25:50.757 [chaincode] Launch -> ERRO 05b launchAndWaitForRegister failed Error starting container: API error (500): Error: image library/39d365367de9442fab8b2ff699e232af-vp0-07a7e3a49d1adad432b13fb213f21b6c0cb70a59bb475d97ce5d8408d973ac7ab856160823dc8368f3ba1e854cbb8a45ee9e051f41b5194257607db13b17ef36:latest not found OUT - 03:25:50.757 [consensus/pbft] execDoneSync -> INFO 05c Replica 0 finished execution 2, trying next ==================== End of partial log

The failure should be "src/github.com/mochechan/chaincodes/pay2v1.0.go:55:2: cannot find package". My idea is to install the missing package, but I don't know how to attach the docker container to do this. How can I solve this problem? Thanks a lot.

dshuffma-ibm commented 7 years ago

you can create a vender folder in the same directory as github.com/mochechan/chaincodes/pay2v1.0.go. its looking for github.com/hyperledger/fabric/protos/peer but you might as well clone the whole hyperledger project into your vendor folder.

dshuffma-ibm commented 6 years ago

closing, inactivity