fabric fabric-samples/test-network createChannel failed - hyperledger-fabric

I use fabric-samples/test-network ./test-network.sh createChannle command to create a test channle, however a problem occured:
a problem
Error: Post "https://localhost:7053/participation/v1/channels": read tcp 127.0.0.1:57664->127.0.0.1:7053: read: connection reset by peer
after executing this command, my docker is fine:
docker
does anyone know how to solve it?
my docker, fabric, fabric-samples are newest, and my go is 1.18.2

Related

Fail to deploy sample chaincode on Fabric from fabric-samples

I am trying to deploy a sample ChainCode on Fabric test-network. I bring up the network and then I create a channel and then I run this command: ./network.sh deployCC and I get the following error:
Error: chaincode install failed with status: 500 - failed to invoke backing implementation of 'InstallChaincode': could not build chaincode: docker build failed: docker image inspection failed: Get "http://unix.sock/images/dev-peer0.org1.example.com-basic_1.0-4ec191e793b27e953ff2ede5a8bcc63152cecb1e4c3f301a26e22692c61967ad-42f57faac8360472e47cbbbf3940e81bba83439702d085878d148089a1b213ca/json": dial unix /host/var/run/docker.sock: connect: no such file or directory
Chaincode installation on peer0.org1 has failed
Deploying chaincode failed
I'm guessing you are running Docker on a Mac ? Docker made a change in version 2.4.0.0 (I think) and it causes a problem. You need to uncheck the option "use gRPC fuse".
see https://lists.hyperledger.org/g/fabric/topic/77402508?p=Created,,,20,2,0,0::recentpostdate%2Fsticky,,,20,2,0,77402508
for more details
If you are running Docker Desktop on macOS, this problem is caused by a newer version of Docker Desktop for macOS. To resolve this issue, in the Docker Desktop preferences, uncheck the box Use gRPC FUSE for file sharing to use the legacy osxfs file sharing instead and click Apply & Restart.
If you see errors on your create, approve, commit, invoke or query commands, make sure you have properly updated the channel name and chaincode name.

Error deploying Fabric test-network fabcar chaincode

I am following the documentation (https://hyperledger-fabric.readthedocs.io/en/latest/test_network.html) to deploy a test network for Fabric on Ubuntu 16.04 on Amazon Lightsail. All commands have been executed successfully with results as expected until
./network.sh deployCC -l javascript
The following error message is received:
Error: endorsement failure during invoke. response: status:500 message:"error in simulation: failed to execute transaction 2554869d3683a7e77202f448aa201fd2f97243faa4ff5dd4839eb8d3175cf53b: could not launch chaincode fabcar_1:bec08b518fdb2bda0a0fb41a4a6f996a87ba08887583febedbc791cba7e91537: chaincode registration failed: container exited with 0" !!!!!!!!!!!!!!! Invoke execution on peer0.org1 peer0.org2 failed !!!!!!!!!!!!!!!!
Any assistance will be tremendously appreciated.
K
For fabcar sample, you can use startFabric.sh script inside fabcar to deploy chaincode with the language that you want. Specifically run ./startFabric.sh javascript in your case.
This script generally runs ./network.sh with some additional network cleanups.
everything is working as expected now. The issue had been with system sizing - increasing the memory to 4GB RAM fixed it
Thank you everyone for your suggestions.
K
I am assuming that you are doing a fresh installation.First stop all the containers if it's not stop.
docker stop $(docker ps -a -q)
After that remove the unused volume using the command.
docker volume prune
or docker system prune to remove any unused data.
You have to remove the certificates manually(if it's not deleted).First of all execute the ./network.sh down command.Then go into the test-network/organizations and remove the content of peerOrganizations and ordererOrganizations
Then move to the fabric-ca directory and remove the content of org1 ,org2 and ordererOrg, keep in mind that in here you don't have to remove any .yaml file.
And remove the fabcar.tar.gz package in test network.
Now start the network using the commands below:
./network.sh up createChannel -ca -c mychannel -s couchdb -i 2.0.0
./network.sh deployCC -l javascript
I have the same problem with javascript chaincode (it works 2 days ago, having the same error now), but deployCC with golang (weirdly) doesn't have this problem. So if using javascript is not a requirement you can also just run ./network.sh deployCC
Shut down your network. Then start it again. Then create a channel and deploy your chaincode. It will work.
I was getting same error because I created a named channel first and tried to deployed code there with -c. But when I shutdown and performed all steps again with default "mychannel" and it worked fine for me.

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.

Unable to start or upgrade network using Hyperledger Composer 0.19

since the recent upgrade I have trouble to start or deploy changes on my network. The commands : composer network start and composer network upgrade both give me this error message:
Error: Error trying to upgrade business network. Error: No valid responses from any peers. Response from attempted peer comms was an error: Error: REQUEST_TIMEOUT
I saw several posts with the same problem but no clear solution. The same thing is happening on the Playground UI when I want to deploy changes. I verified that I'm not behind a proxy or else. Thanks
Make sure that your peer is on by running docker ps
Check your docker ps list, make sure that there is no same version running to which you are upgrading. If so exist, delete it using
> docker stop containerId
> docker rm containerId
also before creating the archive file do not forget to set new version in package.json or you will get error like:
Error trying install business network. Error: The business network
is already installed on all the peers

Resources