HLF Java SDK - Chaincode instantiation failure


Tomás Peixinho
 

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

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