-1

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.

Volker
  • 40,468
  • 7
  • 81
  • 87
Liam
  • 47
  • 8

1 Answers1

0

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

metadata
  • 1,139
  • 1
  • 7
  • 28
  • I have confirmed that the path is correct. I'm using the exact same structure as the fabcar/asset-transfer-basic samples, so there really is not much room for error. As i mentioned in the original post, this rather seems like an issue with docker not being able to execute go programs. I am running all of this directly from the terminal, just like in the tutorials. If there is a better way of doing it, the tutorials don't reflect that. – Liam Aug 24 '20 at 13:12
  • Is `fabric-sample/test-network/network.sh` script working fine? – metadata Aug 24 '20 at 15:00
  • Also you can try running a `cli` container and try running these commands from there else you have to use `sdk`. – metadata Aug 24 '20 at 15:01