Thanks to visit codestin.com
Credit goes to github.com

Skip to content

New "Required field not defined" error is thrown when getting by keys only indexes #538

@AlexStansfield

Description

@AlexStansfield

Noticed the size of my logs went up about about 50x (no joke).

We have some operations that get thousands of records by an index that is keys only. For every record it spits out an error for every missing required field. For example one request that gets only 200 records, created almost 1000 error messages.

Schema For the Index:

    [ETechIndexes.GET_BY_BATCH]: {
      hash: 'getByBatchPk',
      sort: 'getByBatchSk',
      project: 'keys',
      follow: true,
    },

Error: Required field "companyId" in model "Tech" not defined in table item

{
   "model":"Tech",
   "raw":{
      "sk":"Tech#5c479b58-abb0-4158-bf4e-c2332f44940a",
      "getByBatchPk":"Batch#9d37c4a4-f2d7-48bb-9a0f-96a6c2797627",
      "pk":"Company#908d1390-a9a5-474a-9807-76283d7eb443:Tech",
      "getByBatchSk":"Tech:000000001"
   },
   "params":{
      "parse":true,
      "high":true,
      "index":"getByBatch",
      "follow":false,
      "hidden":true,
      "checked":true
   },
   "field":{
      "type":"string",
      "required":true,
      "name":"companyId",
      "isoDates":true,
      "partial":false,
      "attribute":[
         "companyId"
      ],
      "nulls":false
   }
}

I saw there is a noerror param. Will that turn off all errors or just this "not defined" one? As I still want to catch real errors but currently the size of the logs is starting to cost us money as we pay for Kloudmate by the amount of logs ingested.

Otherwise I might have to revert to an older version until this is resolved.

I do feel like this error shouldn't have just been turned on by default, there could have been some flag to switch it on for now that could have been defaulted to on in a later version once any teething problems were resolved.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfixedIssue has been fixed in the repo

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions