fabric-ca请求注册失败|织物样品发布-1.4 |余额转移网络

时间:2020-08-25 12:05:24

标签: hyperledger-fabric hyperledger hyperledger-fabric-ca

我正在尝试设置balance-transfer hyperledger fabric network。我已按照README.md中的步骤进行操作。运行./runApp.sh时,出现以下错误。

Creating network "artifacts_default" with the default driver
Pulling ca.org1.example.com (hyperledger/fabric-ca:)...
ERROR: manifest for hyperledger/fabric-ca:latest not found: manifest unknown: manifest unknown

执行以下步骤后,解决了该问题。

docker pull hyperledger/fabric-ca:x86_64-1.1.0-preview 
docker tag hyperledger/fabric-ca:x86_64-1.1.0-preview hyperledger/fabric-ca:latest
docker pull hyperledger/fabric-orderer:x86_64-1.1.0-preview 
docker tag hyperledger/fabric-orderer:x86_64-1.1.0-preview hyperledger/fabric-orderer:latest
docker pull hyperledger/fabric-peer:x86_64-1.1.0-preview
docker tag hyperledger/fabric-peer:x86_64-1.1.0-preview hyperledger/fabric-peer:latest

在此步骤之后,./runApp.sh命令成功。运行./testAPIs.sh -l golang时,我在REST Server中收到以下错误。

[2020-08-25 09:08:41.463] [ERROR] Helper - Failed to get registered user: Barry with error: Error: fabric-ca request register failed with errors [[ { code: 20, message: 'Authorization failure' } ]]
[2020-08-25 09:08:41.463] [DEBUG] SampleWebApp - -- returned from registering the username Barry for organization Org2
[2020-08-25 09:08:41.463] [DEBUG] SampleWebApp - Failed to register the username Barry for organization Org2 with::failed Error: fabric-ca request register failed with errors [[ { code: 20, message: 'Authorization failure' } ]]
UnauthorizedError: jwt malformed
    at /var/www/html/fabric-samples/balance-transfer/node_modules/express-jwt/lib/index.js:102:22
    at Object.module.exports [as verify] (/var/www/html/fabric-samples/balance-transfer/node_modules/express-jwt/node_modules/jsonwebtoken/verify.js:63:12)
    at verifyToken (/var/www/html/fabric-samples/balance-transfer/node_modules/express-jwt/lib/index.js:100:13)
    at fn (/var/www/html/fabric-samples/balance-transfer/node_modules/async/lib/async.js:746:34)
    at /var/www/html/fabric-samples/balance-transfer/node_modules/async/lib/async.js:1213:16
    at /var/www/html/fabric-samples/balance-transfer/node_modules/async/lib/async.js:166:37
    at /var/www/html/fabric-samples/balance-transfer/node_modules/async/lib/async.js:706:43
    at /var/www/html/fabric-samples/balance-transfer/node_modules/async/lib/async.js:167:37
    at Immediate._onImmediate (/var/www/html/fabric-samples/balance-transfer/node_modules/async/lib/async.js:1206:34)
    at runCallback (timers.js:810:20)

我在fabric-ca中遇到以下错误。

2020/08/25 09:08:41 [INFO] 172.29.0.1:57476 POST /api/v1/enroll 200 0 "OK"
2020/08/25 09:08:41 [DEBUG] Received request for /api/v1/register
2020/08/25 09:08:41 [DEBUG] Received registration request from : { Name:Barry Type: Secret:**** MaxEnrollments:1 Affiliation:org2.department1 Attributes:[] CAName:ca-org2  }
2020/08/25 09:08:41 [DEBUG] Sent error for /api/v1/register: scode: 401, local code: 25, local msg: Invalid token in authorization header: Token signature validation failed, remote code: 20, remote msg: Authorization failure

github.com/hyperledger/fabric-ca/lib.newAuthErr
    /opt/gopath/src/github.com/hyperledger/fabric-ca/lib/servererror.go:145
github.com/hyperledger/fabric-ca/lib.(*serverRequestContext).TokenAuthentication
    /opt/gopath/src/github.com/hyperledger/fabric-ca/lib/serverrequestcontext.go:129
github.com/hyperledger/fabric-ca/lib.registerHandler
    /opt/gopath/src/github.com/hyperledger/fabric-ca/lib/serverregister.go:49
github.com/hyperledger/fabric-ca/lib.(*serverEndpoint).ServeHTTP
    /opt/gopath/src/github.com/hyperledger/fabric-ca/lib/serverendpoint.go:44
net/http.(*ServeMux).ServeHTTP
    /opt/go/src/net/http/server.go:2254
net/http.serverHandler.ServeHTTP
    /opt/go/src/net/http/server.go:2619
net/http.(*conn).serve
    /opt/go/src/net/http/server.go:1801
runtime.goexit
    /opt/go/src/runtime/asm_amd64.s:2337
2020/08/25 09:08:41 [INFO] 172.29.0.1:57480 POST /api/v1/register 401 25 "Invalid token in authorization header: Token signature validation failed"

请帮助我解决此问题。

1 个答案:

答案 0 :(得分:2)

这里的问题很少出现:

  1. 您正在使用3岁的number版本。但是在您提到的问题中,您使用的是hyperledger-fabric。检查here您的版本信息。
  2. 您可以将v1.41.4.8ca的标记peer代替orderer
  3. x86_64-1.1.0-preview标签具有误导性,因为现在有两个Hyperledger-fabric版本,即latestfabric:v2.x。因此,更好的方法是使用特定标签而不是fabric:v1.4.x