cleos get table not working with latest master
running: cleos get table myaccount myaccount mycustomer returns: 1592776ms thread-0 main.cpp:2366 main ] Failed with error: Out of Range (8) read datastream of length 379 over by -23
environment:
- Latest master branch
- Ubuntu VM
issues to repro:
- create myaccount
- create a contract that emplaces a mycustomer struct into db successfully
- call cleos get table myaccount myaccount mycustomer
Your ABI may be wrong?
These are all executed fine respectively and the data is inserted in block.. Could ABI be wrong?
- eosiocpp -o mykyc.wast mykyc.cpp
- eosiocpp -g mykyc.abi mykyc.cpp
- cleos push action myaccount addcustomer '{..all the json here..}' -p myaccount

This types of errors happens to me when: 1 - Publish a contract and emplace some info to table. 2 - Change struct order of fields, datatype of field or remove fields for the same table. 3 - Update contract with the changes.
Probably the layout of the memory allocated before the change does not match the new one (defined in ABI) and the datastream cant parse it correctly.
Yeah I encountered similar problems before. That's why I started with a clean install, clean contract and an empty (--resync) blockchain. In the issue above, neither the contract action params nor the struct is modified by adding or removing a field.
Without the ABI and CPP we cannot debug or validate this error.
@brightermatter Did you add // @abi table before table struct?
yes. here's the table struct:
//@abi table mycustomer i64 struct mycustomer { uint64_t customerId; string companyTitle; string contactAddress; string contactTelephone; string contactFax; uint64_t contactPersonList; uint64_t contactPersonCount; string taxOffice; string taxNumber; string applicationReason; uint64_t createdByCompanyId; uint64_t createdByUserId; string contactEmail; string corporateWebsite; string headquarterAddress; string fieldOfActivity; string statusOfActivity; string commercialRegistryOffice; string commercialRegistryNumber; string registryDate; string foundationDate; string termOfCompany; uint64_t status; time customerCreationDate; time customerUpdateDate; uint64_t primary_key() const { return customerId; } uint64_t by_companyTitle() const { return N(companyTitle); } uint64_t by_taxNumber() const { return N(taxNumber); } uint64_t by_createdByCompanyId() const { return createdByCompanyId; } uint64_t by_commercialRegistryNumber() const { return N(commercialRegistryNumber); } uint64_t by_foundationDate() const { return N(foundationDate); } EOSLIB_SERIALIZE(mycustomer, (customerId)(companyTitle)(contactAddress)(contactTelephone)(contactFax)(contactPersonList)(contactPersonCount)(taxOffice)(taxNumber)(applicationReason)(applicationReason)(createdByCompanyId)(createdByUserId)(contactEmail)(corporateWebsite)(headquarterAddress)(fieldOfActivity)(statusOfActivity)(commercialRegistryOffice)(commercialRegistryNumber)(registryDate)(foundationDate)(termOfCompany)(status)(customerCreationDate)(customerUpdateDate)) };
and there goes the abi:
{ "____comment": "This file was generated by eosio-abigen. DO NOT EDIT - 2018-05-17T15:24:00", "types": [{ "new_type_name": "time", "type": "uint32" } ], "structs": [{ "name": "mycustomer", "base": "", "fields": [{ "name": "customerId", "type": "uint64" },{ "name": "companyTitle", "type": "string" },{ "name": "contactAddress", "type": "string" },{ "name": "contactTelephone", "type": "string" },{ "name": "contactFax", "type": "string" },{ "name": "contactPersonList", "type": "uint64" },{ "name": "contactPersonCount", "type": "uint64" },{ "name": "taxOffice", "type": "string" },{ "name": "taxNumber", "type": "string" },{ "name": "applicationReason", "type": "string" },{ "name": "createdByCompanyId", "type": "uint64" },{ "name": "createdByUserId", "type": "uint64" },{ "name": "contactEmail", "type": "string" },{ "name": "corporateWebsite", "type": "string" },{ "name": "headquarterAddress", "type": "string" },{ "name": "fieldOfActivity", "type": "string" },{ "name": "statusOfActivity", "type": "string" },{ "name": "commercialRegistryOffice", "type": "string" },{ "name": "commercialRegistryNumber", "type": "string" },{ "name": "registryDate", "type": "string" },{ "name": "foundationDate", "type": "string" },{ "name": "termOfCompany", "type": "string" },{ "name": "status", "type": "uint64" },{ "name": "customerCreationDate", "type": "time" },{ "name": "customerUpdateDate", "type": "time" } ] },{ "name": "addcustomer", "base": "", "fields": [{ "name": "account", "type": "account_name" },{ "name": "customerId", "type": "uint64" },{ "name": "companyTitle", "type": "string" },{ "name": "contactAddress", "type": "string" },{ "name": "contactTelephone", "type": "string" },{ "name": "contactFax", "type": "string" },{ "name": "taxOffice", "type": "string" },{ "name": "taxNumber", "type": "string" },{ "name": "applicationReason", "type": "string" },{ "name": "createdByCompanyId", "type": "uint64" },{ "name": "createdByUserId", "type": "uint64" },{ "name": "contactEmail", "type": "string" },{ "name": "corporateWebsite", "type": "string" },{ "name": "headquarterAddress", "type": "string" },{ "name": "fieldOfActivity", "type": "string" },{ "name": "statusOfActivity", "type": "string" },{ "name": "commercialRegistryOffice", "type": "string" },{ "name": "commercialRegistryNumber", "type": "string" },{ "name": "registryDate", "type": "string" },{ "name": "foundationDate", "type": "string" },{ "name": "termOfCompany", "type": "string" },{ "name": "status", "type": "uint64" } ] },{ "name": "updcustomer", "base": "", "fields": [{ "name": "account", "type": "account_name" },{ "name": "customerId", "type": "uint64" },{ "name": "companyTitle", "type": "string" },{ "name": "contactAddress", "type": "string" },{ "name": "contactTelephone", "type": "string" },{ "name": "contactFax", "type": "string" },{ "name": "taxOffice", "type": "string" },{ "name": "taxNumber", "type": "string" },{ "name": "applicationReason", "type": "string" },{ "name": "createdByCompanyId", "type": "uint64" },{ "name": "createdByUserId", "type": "uint64" },{ "name": "contactEmail", "type": "string" },{ "name": "corporateWebsite", "type": "string" },{ "name": "headquarterAddress", "type": "string" },{ "name": "fieldOfActivity", "type": "string" },{ "name": "statusOfActivity", "type": "string" },{ "name": "commercialRegistryOffice", "type": "string" },{ "name": "commercialRegistryNumber", "type": "string" },{ "name": "registryDate", "type": "string" },{ "name": "foundationDate", "type": "string" },{ "name": "termOfCompany", "type": "string" },{ "name": "status", "type": "uint64" } ] },{ "name": "delcustomer", "base": "", "fields": [{ "name": "account", "type": "account_name" },{ "name": "customerId", "type": "uint16" } ] },{ "name": "rmvcustomer", "base": "", "fields": [{ "name": "account", "type": "account_name" },{ "name": "customerId", "type": "uint16" } ] },{ "name": "findcustomer", "base": "", "fields": [{ "name": "customerId", "type": "uint64" },{ "name": "kapId", "type": "string" },{ "name": "companyTitle", "type": "string" },{ "name": "taxNumber", "type": "string" },{ "name": "createdByCompanyId", "type": "uint64" },{ "name": "commercialRegistryNumber", "type": "string" },{ "name": "foundationDate", "type": "string" } ] } ], "actions": [{ "name": "addcustomer", "type": "addcustomer", "ricardian_contract": "" },{ "name": "updcustomer", "type": "updcustomer", "ricardian_contract": "" },{ "name": "delcustomer", "type": "delcustomer", "ricardian_contract": "" },{ "name": "rmvcustomer", "type": "rmvcustomer", "ricardian_contract": "" },{ "name": "findcustomer", "type": "findcustomer", "ricardian_contract": "" } ], "tables": [{ "name": "mycustomer", "index_type": "i64", "key_names": [ "customerId" ], "key_types": [ "uint64" ], "type": "mycustomer" } ], "ricardian_clauses": [] }
Having same issue after resync and redeploying
Thanks,
EOSLIB_SERIALIZE(mycustomer, (customerId)(companyTitle)(contactAddress)(contactTelephone)(contactFax)(contactPersonList)(contactPersonCount)(taxOffice)(taxNumber)(applicationReason)****(applicationReason)(createdByCompanyId)(createdByUserId)(contactEmail)(corporateWebsite)(headquarterAddress)(fieldOfActivity)(statusOfActivity)(commercialRegistryOffice)(commercialRegistryNumber)(registryDate)(foundationDate)(termOfCompany)(status)(customerCreationDate)(customerUpdateDate))
applicationReason is duplicated in the EOSLIB_SERIALIZE layout.