Hyperledger fabric2.0 peer lifecycle chaincode approveformyorg Error: timed out waiting for txid on all peers - hyperledger-fabric

The config looks good, and I can successfully run package and install. However, approveformyorg return this error: timed out waiting for txid on all peers.
I don't know how to debug this error. I have tried to change some environment variables (like CORE_PEER_TLS_ROOTCERT_FILE, CORE_PEER_MSPCONFIGPATH).
Is it a network error? Or is the order set wrong?
Thanks for your help!
Running picture

I have encountered the same problem。The reason for my problem is that the DNS Server in Docker cannot resolve the domain name of the orderer node。It does not use the DNS settings in /etc/hosts。So the peer node can not connect to the ordering service to receive the blockWhen you check the log of the peer node, you will find that there is no such host.
Therefore, I added extra_hosts to the docker-compose.yaml files of all nodes(include orderer nodes).The document is https://docs.docker.com/compose/compose-file/compose-file-v2/ .Next I deleted and rebuilt all services。Now it has worked.

This happend to me when my order and my peer wasn't able to interract with each other.
Take a look at your peer and orderer logs to check if their is no network error.

Related

Hyperledger Fabric: CreateChannel Issue version-2

fabric fabric-samples/test-network createChannel failed
[1]: https://i.stack.imgur.com/tJLk3.png
At the point of failure, it can't connect to 7050, which is the port for the orderer node. If you do a docker ps it should at least tell you if that peer is currently running and that it really is available on that port. Are the YAML files exactly as you found them or did you make any amendments? Configuration is sometimes the biggest culprit if you are not careful about managing the changes.

BNA install request timeout

So I've started hyperledger fabric following this tutorial:
https://medium.com/coinmonks/hyperledger-fabric-cluster-on-multiple-hosts-af093f00436
Everything seems to be working fine, but now I want to install my bna on it.
I do it using command:
composer network install --card PeerAdmin#hlfv1 --archiveFile my-network#0.0.1.bna
But after some time I get request time out error:
Error: Error trying install business network. Error: No valid responses from any peers.
Response from attempted peer comms was an error: Error: REQUEST_TIMEOUT
Command failed
I've tried adding this to my peer's environment:
- CORE_CHAINCODE_STARTUPTIMEOUT=1200s
However, it seems that it had no effect and timeout occurs earlier than 1200s after the launch of command.
Also, I checked all of my container's docker logs but didn't find any errors.
I guess for some reason timeout time is either not being increased or there's some connection error while installing the network.
I expect bna to be installed just as in the tutorial. To be clear, if I install network as in the tutorial, everything works just fine, but now I need hyperledger fabric to run in different machines and use different peers.
Hyperledger composer can't connect to the hyperledger fabric network.
I also had a lot of these issues.
My tip: Restart everything and try again.
This often resolves the problem. Hope this helps.
Happy coding :)
As a note, Composer is all but dead. We are no longer actively maintaining, or developing it. So changes to the Fabric codebase can have negative effects against Composer.

Composer network install: ERROR no valid responses from any peers

I'm working on the hyperledger blockchain on Ubuntu 18-04 LTS via this tuto hyperledger.github.io/composer/latest/tutorials/developer-tutorial . I have installed all the pre-requisites and in this step of running "composer network install", I faced this issue and tried some solutions but still not working.
Any help please ? Thanks !
~/tutorial-network$ composer network install --card PeerAdmin#hlfv1 --archiveFile tutorial-network#0.0.1.bna
✖ Installing business network. This may take a minute...
Error: Error trying install business network. Error: No valid responses from any peers.
Response from attempted peer comms was an error: Error: Failed to connect before the deadline
Command failed
Docker ps and version
your fabric network is not running.
go to your fabric-dev-servers folder and run ./startFabric.sh
if you get any errors there, like some containers already exist then do a ./teardownFabric.sh first then run the start command again.
This will give you a basic running network with one org, one peer and one orderer.
Once your network is running then you need to create your admin card by running ./createPeerAdminCard.sh
only at this point you are ready to install and start your chaincode.
Just mentioning this for others who might face this issue - While in your case fabric network was not running, in my case it was an issue with proxy. Once I cleared that, I was able to deploy successfully.

Error: failed to create deliver client: orderer client failed to connect to orderer: failed to create new connection: context deadline exceeded

I have been following the tutorial of Hyperledger Fabric Multi-Org setup and I was able to do it successfully. Now I want to customise it according to the name of the organization that I want to and I encountered below error when I was try to up the network. Hope someone could help me identify the problem. Thanks in advance.
it might be possible due to: TLS-connection problem, Connection problem (peer does not see orderer).
Check the peer's logs in debug mode.
docker logs <peer_container_id>
I hit the similar error "context deadline exceeded".
My env is
host: ubuntu 16,
native docker: peer containers and an order container running on the host
no virtual machine.
Running commands on the host.
Change
export CORE_PEER_ADDRESS=peer0.org1.example.com:7051
peer channel join -o $ORDERER_ADDRESS -b $CHANNEL_BLOCK
to
export CORE_PEER_ADDRESS=localhost:7051
peer channel join -o $ORDERER_ADDRESS -b $CHANNEL_BLOCK
Fixed the error.
The way to locate the cause is checking if you can reach the addresses(orderer / peer) on the same terminal running the commands. Hope it helps.
In my case, there was some issue with the firewall (uft ubuntu).
I dissabled it an it worked.
However, I recommend you to check which ports you should open.

Hyperledger Fabric CLI docker container

I have couple a questions regarding HF CLI docker container and some of CLI commands.
First of all, can someone explain the purpose of this container in context of docker container which is started alongside other docker containers required for HF ecosystem. How can I for example query my business network organisations, different peers, and chain-code status on those peers?
Second of all, when I install a chain code issuing peer chaincode install CLI command, to which peer is that code installed (if i have 5 peers attached to org1.example.com organisation, on which peer aforementioned command will install the targeted chain code)?
And third of all, if I have just one organization in my business network specification which handles multiple peers and channels, when I try to instantiate the installed code issuing peer chaincode instantiate command, how to specify the endorsement policy (http://hyperledger-fabric.readthedocs.io/en/latest/endorsement-policies.html) which has just one organisation in endorsement expression after the -P parameter?
Thank you for your help!
EDIT 1:
Just one update regarding 3rd answer. In you have one organisation maintaining peers and channels when instantiating chaincode, you can omit the endorsing policy parameter (-p). In that case transaction will be endorsed if any peer endorses it
Lots of great questions.
the "cli" container's purpose is to run a peer process as a CLI . It is a bit confusing that the same process is both a client and a server, we may change that. Basically, when you run the peer chaincode commands, you are running the CLI. The peer node commands are the server commands. The cli container in our samples runs a script (scripts/script.sh) which in turn executes a series of CLI commands against the peer nodes.
If you examine scripts/script.sh, you will find a setGlobals function that sets a few environment variables, including CORE_PEER_ADDRESS. This is the peer (server) to which the peer (CLI) will communicate when installing the chaincode.
Actually, after further research, this is not possible, unfortunately. The gate syntax isn't yet implemented. You would need to simulate multiple orgs for this.
Re the second part of this question.
Entering the CLI
docker exec -it cli bash
The bootstrapped peer for CLI is peer0.org1.example.com
Check which PEER you are on:
echo $CORE_PEER_ADDRESS
returns
peer0.org1.example.com:7051
Change to peer1.org1:
export CORE_PEER_ADDRESS=peer1.org1.example.com:8051
Also applies to LOCALMSPID, MSPCONFIGPATH, etc

Resources