happilymarrieddad/k8s-hyperledger-fabric-2.2

Getting error while install chaincode on AWS kops based kubernates setup

abhicoder29 opened this issue · 6 comments

I have setup AWS kops based kubernates setup HLF 2.2 however when I am trying to install chaincode I am getting error as below. Please help me anybody facing issue?

Error: chaincode install failed with status: 500 - failed to invoke backing implementation of 'InstallChaincode': could not build chaincode: docker build failed: docker image inspection failed: Get "http://unix.sock/images/dev-peer0-fpoclient-service-goproducesc_1-ad9d391f40c17852627973b353091f308673ca72837905c0b4185fcc5c727fe7-1faf51b14b31c8c5ed3dad79bcc520b2565397abd975da70fd327d79b86c12ed/json": dial unix /var/run/docker.sock: connect: no such file or directory

Were you able to solve this issue? I ran into the same problem.

@happilymarrieddad have you seen this issue?

This is probably a result of the host not being set correctly. How are you setting the /host? Here is an example of my setup.

peer0-deployment.yaml

...
    spec:
      volumes:
        - name: my-pv-storage
          persistentVolumeClaim:
            claimName: my-pv-claim
        - name: host
          hostPath:
            path: /var/run
      containers:
...
          volumeMounts:
            - mountPath: /var/run
              name: host
            - mountPath: /etc/hyperledger/fabric/msp
...

@cdesch
@abhicoder29

I think that is the reason. Mounting on the host is not an option for the k8s environment that I have. Is there a way to do this step or docker build without a mount to the host?

@cdesch You need some way to build and run containers for each version of the chaincode. For example, if you install version 1 of a chaincode and then update to version 2 of a chaincode there will be 2 containers to handle the logic for each version. I'm not sure how to do this without having something talk with docker or whatever the containerization is to create the containers for these chaincodes. Hyperledger does this automatically.

I understand and agree, although having access to the hostPath is not an option due to security concerns. I've been looking at the External ChainCode Builders instead. https://hyperledger-fabric.readthedocs.io/en/release-2.2/cc_launcher.html

I ran into the same problem with external chaincode builder. Did you find the solution?