openBackhaul / MicroWaveDeviceInventory

Physical and logical inventory of the MW SDN Domain
Apache License 2.0
5 stars 1 forks source link

[DataStructure] observing Elasticsearch error type:mapper_parsing_exception #946

Open Ziabatcha opened 6 months ago

Ziabatcha commented 6 months ago

When new yang is delivered for Ericsson device, MWDI unable to save the cache into existing index entry. Manually we need to delete the index and need to recreate.

Version: 1.1.2.a_impl Logs:

[24.04.2024 06:26.52.016] [ERROR] Elasticsearch error occurred: {"error":{"root_cause":[{"type":"mapper_parsing_exception","reason":"failed to parse field [core-model-1-4:control-construct.backup-and-restore-1-0:backup-and-restore-pac.backup-and-restore-status.ready-for-starting-new-operation] of type [boolean] in document with id '529554222B'. Preview of field's value: 'backup-and-restore-1-0:READINESS_STATUS_TYPE_READY'"}],"type":"mapper_parsing_exception","reason":"failed to parse field [core-model-1-4:control-construct.backup-and-restore-1-0:backup-and-restore-pac.backup-and-restore-status.ready-for-starting-new-operation] of type [boolean] in document with id '529554222B'. Preview of field's value: 'backup-and-restore-1-0:READINESS_STATUS_TYPE_READY'","caused_by":{"type":"illegal_argument_exception","reason":"Failed to parse value [backup-and-restore-1-0:READINESS_STATUS_TYPE_READY] as only [true] or [false] are allowed."}},"status":400}
[24.04.2024 06:26.52.016] [ERROR] ResponseError: mapper_parsing_exception: [mapper_parsing_exception] Reason: failed to parse field [core-model-1-4:control-construct.backup-and-restore-1-0:backup-and-restore-pac.backup-and-restore-status.ready-for-starting-new-operation] of type [boolean] in document with id '529554222B'. Preview of field's value: 'backup-and-restore-1-0:READINESS_STATUS_TYPE_READY'
    at onBody ([/home/openbackhaul/microWaveDeviceInventory/node_modules/@elastic/elasticsearch/lib/Transport.js:367:23](mailto:/home/openbackhaul/microWaveDeviceInventory/node_modules/@elastic/elasticsearch/lib/Transport.js:367:23))
    at IncomingMessage.onEnd ([/home/openbackhaul/microWaveDeviceInventory/node_modules/@elastic/elasticsearch/lib/Transport.js:291:11](mailto:/home/openbackhaul/microWaveDeviceInventory/node_modules/@elastic/elasticsearch/lib/Transport.js:291:11))
    at IncomingMessage.emit (node:events:525:35)
    at endReadableNT (node:internal/streams/readable:1358:12)
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  meta: {
    body: { error: [Object], status: 400 },
    statusCode: 400,
    headers: {
      'x-elastic-product': 'Elasticsearch',
      warning: '299 Elasticsearch-7.14.2-6bc13727ce758c0e943c3c21653b3da82f627f75 "Elasticsearch built-in security features are not enabled. Without authentication, your cluster could be accessible to anyone. See https://www.elastic.co/guide/en/elasticsearch/reference/7.14/security-minimal-setup.html to enable security."',
      'content-type': 'application/json; charset=UTF-8',
      'content-length': '892'
    },
    meta: {
      context: null,
      request: [Object],
      name: 'elasticsearch-js',
      connection: [Object],
      attempts: 0,
      aborted: false
    }
  }
}
Ziabatcha commented 5 months ago

With 1.1.2d , we are still seeing this Issue after Ericsson Mediator upgrade. We tried to re-deploy with new index , but still unable to retrievd the mwdi cache for Ericsson devices. logs_946.txt

kmohr-soprasteria commented 5 months ago

The MWDI should just take what it gets from the Controller and store it in ElasticSearch as long as the highlevel structure of the CC matches the schema provided in the MWDI OAS.

However, at the moment this is not possible, if the CC contains an unexpected data structure (e.g. due to new object model on some mediators). (Easy typecasts from e.g. String to Int are no problem). This is a shortcoming of ElasticSearch.

Next steps:

MartinSunal commented 5 months ago

if such cases (the same property has different types) are expected then different DB should be used to store data - NoSQL DB like MongoDB or SQL DB like PostgreSQL with JSONB column type, etc.

kmohr-soprasteria commented 5 months ago

Info_946.docx