Hyperledger Fabric Error: error getting endorser client for channel: endorser client failed to connect - hyperledger-fabric

I am walking through the Hyperledger Fabric Build Your First Network tutorial and I am under the Create and Join Channel section. When I try and do the following command to create a channel on test-network in fabric-samples folder:
./network.sh createChannel
I receive the following error:
Channel 'mychannel' created
Joining org1 peer to the channel...
Using organization 1
+ peer channel join -b ./channel-artifacts/mychannel.block
+ res=1
+ peer channel join -b ./channel-artifacts/mychannel.block
+ res=1
+ peer channel join -b ./channel-artifacts/mychannel.block
+ res=1
+ peer channel join -b ./channel-artifacts/mychannel.block
+ res=1
2022-11-25 11:29:19.084 +03 0001 ERRO [comm.tls] ClientHandshake -> Client TLS handshake failed after 4.861792ms with error: EOF remoteaddress=[::1]:7051
2022-11-25 11:29:20.091 +03 0002 ERRO [comm.tls] ClientHandshake -> Client TLS handshake failed after 3.890833ms with error: EOF remoteaddress=[::1]:7051
2022-11-25 11:29:21.546 +03 0003 ERRO [comm.tls] ClientHandshake -> Client TLS handshake failed after 7.053083ms with error: EOF remoteaddress=[::1]:7051
Error: error getting endorser client for channel: endorser client failed to connect to localhost:7051: failed to create new connection: context deadline exceeded
After 5 attempts, peer0.org1 has failed to join channel 'mychannel'
Even though I followed the same steps yesterday, it just worked fine. But today I have this error and I don't know how to solve it.

Related

Hyperledger fabric 2.0

Getting the below error while trying to connect peer to channel in hyper-ledger fabric v 2.0 with couchbase 2,3
Error: error getting endorser client for channel: endorser client failed to connect to peer0.org1.example.com:7051: failed to create new connection: context deadline exceeded.
Can anyone suggest why this is happening?
peer channel create -o localhost:7050 -c mychannel --ordererTLSHostnameOverride orderer.example.com -f ./artifacts/channel/mychannel.tx --outputBlock ./channel-artifacts/mychannel.block --tls true --cafile $ORDERER_CA
try this way to do this

Problem with instantiating chaincode in Hyperledger fabric Network

I have a problem with instantiating chaincode in Hyperledger fabric Network with comm:
peer chaincode instantiate -o orderer.ex.com:7050 -C roaming -n chaincode -v 1.1 -c '{"Args":[]}' -P "AND ('ORG1MSP.member')" --tls --cafile /etc/hyperledger/fabric/config/ca.crt
The peer is joined the channel and chaincode is installed on it.
The log of orderer is:
ERRO 029 TLS handshake failed with error tls: oversized record received with length 64774 server=Orderer
WARN 02a Error reading from 172.16.0.81:34562: rpc error: code = Canceled desc = context canceled
INFO 02b streaming call completed grpc.service=orderer.AtomicBroadcast grpc.method=Deliver grpc.peer_address=172.16.0.81:34562 error="rpc error: code = Canceled desc = context canceled" grpc.code=Canceled grpc.call
WARN 02c Error reading from 172.16.0.81:35318: rpc error: code = Canceled desc = context canceled
In the log of the peer - nothing interesting.
The error looks like the client is trying to communicate speak HTTP/GRPC to a server expecting HTTPS/GRPCS (or viceversa)
If your fabric network endpoints are not encrypted, remove the --tls and --cafile flags.
Otherwise, make sure to use an encrypted endpoint for the orderer (e.g. orderer.ex.com:443 if it's exposed via HTTPS with an ingress controller) and the peer as well (CORE_PEER_ADDRESS)
I have also found when enabling TLS that the following environment variables are needed in addition to the --tls and --cafile above:
CORE_PEER_TLS_ROOTCERT_FILE=/path/to/ca/pem (e.g. `letsencryptauthorityx3.pem`)
CORE_PEER_TLS_ENABLED=true

Promise is rejected: Error: 2 UNKNOWN: access denied: channel [mychannel] creator org [ebsMSP]

I have set up Multi-Org(4 org) Fabric. Each org is having one peer (peer0). While doing query on 2nd org I'm getting below error:
Calling One getOrdersByEBSDashboardStatus Function..
error: [client-utils.js]: sendPeersProposal - Promise is rejected: Error: 2 UNKNOWN: access denied: channel [mychannel] creator org [ebsMSP]
at new createStatusError (/home/vikas123/fabric-samples/kpn_grpc/node_modules/fabric-client/node_modules/grpc/src/client.js:64:15)
at /home/vikas123/fabric-samples/kpn_grpc/node_modules/fabric-client/node_modules/grpc/src/client.js:583:15
Query has completed, checking results
error from query = { Error: 2 UNKNOWN: access denied: channel [mychannel] creator org [ebsMSP]
at new createStatusError (/home/vikas123/fabric-samples/kpn_grpc/node_modules/fabric-client/node_modules/grpc/src/client.js:64:15)
at /home/vikas123/fabric-samples/kpn_grpc/node_modules/fabric-client/node_modules/grpc/src/client.js:583:15
code: 2,
metadata: Metadata { _internal_repr: {} },
details: 'access denied: channel [mychannel] creator org [ebsMSP]' }
At the same time when I checked docker logs respective to this org, I see message : channel [mychannel]: MSP error: channel doesn't exist.
Please check attached query file:https://github.com/SakivV/dockergit/blob/master/queryebs.js
Remember once you have generated the crypto material you have to create the channel automatically and doesn't need to create the channel anymore but you have to join all peers one by one and then update the channel regarding that join.
peer channel fetch 0 $CHANNEL_NAME.block -c $CHANNEL_NAME -o orderer.example.com:7050
peer channel join -b $CHANNEL_NAME.block -c $CHANNEL_NAME -o orderer.example.com:7050
There are anchor peer tx into channel-artifacts/ (Org1Panchors.tx)
peer channel update -o orderer.example.com:7050 -c $CHANNEL_NAME -f ./channel-artifacts/Org1Panchors.tx

Hyperledger-Fabric Error adding an organization to an existing channel

I am getting an error when following the tutorial for adding an new organization in the channel .
The command I typed is
./eyfn.sh up
The output below is the error I got.
+ res=1
+ set +x
+ peer channel join -b mychannel.block
CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org3.example.com/peers/peer0.org3.example.com/tls/ca.crt
CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org3.example.com/peers/peer0.org3.example.com/tls/server.key
CORE_PEER_LOCALMSPID=Org3MSP
CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org3.example.com/peers/peer0.org3.example.com/tls/server.crt
CORE_PEER_TLS_ENABLED=true
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org3.example.com/users/Admin#org3.example.com/msp
CORE_PEER_ID=Org3cli
CORE_LOGGING_LEVEL=INFO
CORE_PEER_ADDRESS=peer0.org3.example.com:7051
2018-06-19 22:08:40.019 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
Error: proposal failed (err: rpc error: code = Unknown desc = chaincode error (status: 500, message: Cannot create ledger from genesis block, due to LedgerID already exists))
Usage:
peer channel join [flags]
Flags:
-b, --blockpath string Path to file containing genesis block
Global Flags:
--cafile string Path to file containing PEM-encoded trusted certificate(s) for the ordering endpoint
--certfile string Path to file containing PEM-encoded X509 public key to use for mutual TLS communication with the orderer endpoint
--clientauth Use mutual TLS when communicating with the orderer endpoint
--keyfile string Path to file containing PEM-encoded private key to use for mutual TLS communication with the orderer endpoint
--logging-level string Default logging level and overrides, see core.yaml for full syntax
-o, --orderer string Ordering service endpoint
--ordererTLSHostnameOverride string The hostname override to use when validating the TLS connection to the orderer.
--tls Use TLS when communicating with the orderer endpoint
-v, --version Display current version of fabric peer server
peer0.org3 failed to join the channel, Retry after 3 seconds
Specifically the error in the outputs seems to be this,
Error: proposal failed (err: rpc error: code = Unknown desc = chaincode error (status: 500, message: Cannot create ledger from genesis block, due to LedgerID already exists))
I am following instructions from the http://hyperledger-fabric.readthedocs.io/en/release-1.1/channel_update_tutorial.html.
Any guidance seem to be helpful.
Run this command
./byfn.sh -m down
And then run
./eyfn.sh up
Hope this help!

Fabric Instantiation Orderer Error

When I try to instantiate my chaincode:
root#93272a1da547:/opt/gopath/src/github.com/hyperledger/fabric/peer#
peer chaincode instantiate -n fabrep -v 1.0.0 -C mychannel
I'm getting the following error:
2018-06-19 07:51:52.831 UTC [chaincodeCmd] InitCmdFactory -> INFO 001 Get chain(mychannel) orderer endpoint: orderer.example.com:7050
Error: Error getting broadcast client: rpc error: code = Unavailable desc = transport: write tcp 172.19.0.7:39868->172.19.0.6:7050: write: broken pipe
Anyone knows what this means?

Resources