Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core): Make task runner oom error message more user friendly (no-changelog) #11646

Merged
merged 1 commit into from
Nov 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions packages/cli/src/runners/errors/task-runner-oom-error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
Loading