openBackhaul / MicroWaveDeviceInventory

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

Unable to save the cache CC to elastic search for all Ericsson devices #839

Closed Ziabatcha closed 9 months ago

Ziabatcha commented 9 months ago

When MWDI is started to save the CC for cache in ELK, observing below error in docker logs

Package Tag:test_v1.1.1

Logs:

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 '513250011'. 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 '513250011'. 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}
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 '513250011'. 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)
    at IncomingMessage.onEnd (/home/openbackhaul/microWaveDeviceInventory/node_modules/@elastic/elasticsearch/lib/Transport.js:291:11)
    at IncomingMessage.emit (events.js:412:35)
    at endReadableNT (internal/streams/readable.js:1333:12)
    at processTicksAndRejections (internal/process/task_queues.js:82:21) {
  meta: {
    body: { error: [Object], status: 400 },
    statusCode: 400,
    headers: {
      'x-elastic-product': 'Elasticsearch',
      'content-type': 'application/json',
      'content-length': '890'
    },
    meta: {
      context: null,
      request: [Object],
      name: 'elasticsearch-js',
      connection: [Object],
      attempts: 0,
      aborted: false
    }
  }
}
nardecchia-siae commented 9 months ago

The issue was caused by a different return value for a field compared with other vendors. The fix consists in a change of the mapping is ES for that field. This means that the index in ES must be deleted before restarting MWDI application.

Ziabatcha commented 9 months ago

Tested with latest tag [Test_v1.1.2] Able to retrieve the cache for Ericsson devices. Hence closing the issue