Error while creating channel in hyperledger fabric - 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.

Related

Hyperledger Fabric 2.4 approve chaincode error

I'm setting up an hyperledger fabric network with docker compose.
All the containers are up and running but i'm having problems with the appprovemyorg command.
These are the logs of the peer after joining the channel:
2022-05-24 07:41:54.316 UTC 0023 INFO [ledgermgmt] CreateLedger -> Creating ledger [mychannel] with genesis block
2022-05-24 07:41:54.319 UTC 0024 INFO [blkstorage] newBlockfileMgr -> Getting block information from block storage
2022-05-24 07:41:54.328 UTC 0025 INFO [kvledger] commit -> [mychannel] Committed block [0] with 1 transaction(s) in 6ms (state_validation=0ms block_and_pvtdata_commit=3ms state_commit=1ms) commitHash=[]
2022-05-24 07:41:54.328 UTC 0026 INFO [kvledger] updateLedgerStatus -> Updating ledger [mychannel] status to [ACTIVE]
2022-05-24 07:41:54.329 UTC 0027 INFO [ledgermgmt] CreateLedger -> Created ledger [mychannel] with genesis block
2022-05-24 07:41:54.332 UTC 0028 INFO [gossip.gossip] JoinChan -> Joining gossip network of channel mychannel with 1 organizations
2022-05-24 07:41:54.332 UTC 0029 INFO [gossip.gossip] learnAnchorPeers -> No configured anchor peers of org1MSP for channel mychannel to learn about
2022-05-24 07:41:54.333 UTC 002a INFO [gateway] configUpdate -> Updating orderer config channel=mychannel
2022-05-24 07:41:54.333 UTC 002b INFO [gossip.state] NewGossipStateProvider -> Updating metadata information for channel mychannel, current ledger sequence is at = 0, next expected block is = 1
2022-05-24 07:41:54.333 UTC 002c INFO [endorser] callChaincode -> finished chaincode: cscc duration: 21ms channel= txID=a704dc84
2022-05-24 07:41:54.333 UTC 002d INFO [comm.grpc.server] 1 -> unary call completed grpc.service=protos.Endorser grpc.method=ProcessProposal grpc.peer_address=172.22.0.9:59204 grpc.code=OK grpc.call_duration=22.209824ms
2022-05-24 07:42:00.335 UTC 002e INFO [gossip.election] beLeader -> 49ad88f230e73d14bb6f9b8a891c0f5bc47a35cd793ff62222e489f762864a33 : Becoming a leader
2022-05-24 07:42:00.335 UTC 002f INFO [gossip.service] func1 -> Elected as a leader, starting delivery service for channel mychannel
2022-05-24 07:42:00.335 UTC 0030 INFO [deliveryClient] StartDeliverForChannel -> This peer will retrieve blocks from ordering service and disseminate to other peers in the organization for channel mychannel
2022-05-24 07:30:08.206 UTC 0031 WARN [peer.blocksprovider] DeliverBlocks -> Could not connect to ordering service: could not dial endpoint &apos;orderer2:8050&apos;: failed to create new connection: connection error: desc = "transport: error while dialing: dial tcp 0.0.0.0:8050: connect: connection refused" channel=mychannel
2022-05-24 07:30:08.307 UTC 0032 WARN [peer.blocksprovider] DeliverBlocks -> Could not connect to ordering service: could not dial endpoint &apos;orderer3:9050&apos;: failed to create new connection: connection error: desc = "transport: error while dialing: dial tcp 0.0.0.0:9050: connect: connection refused" channel=mychannel
2022-05-24 07:30:08.428 UTC 0033 WARN [peer.blocksprovider] DeliverBlocks -> Could not connect to ordering service: could not dial endpoint &apos;orderer1:7050&apos;: failed to create new connection: connection error: desc = "transport: error while dialing: dial tcp 0.0.0.0:7050: connect: connection refused" channel=mychannel
As you can see, i have some warnings but I can safely join the channel and I have no problems at all when i install the chaincode (the warnings disappear too).
These are the logs on the peer after installing the chaincode:
2022-05-24 07:45:17.017 UTC 0052 INFO [chaincode.externalbuilder.ccaas_builder] waitForExit -> ::Detect command=detect
2022-05-24 07:45:17.017 UTC 0053 INFO [chaincode.externalbuilder.ccaas_builder] waitForExit -> ::Error: chaincode type not supported: java command=detect
2022-05-24 07:45:17.023 UTC 0054 INFO [lifecycle] InstallChaincode -> Successfully installed chaincode with package ID 'testchaincode_1:de8cddcb2deda13a7a3c1e9f6e37764e6d2c1bb6f89bac1f0d2c6396587b35f7'
2022-05-24 07:45:17.023 UTC 0055 INFO [endorser] callChaincode -> finished chaincode: _lifecycle duration: 14ms channel= txID=694acf7b
2022-05-24 07:45:17.023 UTC 0056 INFO [comm.grpc.server] 1 -> unary call completed grpc.service=protos.Endorser grpc.method=ProcessProposal grpc.peer_address=172.22.0.9:59206 grpc.code=OK grpc.call_duration=15.8101ms
When i try to approve the chaincode with this command:
peer lifecycle chaincode approveformyorg --tls --cafile /tmp/hyperledger/org1/peer1/tls-msp/tlscacerts/tls-tls-ca-7052.pem -o orderer1:7050 --ordererTLSHostnameOverride orderer1 --channelID mychannel --name mycc --version 1 --sequence 1 --waitForEvent --init-required --package-id testchaincode_1:de8cddcb2deda13a7a3c1e9f6e37764e6d2c1bb6f89bac1f0d2c6396587b35f7
I have this error:
Error: timed out waiting for txid on all peers
With these logs on the peer:
2022-05-24 07:46:54.303 UTC 0059 INFO [lifecycle] ApproveChaincodeDefinitionForOrg -> Successfully endorsed chaincode approval with name 'mycc', package ID 'testchaincode_1:de8cddcb2deda13a7a3c1e9f6e37764e6d2c1bb6f89bac1f0d2c6396587b35f7', on channel 'mychannel' with definition {sequence: 1, endorsement info: (version: '1', plugin: 'escc', init required: true), validation info: (plugin: 'vscc', policy: '12202f4368616e6e656c2f4170706c69636174696f6e2f456e646f7273656d656e74'), collections: ()}
2022-05-24 07:46:54.303 UTC 005a INFO [endorser] callChaincode -> finished chaincode: _lifecycle duration: 0ms channel=mychannel txID=d56b21b6
2022-05-24 07:46:54.308 UTC 005b INFO [comm.grpc.server] 1 -> unary call completed grpc.service=protos.Endorser grpc.method=ProcessProposal grpc.peer_address=172.22.0.9:59210 grpc.code=OK grpc.call_duration=6.78249ms
2022-05-24 07:46:55.194 UTC 005c WARN [peer.blocksprovider] DeliverBlocks -> Could not connect to ordering service: could not dial endpoint 'orderer1:7050': failed to create new connection: connection error: desc = "transport: error while dialing: dial tcp 0.0.0.0:7050: connect: connection refused" channel=mychannel
2022-05-24 07:47:24.311 UTC 005d INFO [comm.grpc.server] 1 -> streaming call completed grpc.service=protos.Deliver grpc.method=DeliverFiltered grpc.request_deadline=2022-05-24T07:47:24.31Z grpc.peer_address=172.22.0.9:59212 error="context finished before block retrieved: context deadline exceeded" grpc.code=Unknown grpc.call_duration=30.0006887s
2022-05-24 07:47:54.260 UTC 005e WARN [peer.blocksprovider] DeliverBlocks -> Could not connect to ordering service: could not dial endpoint 'orderer2:8050': failed to create new connection: connection error: desc = "transport: error while dialing: dial tcp 0.0.0.0:8050: connect: connection refused" channel=mychannel
So i can't approve the chaincode and advance in the process.
Can anyone help me solve this problem?
Thanks

Hyper Ledger Fabric CA Server Setup Error with IP SANS

I am trying to setup blockchain network with two organizations having two peers in each organization. I generated crypto material using fabric-ca-server-client command after setting up separate CAs for org1, org2 and orderer organizations. All peers and orderers are running in different containers in a single VM. Issue is about IP SANS.
# Register peer0 certificates now
fabric-ca-client register --caname ca.org1.example.com --csr.cn peer0.org1.example.com --csr.names 'O=org1,OU=peer,C=IN,ST=Telangana' --id.name peer0 --id.secret peer0pw --id.type peer --id.attrs '"hf.Registrar.Roles=peer"' --tls.certfiles ${FABRIC_CA_CLIENT_HOME}/ca/tls-ca-org1-example-com-cert.pem
# Enroll peer0 certificates now which stores crypto material for peer0 in msp folder
fabric-ca-client enroll -u https://peer0:peer0pw#localhost:7060 --caname ca.org1.example.com --csr.cn peer0.org1.example.com --csr.names 'O=org1,OU=peer,C=IN,ST=Telangana' -M ${FABRIC_CA_CLIENT_HOME}/peers/peer0.org1.example.com/msp --csr.hosts peer0.org1.example.com --tls.certfiles ${FABRIC_CA_CLIENT_HOME}/ca/tls-ca-org1-example-com-cert.pem
I am getting below error while executing docker logs peer0.org1.example.com
2022-03-05 08:49:11.635 UTC [grpc] Warningf -> DEBU 04f grpc: addrConn.createTransport failed to connect to {127.0.0.1:7051 <nil> 0 <nil>}. Err: connection error: desc = "transport: authentication handshake failed: x509: cannot validate certificate for 127.0.0.1 because it doesn't contain any IP SANs". Reconnecting...
2022-03-05 08:49:11.636 UTC [grpc] Infof -> DEBU 052 Subchannel Connectivity change to TRANSIENT_FAILURE
2022-03-05 08:49:11.636 UTC [grpc] UpdateSubConnState -> DEBU 053 pickfirstBalancer: HandleSubConnStateChange: 0xc002ae4e40, {TRANSIENT_FAILURE connection error: desc = "transport: authentication handshake failed: x509: cannot validate certificate for 127.0.0.1 because it doesn't contain any IP SANs"}
2022-03-05 08:49:11.636 UTC [grpc] Infof -> DEBU 054 Channel Connectivity change to TRANSIENT_FAILURE
2022-03-05 08:49:11.635 UTC [core.comm] ServerHandshake -> ERRO 050 Server TLS handshake failed in 945.487µs with error remote error: tls: bad certificate server=PeerServer remoteaddress=127.0.0.1:38460
2022-03-05 08:49:11.637 UTC [grpc] Warningf -> DEBU 055 grpc: Server.Serve failed to complete security handshake from "127.0.0.1:38460": remote error: tls: bad certificate

Error while joing the TLS enabled peer to channel in Hyperledger

I just up the hyperledger docker container. I use TLS enabled orderer and peers. I created the channel using the command in cli bash(for peer0)
peer channel create -o orderer0.Myname.com:7050 -c Mynamechannel -f /opt/gopath/src/github.com/hyperledger/fabric/peer/channel-artifacts/channel.tx --tls --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/Myname.com/orderers/orderer0.Myname.com/msp/tlscacerts/tlsca.Myname.com-cert.pem
It runs successfully. Then I try to join the channel using the command
export CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.Myname.com/users/Admin#org1.Myname.com/msp
export CORE_PEER_ADDRESS=peer0.org1.Myname.com:7051
export CORE_PEER_LOCALMSPID="Org1Myname"
export CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.Myname.com/peers/peer0.org1.Myname.com/tls/ca.crt
peer channel join -b Mynamechannel.block
But got the errors some thing like
2019-02-07 05:53:15.047 UTC [msp/identity] Sign -> DEBU 006 Sign: digest: 143E4E155F1757BB9987562A28A4901B61615989BDB7B6ACD804FF60B2A15F0A
2019-02-07 05:53:15.047 UTC [grpc] Printf -> DEBU 007 transport: http2Client.notifyError got notified that the client transport was broken read tcp 192.168.64.19:60288->192.168.64.18:7051: read: connection reset by peer.
2019-02-07 05:53:15.048 UTC [grpc] Printf -> DEBU 008 transport: http2Client.notifyError got notified that the client transport was broken unexpected EOF.
2019-02-07 05:53:15.049 UTC [grpc] Printf -> DEBU 009 transport: http2Client.notifyError got notified that the client transport was broken unexpected EOF.
2019-02-07 05:53:15.050 UTC [grpc] Printf -> DEBU 00a transport: http2Client.notifyError got notified that the client transport was broken read tcp 192.168.64.19:60294->192.168.64.18:7051: read: connection reset by peer.
Error: proposal failed (err: rpc error: code = Unavailable desc = transport: write tcp 192.168.64.19:60288->192.168.64.18:7051: use of closed network connection)
And sometimes get an another error that
019-02-07 07:06:38.322 UTC [msp/identity] Sign -> DEBU 005 Sign: digest: D43291FFCD0DE17F5CC33A7DBBB47D043FE83C91EA8514EDCED6AC1D31C0A061
2019-02-07 07:06:38.322 UTC [grpc] Printf -> DEBU 006 transport: http2Client.notifyError got notified that the client transport was broken write tcp 192.168.80.19:56288->192.168.80.18:7051: write: connection reset by peer.
Error: proposal failed (err: rpc error: code = Unavailable desc = transport: write tcp 192.168.80.19:56288->192.168.80.18:7051: write: connection reset by peer)
Thanks in advance.
Fabric : 1.1.0
Os: Ubuntu 16.04

Hyperledger Fabric - Orderer logs show error during broadcast even though the transaction is successful and committed to all peers

Orderer logs show following error(highlighted) during broadcast even though the transaction is successful and committed to all peers:
2018-12-19 13:43:42.724 UTC [policies] Evaluate -> DEBU 997 == Done Evaluating *policies.implicitMetaPolicy Policy /Channel/Writers
2018-12-19 13:43:42.724 UTC [orderer/common/broadcast] Handle -> DEBU 998 [channel: mychannel] Broadcast has successfully enqueued message of type ENDORSER_TRANSACTION from 172.19.0.7:40978
2018-12-19 13:43:42.724 UTC [orderer/common/blockcutter] Ordered -> DEBU 999 Enqueuing message into batch
2018-12-19 13:43:42.724 UTC [orderer/consensus/solo] main -> DEBU 99a Just began 2s batch timer
2018-12-19 13:43:42.730 UTC [grpc] infof -> DEBU 99b transport: loopyWriter.run returning. connection error: desc = "transport is closing"
2018-12-19 13:43:42.730 UTC [orderer/common/broadcast] Handle -> WARN
99c Error reading from 172.19.0.7:40978: rpc error: code = Canceled
desc = context canceled
2018-12-19 13:43:42.731 UTC [orderer/common/server] func1 -> DEBU 99d Closing Broadcast stream
2018-12-19 13:43:44.724 UTC [orderer/consensus/solo] main -> DEBU 99e Batch timer expired, creating block
2018-12-19 13:43:44.724 UTC [msp] GetDefaultSigningIdentity -> DEBU 99f Obtaining default signing identity
Fabric Config: All configs and setup same as specified in Build you First Network tutorial at https://hyperledger-fabric.readthedocs.io/en/release-1.3/build_network.html
Query
What is meant by this error? What does orderer read from cli(IP of cli: 172.19.0.7:40978) during broadcast?

How to resolve Hyperledger Fabric GRPC error on AWS EC2 instances?

It seems as though grpc is using some fairly random ports from my CLI client which I haven't manually opened.
Has anyone else had troubles with Fabric on AWS EC2 in regards to security groups and the firewalled ports? How would one create a relatively safe security group that's open enough to allow for these random grpc ports? Is there a specific port range this CLI client uses?
2018-04-06 13:33:19.399 UTC [grpc] Printf -> DEBU 3a3 transport: http2Server.HandleStreams failed to read frame: read tcp X.X.X.X:7050->X.X.X.X:51502: read: connection reset by peer
2018-04-06 13:33:32.481 UTC [grpc] Printf -> DEBU 3d5 transport: http2Server.HandleStreams failed to read frame: read tcp X.X.X.X:7050->X.X.X.X:51518: read: connection reset by peer
2018-04-06 13:33:44.610 UTC [grpc] Printf -> DEBU 41f transport: http2Server.HandleStreams failed to read frame: read tcp X.X.X.X:7050->X.X.X.X:51522: read: connection reset by peer
Ports 51502, 51518, 51522 referenced above from the orderer logs.
These errors stemmed from a CLI client issuing a ./peer chaincode instantiate command which is failing.
In my case, I got the same error until I opened all ports for outbound connections on my peers.
Try to fix rules for your peer:

Resources