2
votes

I am doing the fabcar tutorial from the hyperledger fabric website, which walks you through building your first application: https://hyperledger-fabric.readthedocs.io/en/release-1.4/write_first_app.html. There are 3 implementations of the smart contract , in Java, Javascript and TypeScript. When I run the javascript version, everything works fine. However I want to run the Java version but when I build the script I get the following error:

Error: could not assemble transaction, err proposal response was not successful, error code 500, msg chaincode registration failed: container exited with 1

Could this be an issue with the my version of java (13) or is it something else?

here are more of the logs, everything seems to work until this final step.

echo 'Instantiating smart contract on mychannel' Instantiating smart contract on mychannel + docker exec -e CORE_PEER_LOCALMSPID=Org1MSP -e CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/[email protected]/msp cli peer chaincode instantiate -o orderer.example.com:7050 -C mychannel -n fabcar -l java -v 1.0 -c '{"Args":[]}' -P 'AND('\''Org1MSP.member'\'','\''Org2MSP.member'\'')' --tls --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem --peerAddresses peer0.org1.example.com:7051 --tlsRootCertFiles /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt 2020-01-28 19:24:23.402 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc 2020-01-28 19:24:23.402 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc Error: could not assemble transaction, err proposal response was not successful, error code 500, msg chaincode registration failed: container exited with 1

Update The docker logs of peer0.org1.example.com at the point of failure:

2020-01-29 13:05:01.124 UTC [endorser] callChaincode -> INFO 068 [mychannel][3d08b962] Entry chaincode: name:"lscc" 2020-01-29 13:05:59.950 UTC [endorser] callChaincode -> INFO 069 [mychannel][3d08b962] Exit chaincode: name:"lscc" (58894ms) 2020-01-29 13:05:59.952 UTC [endorser] SimulateProposal -> ERRO 06a [mychannel][3d08b962] failed to invoke chaincode name:"lscc" , error: container exited with 1 github.com/hyperledger/fabric/core/chaincode.(*RuntimeLauncher).Launch.func1 /opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/runtime_launcher.go:63 runtime.goexit /opt/go/src/runtime/asm_amd64.s:1337 chaincode registration failed 2020-01-29 13:05:59.953 UTC [comm.grpc.server] 1 -> INFO 06b unary call completed grpc.service=protos.Endorser grpc.method=ProcessProposal grpc.peer_address=192.168.192.13:53690 grpc.code=OK grpc.call_duration=58.8992206s

1
What do the docker logs from peer0.org1.example.com say docker logs peer0.org1.example.comlindluni
i have updated the question with the docker logs, the error occurs during instantiation of the chaincodeX2015jpp

1 Answers

0
votes

If you've already run through the tutorial with the Javascript version (as you mentioned above), you must first bring down the existing network and remove any active containers.

./byfn.sh down
docker rm -f $(docker ps -aq)
docker rmi -f $(docker images | grep fabcar | awk '{print $3}')

Now run the startup script with Java version using ./startFabric.sh java