Hyperledger Composer: command composer network start failing - docker

I am trying to deploy a business network using command:
composer network start -c PeerAdmin#hlfv1 -n test-bna -V 0.0.1 -A admin -S adminpw
And it is failing with error:
Error trying to start business network. Error: Failed to connect to
any peer event hubs. It is required that at least 1 event hub has been
connected to receive the commit event.
On checking the composer logs, it says:
2018-11-08T13:30:59.190Z WARN :HLFConnection
:_connectToEventHubs() event hub localhost:7051 failed to connect:
12 UNIMPLEMENTED: unknown service protos.Deliver {}$
2018-11-08T13:31:46.763Z WARN :HLFConnection
:_connectToEventHubs() event hub localhost:7051 failed to connect:
12 UNIMPLEMENTED: unknown service protos.Deliver {}$
Could someone please help with resolving this?

Related

Failed try to connecting metricbeat to elasticsearch and kibana with docker

I am trying to up elasticsearch kibana and metricbeat through docker-compose.
This is the code.
ELK is working fine but metricbeat failed, I am getting this error, and not able to figure out how can i solve this :
MetricBeat Log:
2020-05-09T19:27:03.353Z ERROR pipeline/output.go:100 Failed to connect to backoff(elasticsearch(http://elasticsearch:9200)): Connection marked as failed because the onConnect callback failed: cannot retrieve the elasticsearch license from the /_xpack endpoint, Metricbeat requires the default distribution of Elasticsearch. Please make the endpoint accessible to Metricbeat so it can verify the license.: could not extract license information from the server response: unknown state, received: 'expired'
The license expired but i was hoping it would work without it.

No valid responses from any peers

I am trying the tuna-network example in my local environment. Its working fine without any issues in local GUI palyground (http://localhost:8080/login) and the cloud environment.
Unfortunately, when I tried in the command line I am getting the error
No valid responses from any peers
The commands I have used are below.
blrk#hyperledger:~/tuna-network$ composer network install --card PeerAdmin#hlfv1 --archiveFile tuna-network#0.0.1.bna
✔ Installing business network. This may take a minute...
Successfully installed business network tuna-network, version 0.0.1
blrk#hyperledger:~/tuna-network$ composer network start --card PeerAdmin#hlfv1 --networkAdmin admin --networkAdminEnrollSecret adminpw --networkName tuna-network --networkVersion 0.0.1
Starting business network tuna-network at version 0.0.1
Processing these Network Admins:
userName: admin
✖ Starting business network definition. This may take a minute...
Error: Error trying to start business network. Error: No valid responses from any peers.
Unexpected response of 500. Payload was:
Command failed
composer network start --card PeerAdmin#hlfv1 --networkAdmin admin
--networkAdminEnrollSecret adminpw --networkName tuna-network --networkVersion
0.0.1
That should initialize the chaincode

Hyperledger fabric: Cli Bash isn't able to connect to orderer; chaincodes not instantiating on channel

Error:
error getting broadcast client: orderer client failed to connect to
orderer.example.com:7050: failed to create new connection: context
deadline exceeded
I'm getting this error when trying to start a private collection in Fabric.
Following the docs properly and everything at the basic level seems to work (creating first app, creating first network, and extending first network - have not tried upgrading network parts yet). But as I create the private collections feature, it stops precisely at this step.
This happens when I start the network, go into the peer container using docker exec -it cli bash and instantiate the chaincode on the peer (peer chaincode install -n marblesp -v 1.0 -p github.com/chaincode/marbles02_private/go/) which works.
But when I instantiate it on the channel (peer chaincode instantiate -o orderer.example.com:7050 --tls --cafile $ORDERER_CA -C mychannel -n marblesp -v 1.0 -c '{"Args":["init"]}' -P "OR('Org1MSP.member','Org2MSP.member')" --collections-config $GOPATH/src/github.com/chaincode/marbles02_private/collections_config.json --connTimeout 30s) it produces this error and I dont know how proceed further.
Can someone help me understand what's wrong here or how to get my chaincode instantiated on my channel because I have to get the private collections to work?
Its possible this question is related to some communication between different docker images as my orderer and peer are in different containers. My commands run in the peer container (atleast thats what I think) and its unable to talk to orderer container.
Here are kinematic screenshots:
UPDATE:
This is my command: (peer chaincode instantiate -o orderer.example.com:7050 --tls --cafile $ORDERER_CA -C mychannel -n marblesp -v 1.0 -c '{"Args":["init"]}' -P "OR('Org1MSP.member')" --collections-config $GOPATH/src/github.com/marbles02_private/collections_config.json --connTimeout 30s).
I get this without sudo:
Error: error getting broadcast client: orderer client failed to connect to orderer.example.com:7050: failed to create new connection: context deadline exceeded
and with sudo I get
Error: error getting endorser client for instantiate: endorser client failed to connect to 0.0.0.0:7051: failed to create new connection: context deadline exceeded
and in sudo case, it doesn't even wait 30s, it shows error within ~2 seconds.

use docker container composer-rest-server to generate rest api appears:REQUEST_TIMEOUT

I want to use composer-rest-server to generate rest api.
1,I run composer network ping -c admin#trade-network
the result is :
```The connection to the network was successfully tested: trade-network
Business network version: 0.2.6-20180530153450
Composer runtime version: 0.19.8
participant: org.hyperledger.composer.system.NetworkAdmin#admin
identity: org.hyperledger.composer.system.Identity#8633aef10e9d998be8bec4bb4ab535eb74e3d6832cb21286b89cadf0e95863c5
Command succeeded
2,run `docker run -e COMPOSER_CARD=admin#trade-network -e COMPOSER_NAMESPACES=never --name rest -p 3000:3000 hyperledger/composer-rest-server`
while error appears:
[2018-06-15 08:18:17] PM2 log: Launching in no daemon mode
[2018-06-15 08:18:17] PM2 log: Starting execution sequence in -fork mode- for app name:composer-rest-server id:0
[2018-06-15 08:18:17] PM2 log: App name:composer-rest-server id:0 online
WARNING: NODE_APP_INSTANCE value of '0' did not match any instance config file names.
WARNING: See https://github.com/lorenwest/node-config/wiki/Strict-Mode
Discovering types from business network definition ...
Exception: Error: Error trying to ping. Error: REQUEST_TIMEOUT
Connection fails: Error: Error trying to ping. Error: REQUEST_TIMEOUT
It will be retried for the next request.
Error: Error trying to ping. Error: REQUEST_TIMEOUT
at _checkRuntimeVersions.then.catch (/home/composer/.npm-global/lib/node_modules/composer-rest-server/node_modules/composer-connector-hlfv1/lib/hlfconnection.js:790:34)
at
at process._tickDomainCallback (internal/process/next_tick.js:228:7)
[2018-06-15 08:23:21] PM2 log: App [composer-rest-server] with id [0] and pid [15], exited with code [1] via signal [SIGINT]
[2018-06-15 08:23:21] PM2 log: Starting execution sequence in -fork mode- for app name:composer-rest-server id:0
[2018-06-15 08:23:21] PM2 log: App name:composer-rest-server id:0 online
WARNING: NODE_APP_INSTANCE value of '0' did not match any instance config file names.
WARNING: See https://github.com/lorenwest/node-config/wiki/Strict-Mode
Discovering types from business network definition ...
Connection fails: Error: Error trying to ping. Error: REQUEST_TIMEOUT
It will be retried for the next request.
Exception: Error: Error trying to ping. Error: REQUEST_TIMEOUT
Error: Error trying to ping. Error: REQUEST_TIMEOUT
```
so I want to ask why?
This is a networking issue ... The URL values in your connection.json (part of the "Card") have localhost in them which works fine from the command line of your computer where Docker sets up Port forwarding into the containers of the Fabric. When you use the same card inside a rest container localhost loops back into the container and does not "see" the Fabric.
Step 6 of this tutorial deals with the problem by creating a special restadmin card, and modifying the addresses in the connection.json to 'find' the Fabric - Google Oauth2 Tutorial.
I assume you are already sharing a volume on the docker run command so that the Rest Container can find the folder with the cards. E.g. -v ~/.composer:/home/composer/.composer

peer chaincode deploy -n mycc -c '{"Args": ["init", "a","100", "b", "200"]}' =>Error connecting to 0.0.0.0:7050 due to grpc: timed out when dialing

I'm doing a project on hyperledger fabric and wish to run the chaincode.
but whenever i run this command
"peer chaincode deploy -n mycc -c '{"Args": ["init", "a","100", "b", "200"]}'"
in my GitBash,
It displayed an error i can't resolve.
"Error: Error getting broadcast client: Error connecting to 0.0.0.0:7050 due to grpc: timed out when dialing"
Is it a port issue?
Can anyone help me resolve this issue?
7050 is the port of orderer service try to verify if you have it using docker images fabric-orderer if not use
docker pull ${DOCKER_NS}/fabric-orderer:${ARCH}-${VERSION}
then use orderer start
in my case :
DOCKER_NS=hyperledger
ARCH=x86_64
VERSION=1.0.0-alpha

Resources