1

We are trying to instantiate the sample chaincode github.com/chaincode/chaincode_example02/go/ in a sample network, and we get the following error message... any suggestions where to look at?

CLI logs:

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

Peer Logs:

2020-10-29 15:20:31.341 UTC [gossip.comm] sendToEndpoint -> DEBU 5ed1 Exiting
2020-10-29 15:20:31.397 UTC [chaincode] Launch -> DEBU 5ed2 stopping due to error while launching: container exited with 0
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:1333
chaincode registration failed
2020-10-29 15:20:31.397 UTC [container] lockContainer -> DEBU 5ed3 waiting for container(mycc-1.0) lock
2020-10-29 15:20:31.397 UTC [container] lockContainer -> DEBU 5ed4 got container (mycc-1.0) lock
2020-10-29 15:20:31.417 UTC [container] unlockContainer -> DEBU 5edb container lock deleted(mycc-1.0)
2020-10-29 15:20:31.417 UTC [chaincode] Launch -> DEBU 5edc launch complete
2020-10-29 15:20:31.417 UTC [chaincode] Deregister -> DEBU 5edd deregister handler: mycc:1.0
2020-10-29 15:20:31.417 UTC [endorser] callChaincode -> INFO 5ede [mychannel][502c46f0] Exit chaincode: name:"lscc"  (35376ms)
2020-10-29 15:20:31.417 UTC [endorser] SimulateProposal -> ERRO 5edf [mychannel][502c46f0] failed to invoke chaincode name:"lscc" , error: container exited with 0
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:1333
chaincode registration failed
2020-10-29 15:20:31.417 UTC [endorser] SimulateProposal -> DEBU 5ee0 [mychannel][502c46f0] Exit
2020-10-29 15:20:31.417 UTC [lockbasedtxmgr] Done -> DEBU 5ee1 Done with transaction simulation / query execution [502c46f068a775e5966ee76e646b9444410e582877e12bd2b69aa89102061299]
2020-10-29 15:20:31.417 UTC [endorser] func1 -> DEBU 5ee2 Exit: request from 192.168.0.6:50290
  • Which version of Fabric? – Gari Singh Oct 29 '20 at 19:18
  • Fabric Version 1.4.3 – Alejo Acosta Oct 29 '20 at 23:04
  • The chaincode is failing to build - can you try setting https://github.com/hyperledger/fabric/blob/release-1.4/sampleconfig/core.yaml#L463 to false? You can also set the env var `CORE_VM_ATTACHSTDOUT=true` as well. This should pipe the Docker logs back to the peer. – Gari Singh Oct 30 '20 at 11:01
  • I have set the env var true/false, and run the instantiate without any different result :-( – Alejo Acosta Oct 30 '20 at 14:04
  • @GariSingh just upgraded to release 1.4.9, the instantiate failed but with the following message: `Error: could not assemble transaction, err proposal response was not successful, error code 500, msg error starting container: error starting container: Failed to generate platform-specific docker build: Error executing build: API error (404): network net_byfn not found "" ` We are using a different docker-compose network name than `net_byfn` ... Could that be the reason in the first place? How do we change the instantiation to work within a different docker-compose network id? – Alejo Acosta Oct 30 '20 at 15:07
  • You can set https://github.com/hyperledger/fabric/blob/release-1.4/sampleconfig/core.yaml#L477 to the name of your compose network. Also available as `CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE` – Gari Singh Oct 30 '20 at 15:28
  • @GariSingh 1.000 thanks to you. That fixed the issue... – Alejo Acosta Oct 30 '20 at 15:55

1 Answers1

0

The problem was caused by having a docker-compose network name which was not the default name (byfn). It was fixed by adding the environ variable CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE to the right name