I am running a private quorum network, and I am trying to call a contract function using web3;
my contract was deployed correctly, and i am able to see it and interact with it. Next is the code i am trying to run to add data to the my contract.
for (let i =51; i<500; i++){
let jsonObj = Array[i];
Cin.deployed().then(
contractInstance=>{
//console.log(web3.fromDecimal(i+2*i))
contractInstance.insertPerson(
web3.fromUtf8(web3.fromDecimal(i+2*i)),
jsonObj["email"]?web3.fromUtf8(jsonObj["email"]):"",
jsonObj["FIRST_NAME"]?web3.fromUtf8(jsonObj["FIRST_NAME"]):"",
jsonObj["LAST_NAME"]?web3.fromUtf8(jsonObj["LAST_NAME"]):"",
...
jsonObj["DECEASED_DT"]?web3.fromUtf8(jsonObj["DECEASED_DT"].toString()):""],
{gas: 9900000, from: web3.eth.accounts[0]}).then(function(v) {
fs.appendFileSync('./Pushed.txt',JSON.stringify(v)+"\n \n");
pushedNumber++;
console.log("pushed "+i +" N: "+pushedNumber);
}).catch(e=>{
console.log("error in "+i);
fs.appendFileSync('./log.txt',"Error form Inserting"+e+"\n \n");
});
}
).catch(e=>{
fs.appendFileSync('./log.txt',"Deployment Error "+e+"\n \n");
})
}
The problem here is when i call these functions i get this error on my geth console :
VM returned with error err="gas uint64 overflow"
I can't understand why is that ? is it because i am sending too many transactions from a single account in small amount of time ?
EDIT :
this is the function that mostly does cause the error
function insertPerson(
bytes32 personAddress,
bytes32 email,
bytes32 fname,
bytes32 lname,
Gender gender,
string image,
Status status,
bytes32[13] details
)
public
returns(uint index)
{
if(isPerson(personAddress)) return;
persons[personAddress].email = email;
persons[personAddress].fname = fname;
persons[personAddress].lname = lname;
persons[personAddress].index = personIndex.push(personAddress)-1;
persons[personAddress].deleted = false;
persons[personAddress].gender = gender;
persons[personAddress].image = image;
persons[personAddress].status = status;
persons[personAddress].RIM.Value = details[0];
persons[personAddress].RIM.ValidationDate = bytes32(now);
persons[personAddress].RIM.ValidationDuration = bytes32(365);
persons[personAddress].RIM.status = Status.Validated;
persons[personAddress].BirthCity.Value = details[1];
persons[personAddress].BirthCity.ValidationDate = bytes32(now);
persons[personAddress].BirthCity.ValidationDuration = bytes32(365);
persons[personAddress].BirthCity.status = Status.Validated;
persons[personAddress].BirthCountry.Value = details[2];
persons[personAddress].BirthCountry.ValidationDate = bytes32(now);
persons[personAddress].BirthCountry.ValidationDuration = bytes32(365);
persons[personAddress].BirthCountry.status = Status.Validated;
persons[personAddress].FatherName.Value = details[3];
persons[personAddress].FatherName.ValidationDate = bytes32(now);
persons[personAddress].FatherName.ValidationDuration = bytes32(365);
persons[personAddress].FatherName.status = Status.Validated;
persons[personAddress].MotherName.Value = details[4];
persons[personAddress].MotherName.ValidationDate = bytes32(now);
persons[personAddress].MotherName.ValidationDuration = bytes32(365);
persons[personAddress].MotherName.status = Status.Validated;
persons[personAddress].Citizenship.Value = details[5];
persons[personAddress].Citizenship.ValidationDate = bytes32(now);
persons[personAddress].Citizenship.ValidationDuration = bytes32(365);
persons[personAddress].Citizenship.status = Status.Validated;
persons[personAddress].Residency.Value = details[6];
persons[personAddress].Residency.ValidationDate = bytes32(now);
persons[personAddress].Residency.ValidationDuration = bytes32(365);
persons[personAddress].Residency.status = Status.Validated;
persons[personAddress].Grade.Value = details[7];
persons[personAddress].Grade.ValidationDate = bytes32(now);
persons[personAddress].Grade.ValidationDuration = bytes32(365);
persons[personAddress].Grade.status = Status.Validated;
persons[personAddress].CorpCountryCode.Value = details[8];
persons[personAddress].CorpCountryCode.ValidationDate = bytes32(now);
persons[personAddress].CorpCountryCode.ValidationDuration = bytes32(365);
persons[personAddress].CorpCountryCode.status = Status.Validated;
persons[personAddress].IntroducedBy.Value = details[9];
persons[personAddress].IntroducedBy.ValidationDate = bytes32(now);
persons[personAddress].IntroducedBy.ValidationDuration = bytes32(365);
persons[personAddress].IntroducedBy.status = Status.Validated;
persons[personAddress].HowIntroduced.Value = details[10];
persons[personAddress].HowIntroduced.ValidationDate = bytes32(now);
persons[personAddress].HowIntroduced.ValidationDuration = bytes32(365);
persons[personAddress].HowIntroduced.status = Status.Validated;
persons[personAddress].website.Value = details[11];
persons[personAddress].website.ValidationDate = bytes32(now);
persons[personAddress].website.ValidationDuration = bytes32(365);
persons[personAddress].website.status = Status.Validated;
persons[personAddress].DeceasedDate.Value = details[12];
persons[personAddress].DeceasedDate.ValidationDate = bytes32(now);
persons[personAddress].DeceasedDate.ValidationDuration = bytes32(365);
persons[personAddress].DeceasedDate.status = Status.Validated;
//persons[personAddress].AttributesStatus["RIM"]= AttributeStatus('');
return(uint(1));
}
The most tthing bugging in this error is that the blockc gets mined and added to the blockchain but the data supposed to be stored doesn't get stored. so i don't get an error through web3 to tell my UI users to retry again. isn't VM error supposed to be errors that actually cancel the transaction ?