Re: HLF Java SDK - Chaincode instantiation failure


Matthew White
 

Hello;
 
I run a very simple setup; VirtualBox on Windows 10, with Ubuntu (though trying Manjaro as well).   Docker does take a lot of memory so it was a good idea to check that. 
 
For scenarios such as this, I'd always suggest monitoring all the docker containers - specifically try and catch the docker container that is run to build the chaincode; this only has a short life - but often provides a useful clue as to problems.
 
I would recommend something like this  https://gist.github.com/mbwhite/a32abc57a0a45ecc466977ceef67df1f  (using Logspout).. Start monitoring as soon as Fabric has started and see what occurs.
 
Also, could you link to which specific tutorial you're using?  Thanks!
 
Regards, Matthew.
Matthew B White  IBM Blockchain Solutions Architect
 
Email me at WHITEMAT@...
Find me on StackOverflow, and generally at  calanais.me.uk
 
Note: restricted availability for meetings 14:30 to 17:00 UK Tuesday 
IBM United Kingdom Limited, Hursley Park, Winchester, Hampshire, SO21 2JN

"The wrong answers are the ones you go looking for when the right answers stare you in the face"
 
 
 
----- Original message -----
From: "Tomás Peixinho" <tom.peixinho@...>
Sent by: fabric@...
To: "hyperledger-fabric@..." <hyperledger-fabric@...>
Cc:
Subject: [EXTERNAL] [Hyperledger Fabric] HLF Java SDK - Chaincode instantiation failure
Date: Tue, Jan 14, 2020 9:43 PM
 
 
Good evening,
 
I'm using the java sdk to work with hyperledger fabric and I'm having some trouble. I'm trying to write my own application based on the "fabcar" example that is provided.
 
I'm running a virtual machine (VirtualBox, in case it matters) with a linux distribution, I follow all the steps from the tutorial on github, but when it gets to the point that needs to run DeployInstantiateChaincode.java (to deploy the chaincode on the peers and instantiate it on the channel, if I'm not mistaken), the "deployment" gives a SUCCESS message for each of the peers (peer 0 and 1 on org 1, and peer 0 and 1 on org 2, which is the default for the tutorial), however the "instantiation" always gives a FAILURE message. 
 
I tried it on Xubuntu, Lubuntu and Kali. Never works. I thought it could be a memory problem so I increased the ram, I tried increasing the timeouts on the config file, but still nothing works. A friend of mine tried to run it on his computer (the exact same code, the same structure, he even used the same .sh file that I wrote to run all the terminal commands) and it works sometimes (he's using Kali on VMWare, it's the only difference). Could it be a problem with my computer? Could it be that it is too slow to manage to instantiate the chaincode in time, before it gives the timeouts? Below are the lines that print on the terminal. Not very explanatory but it's what I get:
 
Jan 14, 2020 3:47:04 PM main.java.org.example.client.FabricClient deployChainCode
INFO: Deploying chaincode fabcar using Fabric client Org1MSP admin
Jan 14, 2020 3:47:04 PM main.java.org.example.network.DeployInstantiateChaincode main
INFO: fabcar- Chain code deployment SUCCESS
Jan 14, 2020 3:47:04 PM main.java.org.example.network.DeployInstantiateChaincode main
INFO: fabcar- Chain code deployment SUCCESS
Jan 14, 2020 3:47:04 PM main.java.org.example.client.FabricClient deployChainCode
INFO: Deploying chaincode fabcar using Fabric client Org2MSP admin
Jan 14, 2020 3:47:04 PM main.java.org.example.network.DeployInstantiateChaincode main
INFO: fabcar- Chain code deployment SUCCESS
Jan 14, 2020 3:47:04 PM main.java.org.example.network.DeployInstantiateChaincode main
INFO: fabcar- Chain code deployment SUCCESS
Jan 14, 2020 3:47:04 PM main.java.org.example.client.ChannelClient instantiateChainCode
INFO: Instantiate proposal request fabcar on channel mychannel with Fabric client Org2MSP admin
Jan 14, 2020 3:47:04 PM main.java.org.example.client.ChannelClient instantiateChainCode
INFO: Instantiating Chaincode ID fabcar on channel mychannel
Jan 14, 2020 3:48:13 PM main.java.org.example.client.ChannelClient instantiateChainCode
INFO: Chaincode fabcar on channel mychannel instantiation java.util.concurrent.CompletableFuture@55787112[Completed exceptionally: java.lang.IllegalArgumentException: The proposal responses have 0 inconsistent groups with 4 that are invalid. Expected all to be consistent and none to be invalid.]
Jan 14, 2020 3:48:13 PM main.java.org.example.network.DeployInstantiateChaincode main
INFO: fabcar- Chain code instantiation FAILURE
Jan 14, 2020 3:48:13 PM main.java.org.example.network.DeployInstantiateChaincode main
INFO: fabcar- Chain code instantiation FAILURE
Jan 14, 2020 3:48:13 PM main.java.org.example.network.DeployInstantiateChaincode main
INFO: fabcar- Chain code instantiation FAILURE
Jan 14, 2020 3:48:13 PM main.java.org.example.network.DeployInstantiateChaincode main
INFO: fabcar- Chain code instantiation FAILURE
 
I honestly don't understand what I'm doing wrong. I do everything on the tutorials. I think the first time I tried running it, it worked, but all the other consecutive runs didn't. I need to deploy and instantiate the chaincode in order to test my application. I don't know what else to do. I might format my computer and try again, not sure if it'll work or not... My pc is an Asus Intel Core I7, with 8GB of ram, in case it matters. Any help would be appreciated. This is my thesis project and I can't seem to finish it.
 
Thank you for any help that can be provided.
 
Best regards
 
Tomás
 
Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU

Join fabric@lists.hyperledger.org to automatically receive all group messages.