TommyStarK / hyperledger-fabric-kubernetes

Deploy an Hyperledger Fabric v2.4 network on Kubernetes and use chaincodes as external services.
MIT License
32 stars 14 forks source link

Pod creation fails after running the deploy script #5

Closed anchit93 closed 3 years ago

anchit93 commented 3 years ago

Hi @TommyStarK , I tried to setup fabric network using this repository on minikube, but after running the ./deploy.sh command, setup job remains incomplete and status of pod goes into Init:Error state.

Here is the output of the failed pod:

Name:         setup-zxx6r
Namespace:    dummy-com
Priority:     0
Node:         minikube/172.17.0.58
Start Time:   Fri, 23 Apr 2021 17:49:24 +0000
Labels:       controller-uid=1637cd18-8cd6-4c0c-a051-8048fb11f116
              job-name=setup
Annotations:  <none>
Status:       Failed
IP:           172.18.0.6
IPs:
  IP:           172.18.0.6
Controlled By:  Job/setup
Init Containers:
  git-clone:
    Container ID:  docker://debaa71c0254f466b0a2f524a1566caa3b1b9a97661ac552bad8f6b265426f04
    Image:         bitnami/git
    Image ID:      docker-pullable://bitnami/git@sha256:de458a3fd5cf59714f18951ca7d71928860c0e211aa0d0bc41044b2fbfe3f5d3
    Port:          <none>
    Host Port:     <none>
    Args:
      clone
      --single-branch
      --
      https://github.com/TommyStarK/hyperledger-fabric-kubernetes.git
      /repo
    State:          Terminated
      Reason:       Error
      Exit Code:    127
      Started:      Fri, 23 Apr 2021 17:49:26 +0000
      Finished:     Fri, 23 Apr 2021 17:49:26 +0000
    Ready:          False
    Restart Count:  0
    Environment:    <none>
    Mounts:
      /repo from repo (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from default-token-qxd4z (ro)
Containers:
  fabric-tools:
    Container ID:  
    Image:         hyperledger/fabric-tools:2.3.0
    Image ID:      
    Port:          <none>
    Host Port:     <none>
    Command:
      /bin/sh
      -c
    Args:
      mkdir artifacts; cryptogen generate --config=./crypto-config.yaml; configtxgen -profile OrdererGenesis -channelID orderer-system-channel -outputBlock ./artifacts/orderer.genesis.block; configtxgen -profile ChannelAll -outputCreateChannelTx ./artifacts/channelall.tx -channelID channelall; cd -; mkdir -p /{buildpack/bin,chaincode-package,peer-core-config}; cp -R /repo/buildpack/bin/* /buildpack/bin; cp -R /repo/chaincode-as-external-service /chaincode-package; cp /repo/hlf-config/core.yaml /peer-core-config;
    State:          Waiting
      Reason:       PodInitializing
    Ready:          False
    Restart Count:  0
    Environment:
      FABRIC_CFG_PATH:  /repo/hlf-config
    Mounts:
      /buildpack/bin from chaincode-buildpack (rw,path="bin")
      /chaincode-package from chaincode-package (rw)
      /peer-core-config from chaincode-buildpack (rw,path="config")
      /repo from repo (rw)
      /repo/hlf-config/artifacts from hlf-artifacts (rw)
      /repo/hlf-config/crypto-config from hlf-crypto-config (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from default-token-qxd4z (ro)
Conditions:
  Type              Status
  Initialized       False 
  Ready             False 
  ContainersReady   False 
  PodScheduled      True 
Volumes:
  repo:
    Type:       EmptyDir (a temporary directory that shares a pod's lifetime)
    Medium:     
    SizeLimit:  <unset>
  chaincode-buildpack:
    Type:       PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
    ClaimName:  chaincode-buildpack
    ReadOnly:   false
  chaincode-package:
    Type:       PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
    ClaimName:  chaincode-package
    ReadOnly:   false
  hlf-artifacts:
    Type:       PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
    ClaimName:  hlf-artifacts
    ReadOnly:   false
  hlf-crypto-config:
    Type:       PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
    ClaimName:  hlf-crypto-config
    ReadOnly:   false
  default-token-qxd4z:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  default-token-qxd4z
    Optional:    false
QoS Class:       BestEffort
Node-Selectors:  <none>
Tolerations:     node.kubernetes.io/not-ready:NoExecute for 300s
                 node.kubernetes.io/unreachable:NoExecute for 300s
Events:
  Type    Reason     Age   From               Message
  ----    ------     ----  ----               -------
  Normal  Scheduled  10m   default-scheduler  Successfully assigned dummy-com/setup-zxx6r to minikube
  Normal  Pulled     10m   kubelet, minikube  Container image "bitnami/git" already present on machine
  Normal  Created    10m   kubelet, minikube  Created container git-clone
  Normal  Started    10m   kubelet, minikube  Started container git-clone

And here is the output of all the services listed under dummy-com namespace:

NAME                                            READY   STATUS             RESTARTS   AGE
pod/chaincode-demo-85c76ccf94-fhk4l             1/1     Running            0          13m
pod/cli.peer0.org1.dummy.com-769dcc8584-xlr2g   1/1     Running            0          13m
pod/cli.peer0.org2.dummy.com-fc5fd8cfc-82rrc    1/1     Running            0          13m
pod/couchdb.org1.dummy.com-fb7fd5d7-njxp5       1/1     Running            0          13m
pod/orderer0.dummy.com-577c57ffc4-g2gx7         0/1     CrashLoopBackOff   7          13m
pod/orderer1.dummy.com-74c79489f6-k9wjf         0/1     CrashLoopBackOff   7          13m
pod/orderer2.dummy.com-548b65c6c4-8trp6         0/1     CrashLoopBackOff   7          13m
pod/peer0.org1.dummy.com-cc6d7f4cd-q6mtk        0/1     CrashLoopBackOff   7          13m
pod/peer0.org2.dummy.com-55fc6cfbc-nwnms        0/1     CrashLoopBackOff   7          13m
pod/peer0.org3.dummy.com-7db7d86c45-vshb6       0/1     CrashLoopBackOff   7          13m
pod/setup-4l9ms                                 0/1     Init:Error         0          15m
pod/setup-6pn69                                 0/1     Init:Error         0          14m
pod/setup-9cm9r                                 0/1     Init:Error         0          10m
pod/setup-fmqn6                                 0/1     Init:Error         0          13m
pod/setup-sclvg                                 0/1     Init:Error         0          15m
pod/setup-zxx6r                                 0/1     Init:Error         0          15m

NAME                                    TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)             AGE
service/chaincode-as-external-service   ClusterIP   10.106.59.210    <none>        9999/TCP            13m
service/couchdb-org1-dummy-com          ClusterIP   10.103.202.229   <none>        5984/TCP            13m
service/orderer0-dummy-com              ClusterIP   10.99.173.182    <none>        7050/TCP            13m
service/orderer1-dummy-com              ClusterIP   10.107.81.177    <none>        7050/TCP            13m
service/orderer2-dummy-com              ClusterIP   10.98.92.61      <none>        7050/TCP            13m
service/ordering-service-dummy-com      ClusterIP   10.103.120.162   <none>        7050/TCP            13m
service/peer0-org1-dummy-com            ClusterIP   10.104.94.102    <none>        7051/TCP,7052/TCP   13m
service/peer0-org2-dummy-com            ClusterIP   10.108.106.249   <none>        7051/TCP,7052/TCP   13m
service/peer0-org3-dummy-com            ClusterIP   10.100.187.74    <none>        7051/TCP,7052/TCP   13m

NAME                                       READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/chaincode-demo             1/1     1            1           13m
deployment.apps/cli.peer0.org1.dummy.com   1/1     1            1           13m
deployment.apps/cli.peer0.org2.dummy.com   1/1     1            1           13m
deployment.apps/couchdb.org1.dummy.com     1/1     1            1           13m
deployment.apps/orderer0.dummy.com         0/1     1            0           13m
deployment.apps/orderer1.dummy.com         0/1     1            0           13m
deployment.apps/orderer2.dummy.com         0/1     1            0           13m
deployment.apps/peer0.org1.dummy.com       0/1     1            0           13m
deployment.apps/peer0.org2.dummy.com       0/1     1            0           13m
deployment.apps/peer0.org3.dummy.com       0/1     1            0           13m

NAME                                                  DESIRED   CURRENT   READY   AGE
replicaset.apps/chaincode-demo-85c76ccf94             1         1         1       13m
replicaset.apps/cli.peer0.org1.dummy.com-769dcc8584   1         1         1       13m
replicaset.apps/cli.peer0.org2.dummy.com-fc5fd8cfc    1         1         1       13m
replicaset.apps/couchdb.org1.dummy.com-fb7fd5d7       1         1         1       13m
replicaset.apps/orderer0.dummy.com-577c57ffc4         1         1         0       13m
replicaset.apps/orderer1.dummy.com-74c79489f6         1         1         0       13m
replicaset.apps/orderer2.dummy.com-548b65c6c4         1         1         0       13m
replicaset.apps/peer0.org1.dummy.com-cc6d7f4cd        1         1         0       13m
replicaset.apps/peer0.org2.dummy.com-55fc6cfbc        1         1         0       13m
replicaset.apps/peer0.org3.dummy.com-7db7d86c45       1         1         0       13m

NAME              COMPLETIONS   DURATION   AGE
job.batch/setup   0/1           15m        15m

Not able to figure out what could be the issue here. Any advise on how to debug and resolve this ?

TommyStarK commented 3 years ago

Hi @anchit93,

Thanks for reporting the issue. It was mainly due to a failure of the git init container before the execution of the setup job. I've updated and tested it, everything is working on my side. Feel free to come back to me if you encounter any issue. best,

anchit93 commented 3 years ago

Thanks @TommyStarK , issue is resolved now.