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?

peer:
"Networks": {
                "testnet": {
                    "IPAMConfig": null,
                    "Links": null,
                    "Aliases": [
                        "2032a003bce7"
                    ],
                    "NetworkID": "c0d70c64a014356e634b6511bb551a44e7ce3badf172792adad5a44a64d1e27b",
                    "EndpointID": "c37e20e91cc5ec3fb8c3f33512cbfecfbdb7ed9021825a749ccffa029ae6bf8b",
                    "Gateway": "172.18.0.1",
                    "IPAddress": "172.18.0.3",
                    "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": "172.17.0.1",
                   "IPAddress": "172.17.0.3",
                   "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")
                return
            }
            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
github.com/hyperledger/fabric/core/chaincode.(*RuntimeLauncher).Launch.func1
	/opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/runtime_launcher.go:63
runtime.goexit

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 
    CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
  • from within the peer we can verify

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

    diagnosticsd.sock  docker  docker.pid  docker.sock  linuxkit-containerd  linuxkit-external-logging.sock  rpc.statd.pid rpcbind.lock  rpcbind.sock  service-port-opener  sm-notify.pid

  • 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
 Engine:
  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
 containerd:
  Version:          v1.2.10
  GitCommit:        b34a5c8af56e510852c35414db4c1f4fa6172339
 runc:
  Version:          1.0.0-rc8+dev
  GitCommit:        3e425f80a8c931f88e6d94a8c831b9d5aa481657
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683

we are using fabric version 1.4

not sure where to go from here.

Join fabric@lists.hyperledger.org to automatically receive all group messages.