简体   繁体   中英

Invoking chaincode with hyperledger fabric: Executable file not found in $PATH\ ": unknown"

So, I have a chaincode application based on the fabcar sample from fabric-samples. Yesterday, I was able to bring it up and run the initLedger function, but found issues with my chaincode when running further invocations. However, when i brought the.network back up after debugging (which turned out to be a nightmare in Go), I can no longer get the InitLedger to execute, it just gives me the following error:

Error: endorsement failure during invoke. response: status:500 message:"error in simulation: failed to execute transaction f2589dd7849c01064d5ed827867085d02615ac4fe4d5edcaed31b1a7d5635c94: could not launch chaincode 
fakenews_1.0:230eafea48b912ae8f96bfc79bea3b02b4538992547e9de284f80c66a1f52550: error starting container: error starting container: API error (400): OCI runtime create failed: container_linux.go:349: starting container process caused \"exec: \\\"chaincode\\\": executable file not found in $PATH\": unknown" 

As far as I can tell, this is due to an issue with docker , but I can't really figure out how to solve it in my case. Has anyone ran into this before?

For extra information, the main difference between the fabcar chaincode and mine is that I am reading from a JSON file and mapping that to a list of objects which are then put on my blockchain. At least that's what I'm trying to do, because the one time I managed to run the InitLedger, my QueryAll invocation came up empty.

Check the chaincode path. I think your chaincode path is wrong.

Lets say you are mapping chaincode directory like below in compose file.

volumes:
  ../chaincode:/opt/gopath/src/github.com/chaincode

then export CC_SRC_PATH=/opt/gopath/src/github.com/chaincode

use above path when executing invoke command. You can add -p ${CC_SRC_PATH} .

peer chaincode install -n mycc -v ${VERSION} -l ${LANGUAGE} -p ${CC_SRC_PATH} >&log.txt

NOTE: I'm assuming that you are running all these command inside cli container

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM