1

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

klew
  • 33
  • 1
  • 7
  • can you please share the command to deploy the test-network,did you change the channel name or the chaincode name in the script? – Shubham Jaiswal Jun 18 '20 at 08:26
  • The command used was: `./network.sh deployCC -l javascript`. No changes to the script, channel or chaincode names made. – klew Jun 18 '20 at 08:52
  • Can you shut down the network and make sure you removed the volume and certificates.And also remove the chaincode package which was created. – Shubham Jaiswal Jun 18 '20 at 09:03
  • Executed `./network.sh down` before restarting from `./network.sh up`. Same result. – klew Jun 18 '20 at 09:13
  • which image version you are using of fabric and have you removed the volumes and certificates manually (not with the script). – Shubham Jaiswal Jun 18 '20 at 10:55
  • I am on version 2.1.1. After executing `./network.sh down`, there are no more containers listed using `docker ps -a`. Where are these volumes and certificates located? – klew Jun 19 '20 at 00:47

5 Answers5

1

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.

Dereck Luo
  • 11
  • 1
  • I got this error: - `Error: error getting endorser client for channel: endorser client failed to connect to localhost:9051: failed to create new connection: connection error: desc = "transport: error while dialing: dial tcp 127.0.0.1:9051: connect: connection refused"` – klew Jun 19 '20 at 01:21
1

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

klew
  • 33
  • 1
  • 7
  • Hi I have this error: rror: chaincode install failed with status: 500 - failed to invoke backing implementation of 'InstallChaincode': chaincode already successfully installed. Do you really solved it by system sizing? – user3582228 Sep 25 '20 at 03:11
0

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
Shubham Jaiswal
  • 570
  • 5
  • 11
  • Thank you for the steps. They were all executed successfully prior to starting the network. `./network.sh up createChannel -ca -c mychannel -s couchdb -i 2.0.0` was changed to `./network.sh up createChannel -ca -c mychannel -s couchdb -i 2.1.1` to match my version. The execution was successful. Upon executing `./network.sh deployCC -l javascript`, the following error was encountered `Error: chaincode install failed with status: 500 - failed to invoke backing implementation of 'InstallChaincode': could not build chaincode: docker build failed` – klew Jun 19 '20 at 10:31
0

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

aqid
  • 36
  • 4
  • Thank you for the suggestion. Unfortunately, it terminated with the same error as the javascript chaincode: `Error: chaincode install failed with status: 500 - failed to invoke backing implementation of 'InstallChaincode': could not build chaincode: docker build failed `. – klew Jun 19 '20 at 10:39
  • have you tried resetting the fabric environment? Starting from the beginning of downloading fabric? That's what I did this morning – aqid Jun 19 '20 at 14:47
  • Yes, that didn't help much but let me try it again and I'll let you know if I get a different response today. – klew Jun 20 '20 at 04:27
  • Unfortunately, still no joy. I started from a fresh machine and that didn't help either. If only there was a way to understand what the errors are. – klew Jun 20 '20 at 06:39
  • you can change the docker compose configuration for container logging with either `- FABRIC_LOGGING_SPEC=DEBUG` or `- FABRIC_LOGGING_SPEC=WARN:cauthdsl=info:policies=debug:msp=info` and edit as you see fit. then you can check peer container for the state before the error – aqid Jun 21 '20 at 21:47
  • Thanks. Prior to the error, the following warning was intercepted - `could not launch chaincode 'fabcar_1:8140de38824ed03c21f9078a4f24d27a43912b6f26abdf01f5c92a28a800d264': chaincode registration failed: container exited with 0`. I tried to Google it but wasn't able to find anything useful. Do you have any insights? – klew Jun 22 '20 at 02:01
  • check your stopped fabcar container `docker ps --filter "status=exited"` and see the logs inside of that said container – aqid Jun 22 '20 at 08:24
  • Executing that command yielded no results, i.e., no containers returned. – klew Jun 22 '20 at 11:04
  • there's an ongoing discussions here as well https://chat.hyperledger.org/channel/fabric and they're fixing it – aqid Jun 22 '20 at 18:13
0

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.

  • 1
    Could you format your answer a bit differently? Instead of saying "deployed with -c", replicate your command and use backticks to format the code `mycommand -c`. Also try using numbered steps to visually simplify your solution. – Lenna Nov 06 '20 at 15:20