hyperledger-labs / minifabric

Do fabric network the right and easy way.
Apache License 2.0
301 stars 164 forks source link

Failed to get client due to HTTPSConnectionPool when trying to setup network on azure k8s #306

Open ajojose11 opened 2 years ago

ajojose11 commented 2 years ago

Minifab Execution Context: FABRIC_RELEASE=2.3.0 CHANNEL_NAME=mychannel PEER_DATABASE_TYPE=golevel CHAINCODE_LANGUAGE=go CHAINCODE_NAME=simple CHAINCODE_VERSION=1.0 CHAINCODE_INIT_REQUIRED=true CHAINCODE_PARAMETERS="init","a","200","b","300" CHAINCODE_PRIVATE=false CHAINCODE_POLICY= TRANSIENT_DATA= BLOCK_NUMBER=newest EXPOSE_ENDPOINTS=true CURRENT_ORG=service.payment.net HOST_ADDRESSES=172.31.25.31 WORKING_DIRECTORY: /home/ubuntu/minifabric

`Preparing for the following operations: ***** verify options, download images, generate certificates, start network, network status ....... Running operation: ** verify options . Running operation: ** download images .... Running operation: ** generate certificates .. Running operation: ** start network ........ Deploy all nodes and their service ** Failed to get client due to HTTPSConnectionPool(host='hgf-worksh-hgf-workshop-beb0d1-ae9bf14b.hcp.northeurope.azmk8s.io', port=443): Max retries exceeded with url: /version (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fd891f4be50>: Failed to establish a new connection: [Errno -3] Try again'))

STATS *** minifab: ok=38 failed=1

real 0m30.508s user 0m11.047s sys 0m1.806s`

litong01 commented 2 years ago

Seems minifabric cannot establish connections with your k8s. Please make sure the kube config file , possibly certs file if used are also in the right location. Once this issue is resolved, you should be on your way.

ajojose11 commented 2 years ago

@litong01 kubeconfig file is generated and placed under vars directory. I can access the cluster using kubectl. That means there is no problem with the kubeconfig file right?. all the certs data are directly specified in the kubeconfig. There is no file path given.

kubeconfig/config

apiVersion: v1 clusters:

litong01 commented 2 years ago

@ajojose11, you can start up a minifabric container by following the script but not to execute any particular command other than do a sleep, then you can exec to the container and run a simple test playbook to see if you can access k8s. That is normally what I do to resolve this type of issues. Each k8s always have something a bit differently.

ajojose11 commented 2 years ago

@litong01 i fixed the connection issue. I think it was version issue for python library 'kubernetes'. Now I am getting another error

Patch nginx ingress controller **

Deployment ingress-nginx-controller: Failed to create object: b'{"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"Deployment.apps \"ingress-nginx-controller\" is invalid: [spec.selector: Required value, spec.template.metadata.labels: Invalid value: map[string]string(nil): selector does not match template labels, spec.template.spec.containers[0].image: Required value]","reason":"Invalid","details":{"name":"ingress-nginx-controller","group":"apps","kind":"Deployment","causes":[{"reason":"FieldValueRequired","message":"Required value","field":"spec.selector"},{"reason":"FieldValueInvalid","message":"Invalid value: map[string]string(nil): selector does not match template labels","field":"spec.template.metadata.labels"},{"reason":"FieldValueRequired","message":"Required value","field":"spec.template.spec.containers[0].image"}]},"code":422}\n'

litong01 commented 2 years ago

@ajojose11 you need to setup nginx ingress controller first to be able to expose endpoints, without doing that, your nodes can not be accessed from outside your cluster. I believe that the document actually said you need to setup ingress controller first.

ajojose11 commented 2 years ago

@litong01 I fixed the issue. I had already setup the ingress controller before the error. The actual problem was when I setup the controller, the namespace for it was different than mentioned in the yaml file to apply patch. i changed that and build a new image for minifabric from the repo. Now its all working fine for AKS. Now I am trying to do in EKS

litong01 commented 2 years ago

Hmmm, could be because you are using a newer version of ingress controller? If that is the case, can you put up a pr so that some older versions and newer version all be supported? I thought we are search it using labels, I could remember wrong.

ajojose11 commented 2 years ago

@litong01 i dont know if this is the case for all scenarios. when i installed ngin controller for eks it was the same namespace. don't know if it was done by mistake or so

ajojose11 commented 2 years ago

@litong01 for eks, the kubeconfig is coming way different that for AKS. Its causing some issues in authentication for kube API server. is there any guide for setting up the cluster in eks and giving the proper IAM roles

litong01 commented 2 years ago

@ajojose11 i do not have a EKS that I can try. I know that it is a bit different but can you please search for examples on how to use ansible to access EKS?

ajojose11 commented 2 years ago

@litong01 i will surely do that

litong01 commented 2 years ago

@ajojose11 Thanks a lot for using the tool and willing to contribute.

koushikmgithub commented 2 years ago

@ajojose11 - I am also facing the same issue when I am trying to deploy minifab on kind cluster. I am using ubuntu 20.04 for my kind cluster. Can you please let me know which version of python-kubenetes you have used ? I tried with almost all versions but no luck.

koushik@ubuntu-20:~/mywork$ ./minifab up -e true Using spec file: /home/koushik/mywork/spec.yaml Minifab Execution Context: FABRIC_RELEASE=2.3.0 CHANNEL_NAME=mychannel PEER_DATABASE_TYPE=golevel CHAINCODE_LANGUAGE=go CHAINCODE_NAME=simple CHAINCODE_VERSION=1.0 CHAINCODE_INIT_REQUIRED=true CHAINCODE_PARAMETERS="init","a","200","b","300" CHAINCODE_PRIVATE=false CHAINCODE_POLICY= TRANSIENT_DATA= BLOCK_NUMBER=newest EXPOSE_ENDPOINTS=true CURRENT_ORG=org0.example.com HOST_ADDRESSES=10.0.2.15 WORKING_DIRECTORY: /home/koushik/mywork .......

Preparing for the following operations: *****

verify options, download images, generate certificates, start network, network status, channel create, channel join, anchor update, profile generation, cc install, cc approve, cc commit, cc initialize, discover .......

Running operation: **

verify options .

Running operation: **

download images ....

Running operation: **

generate certificates ..

Running operation: **

start network ........

Deploy all nodes and their service **

Failed to get client due to HTTPSConnectionPool(host='127.0.0.1', port=35119): Max retries exceeded with url: /version (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f2fff76ab20>: Failed to establish a new connection: [Errno 111] Connection refused'))

STATS ***

minifab: ok=47 failed=1

real 0m10.550s user 0m8.425s sys 0m2.078s koushik@ubuntu-20:~/mywork$

ajojose11 commented 2 years ago

@koushikmgithub i am using kubernetes version 20.13.0

rupam150 commented 2 years ago

Hi @litong01 do minifab support typescript chaincode deployment ?????

litong01 commented 2 years ago

Sorry for the late response. It does support node.js chaincode. Not really sure if it supports typescript. Thanks

Sent from my iPhone

On May 13, 2022, at 2:42 AM, rupam150 @.***> wrote:

 Hi @litong01 do minifab support typescript chaincode deployment ????? — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: <hyperledger-labs/minifabric/issues/306/1125709069 ZjQcmQRYFpfptBannerStart This Message Is From an External Sender This message came from outside your organization.

ZjQcmQRYFpfptBannerEnd

Hi @litong01https://github.com/litong01 do minifab support typescript chaincode deployment ?????

— Reply to this email directly, view it on GitHubhttps://github.com/hyperledger-labs/minifabric/issues/306#issuecomment-1125709069, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAO2NS33DF2YIVHATDKRO5DVJX2VHANCNFSM5JVRGKUA. You are receiving this because you were mentioned.Message ID: @.***>