mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
fix(core): Prevent app crashes because of unhandled promises in poll and trigger nodes (#6278)
fixes https://community.n8n.io/t/n8n-server-container-after-read-econnreset-and-write-epipe-errors-in-imap-version-2-node/24012
This commit is contained in:
parent
be5d3264ad
commit
37506050c3
|
@ -651,9 +651,10 @@ export class ActiveWorkflowRunner {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
returnFunctions.__emitError = async (error: ExecutionError): Promise<void> => {
|
returnFunctions.__emitError = (error: ExecutionError): void => {
|
||||||
await createErrorExecution(error, node, workflowData, workflow, mode);
|
void createErrorExecution(error, node, workflowData, workflow, mode).then(() => {
|
||||||
this.executeErrorWorkflow(error, workflowData, mode);
|
this.executeErrorWorkflow(error, workflowData, mode);
|
||||||
|
});
|
||||||
};
|
};
|
||||||
return returnFunctions;
|
return returnFunctions;
|
||||||
};
|
};
|
||||||
|
@ -707,7 +708,7 @@ export class ActiveWorkflowRunner {
|
||||||
executePromise.catch(Logger.error);
|
executePromise.catch(Logger.error);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
returnFunctions.emitError = async (error: Error): Promise<void> => {
|
returnFunctions.emitError = (error: Error): void => {
|
||||||
Logger.info(
|
Logger.info(
|
||||||
`The trigger node "${node.name}" of workflow "${workflowData.name}" failed with the error: "${error.message}". Will try to reactivate.`,
|
`The trigger node "${node.name}" of workflow "${workflowData.name}" failed with the error: "${error.message}". Will try to reactivate.`,
|
||||||
{
|
{
|
||||||
|
@ -719,7 +720,7 @@ export class ActiveWorkflowRunner {
|
||||||
|
|
||||||
// Remove the workflow as "active"
|
// Remove the workflow as "active"
|
||||||
|
|
||||||
await this.activeWorkflows.remove(workflowData.id);
|
void this.activeWorkflows.remove(workflowData.id);
|
||||||
this.activationErrors[workflowData.id] = {
|
this.activationErrors[workflowData.id] = {
|
||||||
time: new Date().getTime(),
|
time: new Date().getTime(),
|
||||||
error: {
|
error: {
|
||||||
|
|
Loading…
Reference in a new issue