Unable to launch/instantiate chaincode container


Siddharth Jain
 

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.