From 0fdb79a270b499c309eb289796ede04a89b01398 Mon Sep 17 00:00:00 2001 From: Tomi Turtiainen <10324676+tomi@users.noreply.github.com> Date: Fri, 8 Nov 2024 20:27:37 +0200 Subject: [PATCH] fix(core): Make task runner oom error message more user friendly (no-changelog) (#11646) --- .../src/runners/errors/task-runner-oom-error.ts | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/packages/cli/src/runners/errors/task-runner-oom-error.ts b/packages/cli/src/runners/errors/task-runner-oom-error.ts index e52b8b4bea..f846d98768 100644 --- a/packages/cli/src/runners/errors/task-runner-oom-error.ts +++ b/packages/cli/src/runners/errors/task-runner-oom-error.ts @@ -5,18 +5,22 @@ import type { TaskRunner } from '../task-broker.service'; export class TaskRunnerOomError extends ApplicationError { public description: string; - constructor(runnerId: TaskRunner['id'], isCloudDeployment: boolean) { - super(`Task runner (${runnerId}) ran out of memory.`, { level: 'error' }); + constructor( + public readonly runnerId: TaskRunner['id'], + isCloudDeployment: boolean, + ) { + super('Node ran out of memory.', { level: 'error' }); const fixSuggestions = { - reduceItems: 'Reduce the number of items processed at a time by batching the input.', + reduceItems: + 'Reduce the number of items processed at a time, by batching them using a loop node', increaseMemory: - "Increase the memory available to the task runner with 'N8N_RUNNERS_MAX_OLD_SPACE_SIZE' environment variable.", - upgradePlan: 'Upgrade your cloud plan to increase the available memory.', + "Increase the memory available to the task runner with 'N8N_RUNNERS_MAX_OLD_SPACE_SIZE' environment variable", + upgradePlan: 'Upgrade your cloud plan to increase the available memory', }; const subtitle = - 'The runner executing the code ran out of memory. This usually happens when there are too many items to process. You can try the following:'; + 'This usually happens when there are too many items to process. You can try the following:'; const suggestions = isCloudDeployment ? [fixSuggestions.reduceItems, fixSuggestions.upgradePlan] : [fixSuggestions.reduceItems, fixSuggestions.increaseMemory];