n8n icon indicating copy to clipboard operation
n8n copied to clipboard

TheHive node buggy when checking the status of executeAnalyzer

Open martinr103 opened this issue 3 years ago • 0 comments

Hey guys,

these lines of code, in the TheHive.node.ts, are not good:

841: do {
842: 	responseData = await theHiveApiRequest.call(this, 'GET', `/connector/cortex/job/${jobId}`, body, qs);
843: } while (responseData.status === 'Waiting' || responseData.status === 'InProgress');

This produces an infinite loop, and in our environment generates like 31000 GET calls on Thehive within 15 minutes. GET request every fraction of a second. I think you need to find a different way of checking the status of the executeAnalyzer job.

If it has to be a do-while loop, then there should be some kind of delay between subsequent GET calls. And also, the loop break condition probably is not sufficient with (responseData.status === 'Waiting' || responseData.status === 'InProgress') because apparently in some scenarios it never matches - infinite loop. Maybe there are other values possible for responseData.status ?

martinr103 avatar Aug 09 '22 09:08 martinr103