Re: Unable to launch/instantiate chaincode container

Siddharth Jain

think we found what is causing the problem. the peer is on one network but if we manually create a container from the chaincode image, it is not on the same network. how can we fix this?

"Networks": {
                "testnet": {
                    "IPAMConfig": null,
                    "Links": null,
                    "Aliases": [
                    "NetworkID": "c0d70c64a014356e634b6511bb551a44e7ce3badf172792adad5a44a64d1e27b",
                    "EndpointID": "c37e20e91cc5ec3fb8c3f33512cbfecfbdb7ed9021825a749ccffa029ae6bf8b",
                    "Gateway": "",
                    "IPAddress": "",
                    "IPPrefixLen": 16,
                    "IPv6Gateway": "",
                    "GlobalIPv6Address": "",
                    "GlobalIPv6PrefixLen": 0,
                    "MacAddress": "02:42:ac:12:00:03",
                    "DriverOpts": null

chaincode container:
            "Networks": {
               "bridge": {
                   "IPAMConfig": null,
                   "Links": null,
                   "Aliases": null,
                   "NetworkID": "f6d2d4227f8879d8601149235c1574635be846bf8f9e63be8f6c0f56a62c5a8d",
                   "EndpointID": "ed2d439e55f0d3b74ab08ac528b52cdab0ab9b68f00cf671cab79687c0d1081e",
                   "Gateway": "",
                   "IPAddress": "",
                   "IPPrefixLen": 16,
                   "IPv6Gateway": "",
                   "GlobalIPv6Address": "",
                   "GlobalIPv6PrefixLen": 0,
                   "MacAddress": "02:42:ac:11:00:03",
                   "DriverOpts": null

we have tried setting CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE to testnet but it does not make any difference.

From: Siddharth Jain <siddjain@...>
Sent: Tuesday, February 11, 2020 11:16 AM
To: Siddharth Jain <siddjain@...>
Subject: Re: [Hyperledger Fabric] Unable to launch/instantiate chaincode container

From: fabric@... <fabric@...> on behalf of Siddharth Jain <siddjain@...>
Sent: Tuesday, February 11, 2020 10:48 AM
To: fabric@... <fabric@...>
Subject: [Hyperledger Fabric] Unable to launch/instantiate chaincode container
we are running into a problem where chaincode container is not getting launched. full stacktrace can be found here but basically the execution reaches this point:

if err := r.Runtime.Start(ccci, codePackage); err != nil {
                startFailCh <- errors.WithMessage(err, "error starting container")
            exitCode, err := r.Runtime.Wait(ccci) // this is where we get an exitCode 1
            if err != nil {
                launchState.Notify(errors.Wrap(err, "failed to wait on container exit"))
            launchState.Notify(errors.Errorf("container exited with %d", exitCode))

and fails with

launchState.Notify(errors.Errorf("container exited with %d", exitCode))
2020-02-10 23:49:40.130 UTC [endorser] SimulateProposal -> ERRO 056 [tracktrace][b69889f9] failed to invoke chaincode name:"mycc" , error: container exited with 1*RuntimeLauncher).Launch.func1

Things we have tried to debug:
  • verified the chaincode image is getting built
  • verified chaincode image has smart contract installed under /usr/local/src
  • docker ps -f "status=exited" shows no record of container ==> container never got instantiated 
  • verified /var/run/docker.sock exists and is mounted to the peer node using 
    --volume /var/run/:/host/var/run/ and 
  • from within the peer we can verify

    root@c54560119c91:/home# ls /host/var/run

    diagnosticsd.sock  docker  docker.sock  linuxkit-containerd  linuxkit-external-logging.sock rpcbind.lock  rpcbind.sock  service-port-opener

  • the host is a mac machine in case it matters

  • chaincode was previously instantiated when peer was running in dev mode and we were able to submit transactions. now we are switching peer to net mode.

$ docker version
Client: Docker Engine - Community
 Version:           19.03.4
 API version:       1.40
 Go version:        go1.12.10
 Git commit:        9013bf5
 Built:             Thu Oct 17 23:44:48 2019
 OS/Arch:           darwin/amd64
 Experimental:      false

Server: Docker Engine - Community
  Version:          19.03.4
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.12.10
  Git commit:       9013bf5
  Built:            Thu Oct 17 23:50:38 2019
  OS/Arch:          linux/amd64
  Experimental:     true
  Version:          v1.2.10
  GitCommit:        b34a5c8af56e510852c35414db4c1f4fa6172339
  Version:          1.0.0-rc8+dev
  GitCommit:        3e425f80a8c931f88e6d94a8c831b9d5aa481657
  Version:          0.18.0
  GitCommit:        fec3683

we are using fabric version 1.4

not sure where to go from here.

Join to automatically receive all group messages.