[英]Failed to enroll admin, error:%o message=Calling enroll endpoint failed, CONNECTION Timeout
I am running my fabric network on kubernetes and I have setup ca servers for all the organisations.我在 kubernetes 上运行我的结构网络,并且我已经为所有组织设置了 ca 服务器。 I am able to register and enroll the user from the cli but when i am using the fabric-ca-client library with nodejs to register and enroll the users.我可以从 cli 注册和注册用户,但是当我使用带有nodejs的fabric-ca-client库来注册和注册用户时。 I am facing the CONNECTION Timeout issue, also at the same time if I look at the logs of my ca-server it show that is able to process the request.我正面临 CONNECTION Timeout 问题,同时如果我查看我的 ca-server 的日志,它显示能够处理请求。 Edit1: I am using the same code provided in fabric-sample to register and enroll the users. Edit1:我正在使用 fabric-sample 中提供的相同代码来注册和注册用户。
All the all the pods are communicating with each other using these services in kubernetes所有的 pod 都使用 kubernetes 中的这些服务相互通信
this is how my connection profile looks这就是我的连接配置文件的样子
"certificateAuthorities": {
"ca-org2": {
"url": "https://ca-org2:8054",
"caName": "ca-org2",
"tlsCACerts": {
"pem": ["-----BEGIN CERTIFICATE-----\nMIICBjCCAa2gAwIBAgIUHwBYatG6KhezYWHxdGgYGqs77PIwCgYIKoZIzj0EAwIw\nYDELMAkGA1UEBhMCVUsxEjAQBgNVBAgTCUhhbXBzaGlyZTEQMA4GA1UEBxMHSHVy\nc2xleTEZMBcGA1UEChMQb3JnMi5leGFtcGxlLmNvbTEQMA4GA1UEAxMHY2Etb3Jn\nMjAeFw0yMTAzMjAxMDI4MDBaFw0zNjAzMTYxMDI4MDBaMGAxCzAJBgNVBAYTAlVL\nMRIwEAYDVQQIEwlIYW1wc2hpcmUxEDAOBgNVBAcTB0h1cnNsZXkxGTAXBgNVBAoT\nEG9yZzIuZXhhbXBsZS5jb20xEDAOBgNVBAMTB2NhLW9yZzIwWTATBgcqhkjOPQIB\nBggqhkjOPQMBBwNCAAQUIABkRhfPdwoy2QrCY3oh8ZuzP5OprZJawVXO2ojid3j4\nC9W4l46QXR5J7iG5MLczguPZWB9dZWygRQdUQeoAo0UwQzAOBgNVHQ8BAf8EBAMC\nAQYwEgYDVR0TAQH/BAgwBgEB/wIBATAdBgNVHQ4EFgQURx/h3nkH0fq+3TlRPnQW\nWTHbR7YwCgYIKoZIzj0EAwIDRwAwRAIgCF+vcLFERb+VHa6Att0rh5yhpMd0bHEn\nmkNo0YfKuX4CICodtpp6AKtNWXreskaN+kRMH8eDmwvxkhvTK68ejv8U\n-----END CERTIFICATE-----\n"]
},
"httpOptions": {
"verify": false
}
}
}
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.该问题与连接超时有关,我的 CA 服务器正在接收请求并能够处理它们,但由于超时时间短,请求被取消。 The solution was to increase the connection timeout
and request-timeout
.解决方案是增加connection timeout
和request-timeout
。 The default value of timeouts is 3s and I increased it to 30s and it started working.超时的默认值为 3 秒,我将其增加到 30 秒并开始工作。 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.我们可以从 fabric-ca-client 库的源代码中更新超时值,也可以像这样简单地使用fabric-common
库的方法来更新这些配置值。
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
这是我们修改后的配置文件config.json
{
"request-timeout" : 30000,
"tcert-batch-size" : 10,
"crypto-hash-algo": "SHA2",
"crypto-keysize": 256,
"crypto-hsm": false,
"connection-timeout": 30000
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.