You most likely have specified an incorrect chaincode path
Issue
An attempt to invoke an installed, committed and approved Hyperledger Fabric v2 chaincode fails with the following error:
Error: endorsement failure during invoke. response: status:500 message:"error in simulation: failed to execute transaction 2676d7fbc05858a17cc1a9e110aa6b7db0b891c3380e16bfa0e0fe0f5e1d1307: could not launch chaincode chaincodename:4db844b0327bc1df0f2cdcf6f60ba22382c1ed44491c6d725384c7924c29a5b1: chaincode registration failed: container exited with 254"
Cause
The most probable causes are:
- You have specified an incorrect path to the chaincode when packaging it.
- You have specified an incorrect language flag when packaging the chaincode.
Incorrect path:
peer lifecycle chaincode package fabcar.tar.gz --lang node --path /data/chaincode/fabcar/ --label fabcar
Correct path:
peer lifecycle chaincode package fabcar.tar.gz --lang node --path /data/chaincode/fabcar/javascript --label fabcar
Incorrect language flag for a Go chaincode:
peer lifecycle chaincode package fabcar.tar.gz --lang node --path /data/chaincode/fabcar/go --label fabcar
Correct language flag for a Go chaincode:
peer lifecycle chaincode package fabcar.tar.gz --lang golang --path /data/chaincode/fabcar/go --label fabcar
It is possible to install, commit, and approve an incorrectly packaged chaincode. The chaincode will fail on an invoke attempt.
Solution
When packaging your chaincode, make sure you provide the full and correct path to the directory with the chaincode contract files.
See also Chainstack Docs: Hyperledger Fabric tools.
Comments
0 comments
Article is closed for comments.