Skip to content

Task manager: Cannot read properties of undefined (reading '_index') #11926

@aHenryJard

Description

@aHenryJard

Description

In some corner case when the workId does not exists updateExpectationsNumber can raise this exception.

Full error:

TypeError: Cannot read properties of undefined (reading '_index')
    at updateExpectationsNumber (/opt/opencti/build/back.js:2114:888)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async sendResultToQueue (/opt/opencti/build/back.js:4065:15946)
    at async /opt/opencti/build/back.js:4065:18934
    at async publish (/opt/opencti/build/back.js:2074:42857)
    at async elList (/opt/opencti/build/back.js:2074:43401)
    at async taskQuery (/opt/opencti/build/back.js:4065:11647)
    at async workerTaskHandler (/opt/opencti/build/back.js:4065:24849)
    at async /opt/opencti/build/back.js:4065:27586

It looks like for some reason currentWork can be undefined here:

await elUpdate(currentWork._index, workId, { script: { source, lang: 'painless', params } });

Environment

  1. OS (where OpenCTI server runs): { e.g. Mac OS 10, Windows 10, Ubuntu 16.4, etc. }
  2. OpenCTI version: { e.g. OpenCTI 1.0.2 }
  3. OpenCTI client: { e.g. frontend or python }
  4. Other environment details:

Reproducible Steps

Steps to create the smallest reproducible scenario:

  1. { e.g. Run ... }
  2. { e.g. Click ... }
  3. { e.g. Error ... }

Expected Output

Actual Output

Additional information

Screenshots (optional)

Metadata

Metadata

Assignees

Labels

buguse for describing something not working as expectedneeds triageuse to identify issue needing triage from Filigran Product team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions