Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to enroll admin user + Error: Calling enrollment endpoint failed #84

Open
cgironda opened this issue Jul 29, 2019 · 5 comments
Open

Comments

@cgironda
Copy link

cgironda commented Jul 29, 2019

Hi,

Thanks to read this issue.

Behind a proxi correctly configured and under the following configuration:
node -v: v8.16.0 or v10.16.0
npm -v: v6.9.0

I executed the Step 9. Enroll App Admin Identities, of the tutorial:

https://github.com/IBM/build-blockchain-insurance-app#step-9-enroll-app-admin-identities

obtaining the error below:

Wallet path: /Users/$USER/Documents/IBM_Blockchain/build-blockchain-insurance-app/web/www/blockchain/wallet 
2019-07-26T07:21:30.855Z - error: [FabricCAClientService.js]: Failed to enroll insuranceApp-admin, error:%o message=Calling enrollment endpoint failed with error [Error: connect ETIMEDOUT 169.60.31.202:7054], stack=Error: Calling enrollment endpoint failed with error [Error: connect ETIMEDOUT 169.60.31.202:7054] at ClientRequest.request.on (/Users/$USER/Documents/IBM_Blockchain/build-blockchain-insurance-app/web/node_modules/fabric-ca-client/lib/FabricCAClient.js:487:12) 
at emitOne (events.js:116:13) at ClientRequest.emit (events.js:211:7) 
at TLSSocket.socketErrorListener (_http_client.js:387:9) at emitOne (events.js:116:13) 
at TLSSocket.emit (events.js:211:7) at emitErrorNT (internal/streams/destroy.js:64:8) 
at _combinedTickCallback (internal/process/next_tick.js:138:11) 
at process._tickCallback (internal/process/next_tick.js:180:9) 
Failed to enroll admin user ' + insuranceApp-admin + : Error: Calling enrollment endpoint failed with error [Error: connect ETIMEDOUT 169.60.31.202:7054] 

This error seems to appear when docker "containers are not available", but please can you confirm that issue?.

Thank you

@horeaporutiu
Copy link
Contributor

horeaporutiu commented Jul 30, 2019

@cgironda please make sure to follow the prerequisites as shown in the instructions:

Node.js - Node v8.9.x. While this error is likely unrelated to the node version, please do make sure you are using Node version 8.9.x since that is what this pattern has been tested with.

The error you are facing is likely because:

  1. The caName, orgMSPID, appAdmin, or appAdminSecret in the config.json file is wrong https://github.com/IBM/build-blockchain-insurance-app/blob/master/web/www/blockchain/config.json#L6. Double-check that you have downloaded the connection profile from IBM Blockchain Platform, and have overwritten the ibpConnection.json file, as shown in the last part of step 8 here: https://github.com/IBM/build-blockchain-insurance-app#update-application-connection

Furthermore, make sure the caName, orgMSPID, appAdmin, appAdminSecret in your config.json is exactly written as shown in your downloaded ibpConnection.json file. That should solve the issue.

If you are still running into the same issue, it could be the way that you have built your network maybe incorrect. Please let me know if this fixes it.

@horeaporutiu
Copy link
Contributor

when you are running enrollAdmin.js, you are referencing the kubernetes cluster nodes that you have deployed as part of https://github.com/IBM/build-blockchain-insurance-app#step-1-create-ibm-cloud-services

So make sure you are referencing the correct URLs to the cluster, and each time you enroll a different appAdmin, you will need to update the config.json file, as shown in the gifs in step 9.

@cgironda
Copy link
Author

cgironda commented Jul 31, 2019

@horeaporutiu , thanks for your reply.

As you mentioned, this error is likely unrelated to the node version. However, I changed it to node v8.9.4 without any changes in the output, where I followed the prerequisites of the https://github.com/IBM/build-blockchain-insurance-app tutorial

The steps below summarize the process I followed in the tutorial:

  1. The IBM Blockchain Network was built according to the prerequisites of the STEP 1.
  2. In order to enroll the "appAdmin": "insuranceApp-admin" in the config.json file, I replaced the value of the caName directive with the value of certificateAuthorities given in the ipbConnection.json file, where I previously replaced its contents using the mychannel_insurance_profile.json file, as shown in the STEP 8.
  3. After executing the command node enrollAdmin.js inside the web/www/blockchain folder, I obtained the following output:
Wallet path: /Users/$USER/Documents/IBM_Blockchain/build-blockchain-insurance-app/web/www/blockchain/wallet
2019-07-31T02:58:10.589Z - error: [FabricCAClientService.js]: Failed to enroll insuranceApp-admin, error:%o message=Calling enrollment endpoint failed with error [Error: connect ETIMEDOUT 169.60.31.202:7054], stack=Error: Calling enrollment endpoint failed with error [Error: connect ETIMEDOUT 169.60.31.202:7054]
    at ClientRequest.request.on (/Users/cgironda/Documents/IBM_Blockchain/build-blockchain-insurance-app/web/node_modules/fabric-ca-client/lib/FabricCAClient.js:487:12)
    at ClientRequest.emit (events.js:198:13)
    at TLSSocket.socketErrorListener (_http_client.js:392:9)
    at TLSSocket.emit (events.js:198:13)
    at emitErrorNT (internal/streams/destroy.js:91:8)
    at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
    at process._tickCallback (internal/process/next_tick.js:63:19)
Failed to enroll admin user ' + insuranceApp-admin + : Error: Calling enrollment endpoint failed with error [Error: connect ETIMEDOUT 169.60.31.202:7054]

The best of all is that I followed the same process at home, and everything works well. I was wondering why this process does not work in my workplace if I have the same MacOS version with all the prerequisites satisfied in both machines, i.e., same configuration.

I built the IBM Blockchain Network in my workplace, and I used the JSON files that I downloaded to recover the identities in the wallet when I opened the IBM Blockchain console in my computer at home.

I started to think that the proxy configuration in my job would be causing the problem. Maybe I have to tell my network not to use proxy with some hosts.

Anyways, the connect ETIMEDOUT error that I obtained after executing node enrollAdmin.js, is usually a problem related to the connectivity of the network. However, maybe the problem is easier to solve than I think.

If you can give me a hand on this would be great. Thank you.

@horeaporutiu
Copy link
Contributor

horeaporutiu commented Aug 1, 2019

could you try something out for me?

Go ahead and create a new insurance app-admin identity from your insurance CA. This will be the same step as this one: https://github.com/IBM/build-blockchain-insurance-app#create-insurance-application-admin except you will want to create a new enroll ID and enroll secret, such as the following.

Enroll ID: insuranceApp-admin2
Enroll Secret: insuranceApp-admin2pw

Make sure to add the atrribute hf.Registrar.Roles = * as shown in the instructions. Next,
try and run the enrollAdmin.js script but go ahead and update the config.json to reflect the newly created insuranceApp-admin2 identity.

So your updated config.json should look like this, before you run the enrollAdmin.js script:

{
  "connection_file": "ibpConnection.json",
  "appAdmin": "insuranceApp-admin2",
  "appAdminSecret": "insuranceApp-admin2pw",
  "orgMSPID": "insurancemsp",
  "caName": "https://124b79efa8f5xxxxxx394edac7b5-ca081cbf.horea-blockchain-32x32xp.us-south.containers.appdomain.cloud:7054",
  "userName": "insuranceUser",
  "gatewayDiscovery": { "enabled": true, "asLocalhost": false }
}

If this does not work, then this is likely a problem with the network.

@cgironda
Copy link
Author

cgironda commented Aug 6, 2019

Hi @horeaporutiu,

Sorry for the delay in this reply. I followed your steps above without success, but I should make a final confirmation this Thursday (8/8) with a different network.

In the meanwhile, I was wondering if you can guide me to tell my network not to use the proxy for certain hosts used to run the docker images in the tutorial.

In order to have a better picture of what I am asking, please check the link below: https://stackoverflow.com/questions/57194706/using-vs-code-extension-containers-doesnt-run-for-the-hyperledger-fabric

Any help would be highly appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants