todo-list-fabric icon indicating copy to clipboard operation
todo-list-fabric copied to clipboard

Chaincode failing to deploy Error: getting chaincode package bytes: Error getting code 'go get' failed with error:

Open GoodFaithParadigm8 opened this issue 8 years ago • 1 comments

Deployed chaincode several different ways onto Fabric each time resulting with with the error above. Tried suggestions found on StackOverflow to resolve the issue without success.

Log output from node:

OUT - 16:28:22.771 [rest] ProcessChaincode -> INFO 0a8 [0m REST processing chaincode request... OUT - 16:28:22.771 [rest] processChaincodeDeploy -> INFO 0a9 [0m REST deploying chaincode... OUT - 16:28:22.771 [rest] processChaincodeDeploy -> INFO 0aa [0m Local user 'user_type1_0' is already logged in. Retrieving login token. OUT - [31m16:28:24.317 [devops] getChaincodeBytes -> ERRO 0ab [0m Error getting chaincode package bytes: Error getting code 'go get' failed with error: "exit status 1" OUT - package github.com/GoodFaithParadigm8/todo-list-fabric/chaincode/chaincode: cannot find package "github.com/GoodFaithParadigm8/todo-list-fabric/chaincode/chaincode" in any of: OUT - /opt/go/src/github.com/GoodFaithParadigm8/todo-list-fabric/chaincode/chaincode (from $GOROOT) OUT - /opt/gopath/_usercode_/262468799/src/github.com/GoodFaithParadigm8/todo-list-fabric/chaincode/chaincode (from $GOPATH) OUT - /opt/gopath/src/github.com/GoodFaithParadigm8/todo-list-fabric/chaincode/chaincode OUT - [31m16:28:24.317 [devops] Deploy -> ERRO 0ac [0m Error deploying chaincode spec: type:GOLANG chaincodeID:<path:"https://github.com/GoodFaithParadigm8/todo-list-fabric/chaincode/chaincode" > ctorMsg:<args:"string" args:"string" > secureContext:"user_type1_0"

GoodFaithParadigm8 avatar Apr 18 '17 23:04 GoodFaithParadigm8

The problem is the GET that will try to access to the .go file On Github if you do a GET on a file under a branch for example, you will get the HTML page and not the file downloaded. To avoid this problem, put the .go file on the root of your project. When Hyperledger Fabric will see the url, it will download the project locally and search for a .go file on the root folder

you will see it works like this ;o)

image

zamrokk avatar May 16 '17 08:05 zamrokk