Peer could not connect to External Address of Orderer - hyperledger-fabric

When I update the external address of orderer address, everything works fine, latest block has external address value. Although remote peer can telnet to external address, peer's log show peer could not connect to this.
Step to reproduce:
1. Fetch channel config.
2. Update config with newest config.
3. Sign channel of orderer, organization.
4. Update channel config.
5. Join channel and sync data.
Logs show like this:
2019-05-15 06:44:58.561 UTC [gossip/service] func1 -> INFO 0a3 Elected as a leader, starting delivery service for channel rmchannel
2019-05-15 06:45:01.562 UTC [ConnProducer] NewConnection -> ERRO 0a4 Failed connecting to internal-add:7050 , error: context deadline exceeded
2019-05-15 06:45:04.563 UTC [ConnProducer] NewConnection -> ERRO 0a5 Failed connecting to external-add:7050 , error: context deadline exceeded
2019-05-15 06:45:04.563 UTC [deliveryClient] connect -> ERRO 0a6 Failed obtaining connection: Could not connect to any of the endpoints: [internal-add:7050 external-add:7050]
2019-05-15 06:45:04.563 UTC [deliveryClient] try -> WARN 0a7 Got error: Could not connect to any of the endpoints: [internal-add:7050 external-add:7050] , at 1 attempt. Retrying in 1s
2019-05-15 06:45:08.565 UTC [ConnProducer] NewConnection -> ERRO 0a8 Failed connecting to external-add:7050 , error: context deadline exceeded
2019-05-15 06:45:11.566 UTC [ConnProducer] NewConnection -> ERRO 0a9 Failed connecting to internal-add:7050 , error: context deadline exceeded
2019-05-15 06:45:11.566 UTC [deliveryClient] connect -> ERRO 0aa Failed obtaining connection: Could not connect to any of the endpoints: [external-add:7050]
2019-05-15 06:45:11.566 UTC [deliveryClient] try -> WARN 0ab Got error: Could not connect to any of the endpoints: [external-add:7050] , at 2 attempt. Retrying in 2s
Could anyone have ideas about my case?
Many thanks!

Related

Hyperledger anchor peers cannot communicate with each other because of tls bad certificate

I had created a hyperledger fabric channel [channel1] with two peer organizations**(Org1,Org2)** and one orderer organization (OrdererOrg), and there are one peer (peer0.org1.com/peer0.org2.com) in each peer organization and three orderer nodes**[Orderer0, Orderer1, Orderer 2]** in the orderer organization. After joining ordering nodes and peers into the channel and setting [peer0.org1.com] and [peer0.org2.com] as anchor peers, the follow errors are printed in peer logs:
peer0.org1.com
2021-04-14 10:53:08.108 CST [core.comm] ServerHandshake -> ERRO 1a2 Server TLS handshake failed in 962.117µs with error remote error: tls: bad certificate server=PeerServer remoteaddress=127.0.0.1:58281
2021-04-14 10:53:09.112 CST [core.comm] ServerHandshake -> ERRO 1a3 Server TLS handshake failed in 2.162124ms with error remote error: tls: bad certificate server=PeerServer remoteaddress=127.0.0.1:58283
2021-04-14 10:53:10.836 CST [core.comm] ServerHandshake -> ERRO 1a4 Server TLS handshake failed in 1.629684ms with error remote error: tls: bad certificate server=PeerServer remote address=127.0.0.1:58285
peer0.org2.com
2021-04-14 10:53:11.107 CST [gossip.gossip] func1 -> WARN 12f Deep probe of localhost:20000 for channel channel1 failed: context deadline exceeded
2021-04-14 10:53:11.108 CST [gossip.discovery] func1 -> WARN 130 Could not connect to Endpoint: localhost:20000, InternalEndpoint: localhost:20000, PKI-ID: <nil>, Metadata: : context deadline exceeded
configtx.yaml
core.yaml of [peer0.org1.com]
core.yaml of [peer0.org2.com]
The tutorials I followed:
Creating a channel
I solved the problem by add an folder named tlscacerts to the organization msp.
Noticed that in the test-network /test-network/organizations/peerOrganizations/org1.example.com/msp/tlscacerts/
enter image description here
copy your tls root ca certificate into it.

Hyperledger Fabric fabcar client can't connect to the peer node

Two months ago, I've written an application using Hyperledger Fabric. Now, I try to run it again, but I get error and I can't resolve it. So I go the the Hyperledger Fabric doc again(https://hyperledger-fabric.readthedocs.io/en/latest/install.html), and reinstall everything(including cmd tools, docker images and even my MacOS).
I've tried two versions(v2.0.1 and v2.1.0), and my node version is v12. What I do is:
download the fabric-samples repo using cmd (curl -sSL https://xxx/2ysbOFE | bash -s -- 2.1.0 1.4.6 0.4.18)
and go the fabcar/ directory and run ./startFabric.sh
and go the fabrcar/javascript/ directory and run npm install && node enrollAdmin.js && node registerUser.js && node invoke.js
However, I meet this error again:
2020-05-07T06:39:28.354Z - error: [ServiceEndpoint]: Error: Failed to connect before the deadline on Endorser- name: peer0.org1.example.com, url:grpcs://localhost:7051
2020-05-07T06:39:28.356Z - error: [ServiceEndpoint]: waitForReady - Failed to connect to remote gRPC server peer0.org1.example.com url:grpcs://localhost:7051 timeout:3000
2020-05-07T06:39:28.360Z - error: [NetworkConfig]: buildPeer - Unable to connect to the endorser peer0.org1.example.com due to Error: Failed to connect before the deadline on Endorser- name: peer0.org1.example.com, url:grpcs://localhost:7051
at checkState (/Users/xiebei/code/fabric-samples/fabcar/javascript/node_modules/grpc/src/client.js:883:16) {
connectFailed: true
}
2020-05-07T06:39:31.363Z - error: [ServiceEndpoint]: Error: Failed to connect before the deadline on Discoverer- name: peer0.org1.example.com, url:grpcs://localhost:7051
2020-05-07T06:39:31.363Z - error: [ServiceEndpoint]: waitForReady - Failed to connect to remote gRPC server peer0.org1.example.com url:grpcs://localhost:7051 timeout:3000
Failed to evaluate transaction: Error: Failed to connect before the deadline on Discoverer- name: peer0.org1.example.com, url:grpcs://localhost:7051
I use docker ps:
enter image description here
Seems everything goes ok. And the orderer node docker logs is :
2020-05-07 06:12:07.554 UTC [orderer.consensus.etcdraft] propose -> INFO 059 Created block [5], there are 0 blocks in flight channel=mychannel node=1
2020-05-07 06:12:07.558 UTC [orderer.consensus.etcdraft] writeBlock -> INFO 05a Writing block [5] (Raft index: 7) to ledger channel=mychannel node=1
2020-05-07 06:12:07.788 UTC [orderer.common.broadcast] Handle -> WARN 05b Error reading from 172.18.0.1:36216: rpc error: code = Canceled desc = context canceled
2020-05-07 06:12:07.789 UTC [comm.grpc.server] 1 -> INFO 05c streaming call completed grpc.service=orderer.AtomicBroadcast grpc.method=Broadcast grpc.peer_address=172.18.0.1:36216 error="rpc error: code = Canceled desc = context canceled" grpc.code=Canceled grpc.call_duration=2.257323471s
2020-05-07 06:12:14.117 UTC [orderer.common.broadcast] Handle -> WARN 05d Error reading from 172.18.0.1:36256: rpc error: code = Canceled desc = context canceled
2020-05-07 06:12:14.117 UTC [comm.grpc.server] 1 -> INFO 05e streaming call completed grpc.service=orderer.AtomicBroadcast grpc.method=Broadcast grpc.peer_address=172.18.0.1:36256 error="rpc error: code = Canceled desc = context canceled" grpc.code=Canceled grpc.call_duration=61.170986ms
2020-05-07 06:12:16.114 UTC [orderer.consensus.etcdraft] propose -> INFO 05f Created block [6], there are 0 blocks in flight channel=mychannel node=1
2020-05-07 06:12:16.117 UTC [orderer.consensus.etcdraft] writeBlock -> INFO 060 Writing block [6] (Raft index: 8) to ledger channel=mychannel node=1
It seems like that the orderer can't connect to something(maybe the peer node). So I think there's some possible problems:
Maybe the peer node's network is failed, we can't connect to it.
Maybe the NodeJS Fabric SDK is buggy, it's GRPC client can't works well.
Maybe my computer goes wrong.
Could you please help me? Thanks!!!

Failed to order the transaction. Error code: SERVICE_UNAVAILABLE using raft consensus protocol

I am facing this error while using Raft consensus protocol in which I have setup 5 orderers(1 in 1st server, 2 each in other 2 servers) namely orderer1 to orderer5.
Everything works fine with the setup and all the orderers are participating in the orderer election process but while I'm trying to invoke a transaction then I'm facing an error like this:
[ERROR] invoke-chaincode - Failed to order the transaction. Error code: SERVICE_UNAVAILABLE
This error comes only when i try to invoke using orderer2 but works well with any other orderer. Please help to resolve the issue.
Here are the logs of orderer2 and its running:
2019-08-13 07:05:59.374 UTC [orderer.consensus.etcdraft] run -> INFO 318 raft.node: 2 elected leader 4 at term 2 channel=invoice node=2
2019-08-13 07:05:59.375 UTC [orderer.consensus.etcdraft] serveRequest -> INFO 319 Raft leader changed: 0 -> 4 channel=invoice node=2
2019-08-13 07:05:59.580 UTC [common.deliver] Handle -> WARN 31a Error reading from xx.xx.xx.xx:56890: rpc error: code = Canceled desc = context canceled
2019-08-13 07:05:59.580 UTC [comm.grpc.server] 1 -> INFO 31b streaming call completed grpc.service=orderer.AtomicBroadcast grpc.method=Deliver grpc.peer_address=xx.xx.xx.xx:56890 error="rpc error: code = Canceled desc = context canceled" grpc.code=Canceled grpc.call_duration=207.535623ms
2019-08-13 07:13:20.952 UTC [orderer.common.broadcast] ProcessMessage -> WARN 320 [channel: invoice] Rejecting broadcast of normal message from xx.xx.xx.xx:56916 with SERVICE_UNAVAILABLE: rejected by Order: rpc error: code = Unavailable desc = all SubConns are in TransientFailure, latest connection error: connection error: desc = "transport: Error while dialing dial tcp 192.168.224.4:8050: connect: connection refused"
2019-08-13 07:13:20.952 UTC [comm.grpc.server] 1 -> INFO 321 streaming call completed grpc.service=orderer.AtomicBroadcast grpc.method=Broadcast grpc.peer_address=xx.xx.xx.xx:56916 grpc.code=OK grpc.call_duration=35.477429971s
I just ran into this very issue, orderer2 as well. It turns out for me, I had made a typo in the orderer config. In the General.Cluster section, I accidentally renamed the ClientCertificate and ClientPrivateKey fields to ServerCertificate and ServerPrivateKey. I switched them, left the Server* values blank and pointed to my client certs with the others and everything worked.

How fix "rpc error: code = Unknown desc = access denied: channel [mychannel] creator org [Org1MSP]" error in Hyperledger Fabric

Currently I am using Hyperledger Fabric 1.4, and I am trying to modify the basic-network. I am trying to add an org2 with one peer. Whenever I try to invoke the chaincode from the peer on the second organization (Org2) I get the following error:
Error: Error endorsing chaincode: rpc error: code = Unknown desc = access denied: channel [] creator org [Org2MSP]
My current network components are:
org1, with two peers
org2, with one peer
CA1
CA2
Ordere
CLI
and a channel called "mychannel"
I am able to create the channel "mychannel" and join the 3 peers from the two organizations. Also, I am able to install the chaincode on three of the peers from both organizations. And I am instantiating the chaincode on peer0 in Org1
Part of the Ordere logs:
2019-05-13 13:17:42.384 UTC [fsblkstorage] newBlockfileMgr -> INFO 003 Getting block information from block storage
2019-05-13 13:17:42.970 UTC [orderer.commmon.multichannel] Initialize -> INFO 004 Starting system channel 'testchainid' with genesis block hash f1bcfe55588bd24faaa699bc740045455283b63950436a36d5cf473f4b3d8f81 and orderer type solo
2019-05-13 13:17:42.970 UTC [orderer.common.server] Start -> INFO 005 Starting orderer:
Version: 1.4.1
Commit SHA: 87074a7
Go version: go1.11.5
OS/Arch: linux/amd64
2019-05-13 13:17:42.970 UTC [orderer.common.server] Start -> INFO 006 Beginning to serve requests
2019-05-13 13:21:30.921 UTC [comm.grpc.server] 1 -> INFO 007 streaming call completed grpc.service=orderer.AtomicBroadcast grpc.method=Broadcast grpc.peer_address=172.20.0.6:36544 grpc.code=OK grpc.call_duration=27.428231ms
2019-05-13 13:21:30.927 UTC [fsblkstorage] newBlockfileMgr -> INFO 008 Getting block information from block storage
2019-05-13 13:21:31.038 UTC [orderer.commmon.multichannel] newChain -> INFO 009 Created and starting new chain mychannel
2019-05-13 13:21:31.044 UTC [comm.grpc.server] 1 -> INFO 00a streaming call completed grpc.service=orderer.AtomicBroadcast grpc.method=Deliver grpc.peer_address=172.20.0.6:36542 grpc.code=OK grpc.call_duration=152.538972ms
2019-05-13 13:22:11.867 UTC [common.deliver] Handle -> WARN 00b Error reading from 172.20.0.6:36578: rpc error: code = Canceled desc = context canceled
2019-05-13 13:22:11.867 UTC [comm.grpc.server] 1 -> INFO 00c streaming call completed grpc.service=orderer.AtomicBroadcast grpc.method=Deliver grpc.peer_address=172.20.0.6:36578 error="rpc error: code = Canceled desc = context canceled" grpc.code=Canceled grpc.call_duration=5.757971ms
2019-05-13 13:22:22.295 UTC [orderer.common.broadcast] Handle -> WARN 00d Error reading from 172.20.0.8:34272: rpc error: code = Canceled desc = context canceled
2019-05-13 13:22:22.295 UTC [comm.grpc.server] 1 -> INFO 00e streaming call completed grpc.service=orderer.AtomicBroadcast grpc.method=Broadcast grpc.peer_address=172.20.0.8:34272 error="rpc error: code = Canceled desc = context canceled" grpc.code=Canceled grpc.call_duration=7.238573847s
2019-05-13 13:23:46.748 UTC [orderer.common.broadcast] Handle -> WARN 00f Error reading from 172.20.0.8:34362: rpc error: code = Canceled desc = context canceled
2019-05-13 13:23:46.748 UTC [comm.grpc.server] 1 -> INFO 010 streaming call completed grpc.service=orderer.AtomicBroadcast grpc.method=Broadcast grpc.peer_address=172.20.0.8:34362 error="rpc error: code = Canceled desc = context canceled" grpc.code=Canceled grpc.call_duration=49.20235ms
In summery, I can not invoke the chaincode from the second organization (Org2) because of channel access error.
Note:
I am generating the CA and I have checked the files and it seems to be correct
If anyone can help I would appreciate it.
Thanks in advance
This can be caused by wrong MSPID name for example "orgMSP" is wrong as it starts with lowercase "o"
to solve the problem use correct MSPID
export CORE_PEER_LOCALMSPID="Org1MSP"
It would be easy to answer if you have shared the peer logs.
The error could be because of the Certificates to sign the transaction.Double check your certificate received from CA and also checked the certificates and path used inside the docker container of peer1.

Error while creating channel in hyperledger fabric

I am trying to create a channel in the deployed hyperledger fabric.
using command
peer channel create -o orderer0.orgorderer1:7050 -c mychannel -f ./channel-artifacts/channel.tx
but i am getting error
2018-01-18 09:59:05.382 UTC [grpc] Printf -> DEBU 011 transport: http2Client.notifyError got notified that the client transport was broken read tcp 10.244.1.8:47112->10.96.99.75:7050: read: connection reset by peer.
2018-01-18 09:59:05.383 UTC [grpc] Printf -> DEBU 012 transport: http2Client.notifyError got notified that the client transport was broken unexpected EOF.
Error: rpc error: code = Internal desc = transport is closing
2018-01-18 09:59:05.383 UTC [grpc] Printf -> DEBU 013 grpc: addrConn.resetTransport failed to create client transport: connection error: desc = "transport: Error while dialing dial tcp: operation was canceled"; Reconnecting to {orderer0.orgorderer1:7050 <nil>}
2018-01-18 09:59:05.383 UTC [grpc] Printf -> DEBU 014 grpc: addrConn.transportMonitor exits due to: grpc: the connection is closing
More info
my hyperledger fabric is deployed on kubernetes. using link
And is was working fine
now i have used custom cryptographic material for the MSP
and redeployed.
And getting the above error
all the pods in the kubernestes are up and running.

Resources