Description
openedon Jan 19, 2021
Description
Deleting a label that is used will not remove its references from reports, causing errors when reports are listed in the frontend.
Statistics on the Dashboard are also affected as referenced label does not exist
Environment
- OS: Ubuntu 18.04.5 LTS
- OpenCTI version: 4.0.7
- OpenCTI client: frontend
- Other environment details: Running in Docker Stack on Docker 20.10.2, build 2291f61
Reproducible Steps
Steps to create the smallest reproducible scenario:
- Go to "Settings"→"Labels & Attributes" in the web frontend
- Click the dots and click "delete"
- Go to "Activities"→"Analysis"
- Go to "Dashboard"
Expected Output
Label should be deleted along with references to it.
Reports should be visible under Analysis, but now without the deleted tag.
Dashboard widget for "Top labels" should reflect labels except those deleted.
Actual Output
Step 3 is giving error message in the frontend: "An unknown error occurred. Please contact your administrator or the OpenCTI maintainers."
Step 4: Dashboard struggles to load widget for "Top labels" (and possibly "Top Active Entities"). The page keeps reloading every second.
Additional information
Docker log entry from opencti_opencti container after attempting to load the "Analysis" page in the frontend:
opencti_opencti.1.yww3ckzxusp1@hostname | {"user":{"ip":"::****:*.*.*.*","user_id":"************"},"type":"READ_ERROR","operation_query":"query ReportsLinesPaginationQuery($search:String$count:Int!$cursor:ID$orderBy:ReportsOrdering$orderMode:OrderingMode$filters:[ReportsFiltering]){...ReportsLines_data_2wN0PW}fragment ReportLine_node on Report{id name published x_opencti_report_status createdBy{__typename ...on Identity{__isIdentity:__typename id name entity_type}}objectMarking{edges{node{id definition x_opencti_color}}}objectLabel{edges{node{id value color}}}}fragment ReportsLines_data_2wN0PW on Query{reports(search:$search first:$count after:$cursor orderBy:$orderBy orderMode:$orderMode filters:$filters){edges{node{id name published createdBy{__typename ...on Identity{__isIdentity:__typename id name entity_type}}objectMarking{edges{node{id definition}}}...ReportLine_node __typename}cursor}pageInfo{endCursor hasNextPage globalCount}}}","inner_relation_creation":0,"operation":"ReportsLinesPaginationQuery","time":53,"variables":{"search":"","count":25,"cursor":null,"orderBy":"published","orderMode":"desc","filters":[{"key":"report_types","values":["MISP Event"],"operator":"eq"}]},"size":154,"error":{"stacktrace":["Error: Cannot return null for non-nullable field LabelEdge.node.","at completeValue (/opt/opencti/node_modules/graphql/execution/execute.js:561:13)","at resolveField (/opt/opencti/node_modules/graphql/execution/execute.js:474:19)","at executeFields (/opt/opencti/node_modules/graphql/execution/execute.js:294:18)","at collectAndExecuteSubfields (/opt/opencti/node_modules/graphql/execution/execute.js:749:10)","at completeObjectValue (/opt/opencti/node_modules/graphql/execution/execute.js:739:10)","at completeValue (/opt/opencti/node_modules/graphql/execution/execute.js:592:12)","at /opt/opencti/node_modules/graphql/execution/execute.js:626:25","at from (<anonymous>)","at completeListValue (/opt/opencti/node_modules/graphql/execution/execute.js:613:49)","at completeValue (/opt/opencti/node_modules/graphql/execution/execute.js:574:12)","at resolveField (/opt/opencti/node_modules/graphql/execution/execute.js:474:19)","at executeFields (/opt/opencti/node_modules/graphql/execution/execute.js:294:18)","at collectAndExecuteSubfields (/opt/opencti/node_modules/graphql/execution/execute.js:749:10)","at completeObjectValue (/opt/opencti/node_modules/graphql/execution/execute.js:739:10)","at completeValue (/opt/opencti/node_modules/graphql/execution/execute.js:592:12)","at /opt/opencti/node_modules/graphql/execution/execute.js:471:16"]},"level":"error","message":"API Call","timestamp":"2021-01-19T14:33:43.528Z"}