Error: Failed to connect before the deadline URL:grpc://localhost:7051 - hyperledger-fabric

:~/Documents/test/education/LFS171x/fabric-material/tuna-app/$ node query.js
Store path:/home/*******/Documents/test/education/LFS171x/fabric-material/tuna-app/hfc-key-store
Successfully loaded user1 from persistence
2020-02-11T05:56:10.423Z - error: [Remote.js]: Error: Failed to connect before the deadline URL:grpc://localhost:7051
Query has completed, checking results
error from query = Error: Failed to connect before the deadline URL:grpc://localhost:7051
at checkState (/home/******/Documents/test/education/LFS171x/fabric-material/tuna-app/node_modules/fabric-client/node_modules/grpc/src/client.js:883:16) {
connectFailed: true
}
Im experimenting Hyperledger Fabric, using this link for reference,
Successfully registered admin and user, using registerAdmin.js and registerUser.js.
I am currently facing this error after running node query.js.
I need help troubleshooting this error,
Error: Failed to connect before the deadline
URL:grpc://localhost:7051.
Platform: Ubuntu 18.04,
Experimenting hyperledger fabric using Local Environment.
Thanks in advance.

Related

After running ./byfn.sh up got this Error. ERROR !!! FAILED to execute End-2-End Scenario

I'm trying to install Hyperledger in my Ubuntu Stand Alone system, After running sudo ./byfn.sh up i got this Error please help..!
Error: failed to create deliver client for orderer: orderer client
failed to connect to orderer.example.com:7050: failed to create new
connection: connection error: desc = "transport: error while dialing:
dial tcp: lookup orderer.example.com: no such host" !!!!!!!!!!!!!!!
Channel creation failed !!!!!!!!!!!!!!!!
========= ERROR !!! FAILED to execute End-2-End Scenario ===========
ERROR !!!! Test failed
byfn.sh script was used with older fabric versions and is no longer supported. The latest fabric-samples is having a network.sh script to setup fabric network. Detailed tutorial is available in official docs.

How to start Composer blockchain business network to Hyperledger Fabric (multiple organizations)?

Deploying a Hyperledger Composer blockchain business network to Hyperledger Fabric (multiple organizations) is working fine until i need to close my computer and try to connect again
I followed this tutorial=https://hyperledger.github.io/composer/v0.19/tutorials/deploy-to-fabric-multi-org
For the first time the command "composer-rest-server" worked fine but after there is an error and i am unable to connect again
That is the error:
To restart the REST server using the same options, issue the following command:
composer-rest-server -c alice#trade-network -n never -d n -w true
Discovering types from business network definition ...
Connection fails: Error: Error trying to ping. Error: No peers available to query. last error was Error: Failed to connect before the deadline
It will be retried for the next request.
Exception: Error: Error trying to ping. Error: No peers available to query. last error was Error: Failed to connect before the deadline
Error: Error trying to ping. Error: No peers available to query. last error was Error: Failed to connect before the deadline
at _checkRuntimeVersions.then.catch

Error reading from 192.168.1.164:44214: rpc error: code = Canceled desc = context canceled

i got this error when i am trying to connect peers running in different machines .I found this error in docker logs of orderer.There is an error in docker logs of peer2 running in different machine
Failed obtaining connection: Could not connect to any of the endpoints: [orderer.example.com:7050]
You can find the orderer.yaml file at fabric-samples/config folder.
Going through the fields and their respective comments in orderer.yaml and core.yaml can help you to understand the method of configuring the network(orderer/peer).
And here you can get the info related to TLS.

Hyperledger Fabric NodeJS client grpc issue

I am trying to send request to hyperledger fabric blockchain network through my NodeJS test client and I always receive the following:
error: [Remote.js]: Error: Failed to connect before the deadline
[hl] Query has completed, checking results
[hl] Query error: Error: Failed to connect before the deadline
at checkState (/opt/hl/test/frontend/node_modules/fabric-client/node_modules/grpc/src/client.js:838:16)
I am trying to find out what is wrong, there is nothing suspicious in peer logs.
I am using the following version:
HL v1.2.0
NodeJS v8.11.4
grpc v1.14.1
EDIT:
The code that is failing:
var channel = fabric_client.newChannel('mychannel');
var peer = fabric_client.newPeer('grpc://localhost:7051');
channel.addPeer(peer);
var order = fabric_client.newOrderer('grpc://localhost:7050')
channel.addOrderer(order);
channel.queryByChaincode(request) <-- ERROR
The hyperledger is running because I am able to query and invoke chaincode functions through Java SDK.
It seems to be a permission issue. When I start the client side with sudo, assigning it root previlige. The issue is resolved.
Still not sure about the root cause.
sudo env "PATH=$PATH" ./fabric.sh start
Try setting a longer timeout and then re-running it export GRPC_WAIT_FOR_READY_TIMEOUT=6000

Error Composer Rest Server

I have follow Hyperledger Composer here and all step is done.
But when i restart my PC and try to connect to Hyperledger Composer via command 'composer-rest-server' have error like this:
enter image description here
Discovering types from business network definition ... Connection
fails: Error: Error trying to ping. Error: Error trying to query
business network. Error: Connect Failed It will be retried for the
next request. Exception: Error: Error trying to ping. Error: Error
trying to query business network. Error: Connect Failed Error:
Error trying to ping. Error: Error trying to query business network.
Error: Connect Failed
at _checkRuntimeVersions.then.catch (/home/linux-user/.nvm/versions/node/v8.9.4/lib/node_modules/composer-rest-server/node_modules/composer-connector-hlfv1/lib/hlfconnection.js:713:34)
at <'anonymous'>
Please help! Thank You.
See this answer for restarting the underlying Fabric before starting the REST Server.
When you restart your system, you also shut down all running docker containers. Restart containers(your blockchain network) before launching composer rest server.

Resources