HyperledgerHandsOn / trade-finance-logistics

Trade Finance and Logistics based on Letter of Credit and Proof of Shipment

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Handshake failed with fatal error SSL_ERROR_SSL when "node createTradeApp.js"

linboosted opened this issue · comments

trade-finance-logistics.txt

i think i did everything by the book. and all the docker images are booted up. it looks somethings is wrong with "grpc".
@VRamakrishnaSG @ldesrosi @VRamakrishna .
would you have time to take a look? thanks.

david@vultr:~/go/src/github.com/HyperledgerHandsOn/trade-finance-logistics/middleware$ node createTradeApp.js
info: [ClientUtils]:



  • Using temp dir: ../network/client-certs


Successfully extracted the config update from the configtx envelope
Successfully enrolled user 'admin' for exporterorg
Successfully signed config as admin of exporterorg
Successfully enrolled user 'admin' for importerorg
Successfully signed config as admin of importerorg
Successfully enrolled user 'admin' for carrierorg
Successfully signed config as admin of carrierorg
Successfully enrolled user 'admin' for regulatororg
Successfully signed config as admin of regulatororg
Successfully enrolled user 'admin' for every org and obtained channel config signatures
Successfully enrolled user 'admin' for orderer
E0813 12:47:56.621132313 1047 ssl_transport_security.cc:989] Handshake failed with fatal error SSL_ERROR_SSL: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed.
E0813 12:47:56.622324127 1047 ssl_transport_security.cc:989] Handshake failed with fatal error SSL_ERROR_SSL: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed.
E0813 12:47:57.619572743 1047 ssl_transport_security.cc:989] Handshake failed with fatal error SSL_ERROR_SSL: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed.
E0813 12:47:57.621801726 1047 ssl_transport_security.cc:989] Handshake failed with fatal error SSL_ERROR_SSL: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed.
E0813 12:47:59.177523755 1047 ssl_transport_security.cc:989] Handshake failed with fatal error SSL_ERROR_SSL: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed.
E0813 12:47:59.202896378 1047 ssl_transport_security.cc:989] Handshake failed with fatal error SSL_ERROR_SSL: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed.
error: [Remote.js]: Error: Failed to connect before the deadline
Channel tradechannel does not exist yet (IGNORE ANY ORDERER ERROR MESSAGES YOU SEE ABOVE!!)
Successfully signed config update as orderer admin
E0813 12:47:59.627329201 1047 ssl_transport_security.cc:989] Handshake failed with fatal error SSL_ERROR_SSL: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed.
E0813 12:47:59.628230501 1047 ssl_transport_security.cc:989] Handshake failed with fatal error SSL_ERROR_SSL: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed.
E0813 12:48:00.626588160 1047 ssl_transport_security.cc:989] Handshake failed with fatal error SSL_ERROR_SSL: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed.
E0813 12:48:00.628050390 1047 ssl_transport_security.cc:989] Handshake failed with fatal error SSL_ERROR_SSL: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed.
E0813 12:48:01.487173379 1047 ssl_transport_security.cc:989] Handshake failed with fatal error SSL_ERROR_SSL: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed.
E0813 12:48:01.487986774 1047 ssl_transport_security.cc:989] Handshake failed with fatal error SSL_ERROR_SSL: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed.
E0813 12:48:01.975820887 1047 ssl_transport_security.cc:989] Handshake failed with fatal error SSL_ERROR_SSL: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed.
E0813 12:48:02.007195176 1047 ssl_transport_security.cc:989] Handshake failed with fatal error SSL_ERROR_SSL: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed.
error: [Remote.js]: Error: Failed to connect before the deadline
error: [Orderer.js]: Orderer grpcs://localhost:7050 has an error Error: Failed to connect before the deadline


CHANNEL CREATION FAILED: Error: Error: Error: Failed to connect before the deadline
at checkState (/home/david/go/src/github.com/HyperledgerHandsOn/trade-finance-logistics/middleware/node_modules/grpc/src/client.js:838:16)
at Client.newDefaultKeyValueStore.then.then.then.then.then (/home/david/go/src/github.com/HyperledgerHandsOn/trade-finance-logistics/middleware/create-channel.js:177:9)
at process._tickCallback (internal/process/next_tick.js:68:7)
at Client.newDefaultKeyValueStore.then.then.then.then.then.then (/home/david/go/src/github.com/HyperledgerHandsOn/trade-finance-logistics/middleware/create-channel.js:182:9)
at process._tickCallback (internal/process/next_tick.js:68:7)

trade-finance-logistics

Can you run npm list | grep grpc from the middleware folder to see what version you are running? It may be that the grpc library has evolved since we build and tested this code. My code runs fine with version 1.10.1, so if you are running a newer version, I'd try reverting and retrying (run npm install grpc@1.10.1 within the same folder.)

Just for verification:

  • Did you clone the release-1.1 branch of fabric and fabric-ca?
  • Did you install version 1.1.x of fabric-client and fabric-ca-client? (Run npm list | grep <package-name> to check)

david@vultr:/go/src/github.com/HyperledgerHandsOn/trade-finance-logistics/middleware$ sudo npm list | grep grpc
│ ├─┬ grpc@1.10.1
david@vultr:
/go/src/github.com/HyperledgerHandsOn/trade-finance-logistics/middleware$ sudo npm list | grep fabric
├─┬ fabric-ca-client@1.1.2
├─┬ fabric-client@1.2.1
david@vultr:/go/src/github.com/HyperledgerHandsOn/trade-finance-logistics/middleware$ sudo npm list | grep fabric-ca
├─┬ fabric-ca-client@1.1.2
david@vultr:
/go/src/github.com/HyperledgerHandsOn/trade-finance-logistics/middleware$
trade-finance-logistics

hi:
here is what i have.

is it happens because the wrong fabric version?

Yes, the code isn't going to work with the current default version of Fabric, which is 1.2. When we were writing the chapters, the default was 1.1. The newer version was only released after the book's publication.

From what I see above, you need to downgrade fabric-client to 1.1.2 (match it with fabric-ca-client.) Also make sure your fabric and fabric-ca code bases (which you built your images from) are on the right branch.

hi:
this time i config the whole thing right, but it came with something else:
david@vultr:~/go/src/github.com/HyperledgerHandsOn/trade-finance-logistics/middleware$ node createTradeApp.js
info: [ClientUtils]:



  • Using temp dir: ../network/client-certs


Successfully extracted the config update from the configtx envelope
Successfully enrolled user 'admin' for exporterorg
Successfully signed config as admin of exporterorg
Successfully enrolled user 'admin' for importerorg
Successfully signed config as admin of importerorg
Successfully enrolled user 'admin' for carrierorg
Successfully signed config as admin of carrierorg
Successfully enrolled user 'admin' for regulatororg
Successfully signed config as admin of regulatororg
Successfully enrolled user 'admin' for every org and obtained channel config signatures
Successfully enrolled user 'admin' for orderer
E0813 17:42:51.020520926 1019 ssl_transport_security.cc:989] Handshake failed with fatal error SSL_ERROR_SSL: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed.
E0813 17:42:51.021594973 1019 ssl_transport_security.cc:989] Handshake failed with fatal error SSL_ERROR_SSL: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed.
error: [Orderer.js]: sendDeliver - on error code 14: "Error: 14 UNAVAILABLE: Connect Failed\n at createStatusError (/home/david/go/src/github.com/HyperledgerHandsOn/trade-finance-logistics/middleware/node_modules/grpc/src/client.js:64:15)\n at ClientDuplexStream._emitStatusIfDone (/home/david/go/src/github.com/HyperledgerHandsOn/trade-finance-logistics/middleware/node_modules/grpc/src/client.js:270:19)\n at ClientDuplexStream._readsDone (/home/david/go/src/github.com/HyperledgerHandsOn/trade-finance-logistics/middleware/node_modules/grpc/src/client.js:236:8)\n at readCallback (/home/david/go/src/github.com/HyperledgerHandsOn/trade-finance-logistics/middleware/node_modules/grpc/src/client.js:296:12)"
Channel tradechannel does not exist yet (IGNORE ANY ORDERER ERROR MESSAGES YOU SEE ABOVE!!)
Successfully signed config update as orderer admin
E0813 17:42:51.040101098 1019 ssl_transport_security.cc:989] Handshake failed with fatal error SSL_ERROR_SSL: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed.
E0813 17:42:51.041107925 1019 ssl_transport_security.cc:989] Handshake failed with fatal error SSL_ERROR_SSL: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed.
error: [Orderer.js]: sendBroadcast - on error: "Error: 14 UNAVAILABLE: Connect Failed\n at createStatusError (/home/david/go/src/github.com/HyperledgerHandsOn/trade-finance-logistics/middleware/node_modules/grpc/src/client.js:64:15)\n at ClientDuplexStream._emitStatusIfDone (/home/david/go/src/github.com/HyperledgerHandsOn/trade-finance-logistics/middleware/node_modules/grpc/src/client.js:270:19)\n at ClientDuplexStream._readsDone (/home/david/go/src/github.com/HyperledgerHandsOn/trade-finance-logistics/middleware/node_modules/grpc/src/client.js:236:8)\n at readCallback (/home/david/go/src/github.com/HyperledgerHandsOn/trade-finance-logistics/middleware/node_modules/grpc/src/client.js:296:12)"


CHANNEL CREATION FAILED: Error: Error: Error: SERVICE_UNAVAILABLE
at ClientDuplexStream. (/home/david/go/src/github.com/HyperledgerHandsOn/trade-finance-logistics/middleware/node_modules/fabric-client/lib/Orderer.js:136:21)
at ClientDuplexStream.emit (events.js:182:13)
at ClientDuplexStream._emitStatusIfDone (/home/david/go/src/github.com/HyperledgerHandsOn/trade-finance-logistics/middleware/node_modules/grpc/src/client.js:271:12)
at ClientDuplexStream._readsDone (/home/david/go/src/github.com/HyperledgerHandsOn/trade-finance-logistics/middleware/node_modules/grpc/src/client.js:236:8)
at readCallback (/home/david/go/src/github.com/HyperledgerHandsOn/trade-finance-logistics/middleware/node_modules/grpc/src/client.js:296:12)
at Client.newDefaultKeyValueStore.then.then.then.then.then (/home/david/go/src/github.com/HyperledgerHandsOn/trade-finance-logistics/middleware/create-channel.js:177:9)
at process._tickCallback (internal/process/next_tick.js:68:7)
at Client.newDefaultKeyValueStore.then.then.then.then.then.then (/home/david/go/src/github.com/HyperledgerHandsOn/trade-finance-logistics/middleware/create-channel.js:182:9)
at process._tickCallback (internal/process/next_tick.js:68:7)

middleware_0
middleware_2

one thing i have to mention.
the very first time of running "node createTradeApp.js" failed.
as the image below shows.
after i ran "npm build", the problem of the last page appared.
middleware

Not sure what exactly is messed up. To restart cleanly, do the following:

  • Set the versions of both fabric-client and fabric-ca-client in middleware/package.json to "1.1.2" (no ~ or ^)
  • Delete the folder middleware/node_modules
  • Run npm install within middleware
  • Also clean up your network to start from scratch:
    • Delete client_certs, channel-artifacts, crypto-config folders in network
    • Run ./trade.sh generate -c tradechannel within network to generate the channel and crypto material
    • Run ./trade.sh up to start the network
  • Now run the middleware scripts again

seems still can't heat it up.
middleware_4

The errors I see above are certificate verification errors, which may occur because of stale certificates. The steps I outlined above to clean up and restart really ought to work, unless you missed a step or changed some configuration (note that there are configuration files in both the network and middleware folders that contain settings which need to match.) FYI, I just retried the same set of instructions on my setup and it worked as expected. I checked to ensure that I have the right versions of the npm packages.

I don't have any other advice other than to make sure you've done a proper cleanup and that you have followed the steps using the right configurations. Sorry!

Sorry, I don't have the time to check out setups on an individual basis. I can just offer somewhat generalized advice, and clues to help you debug.

Also, it's very bad practice to share passwords (especially for root access) on public forums. So please change your passwords so your machines don't get hacked into!

For more help, you can subscribe to https://lists.hyperledger.org/g/fabric. A lot of people hang out there, and it's likely some of them have experienced the exact error you are seeing, and found ways around it.

Just to confirm, you did clone and build the following branches of the source code, right? (I mentioned this above. Don't use the default, which is release-1.2):

https://github.com/hyperledger/fabric/tree/release-1.1
https://github.com/hyperledger/fabric-ca/tree/release-1.1

yes.
i cloned both by [-b release-1.1]
anyway, thanks for your time.
greate book.

One of the reasons is using unsuitable node version.
To add the Long Term Support (LTS) subversion of Node.js v8, we can use these commands:

curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
source ~/.profile 
nvm ls-remote
nvm install v8.16.0
nvm list
nvm use v8.16.0
node --version

I think this error has been dealt with in other issues. Check out the Wiki for links.

This should not have anything to do with the Node version. I've been running this with Node v9.8.0 (npm version 5.7.1) and don't see any issues.

I think this error has been dealt with in other issues. Check out the Wiki for links.

This should not have anything to do with the Node version. I've been running this with Node v9.8.0 (npm version 5.7.1) and don't see any issues.

@VRamakrishna I had the issue when I used v12.4.0 and v10.16.0 but it is has been solved when I use v8.16.0. Of course, there are other causes but this what is happened to me and maybe it is useful for others.

@fady-a-m-ibrahim Thanks for the comment to install Node.js v8. I had the same error and got resolved when I reinstalled node.

@fady-a-m-ibrahim Thanks for the comment to install Node.js v8. I had the same error and got resolved when I reinstalled node.

Thank you @ShiuliR, for letting me know. I'm so happy for you!!