Failed to enroll admin, error:%o message=Calling enroll endpoint failed, CONNECTION Timeout Failed to enroll admin, error:%o message=Calling enroll endpoint failed, CONNECTION Timeout kubernetes kubernetes

Failed to enroll admin, error:%o message=Calling enroll endpoint failed, CONNECTION Timeout


I found the solution to this issue. The issue was related to the connection timeout, my CA Server was receving the requests and able to process them also but due to the short timeout the request was being cancelled. The solution was to increase the connection timeout and request-timeout. The default value of timeouts is 3s and I increased it to 30s and it started working. The default configuration can be found here

{    "request-timeout" : 3000,    "tcert-batch-size" : 10,    "crypto-hash-algo": "SHA2",    "crypto-keysize": 256,    "crypto-hsm": false,    "connection-timeout": 3000}

we can update the timeout values from source code of the fabric-ca-client library or simply can use the methods of fabric-common library to update the these configuration values like this.

const { Utils: utils } = require('fabric-common');const path=require('path');let config=utils.getConfig()config.file(path.resolve(__dirname,'config.json'))

And here is our modified configuration file config.json

  {  "request-timeout" : 30000,  "tcert-batch-size" : 10,  "crypto-hash-algo": "SHA2",  "crypto-keysize": 256,  "crypto-hsm": false,  "connection-timeout": 30000  }