Skip to content

Commit

Permalink
fix(core): Improve the startup error when EXECUTIONS_PROCESS is set t…
Browse files Browse the repository at this point in the history
…o `own`
  • Loading branch information
netroy committed Feb 14, 2024
1 parent bf4f896 commit e40de08
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 18 deletions.
20 changes: 20 additions & 0 deletions packages/cli/bin/n8n
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,26 @@ if (process.env.NODEJS_PREFER_IPV4 === 'true') {
require('dns').setDefaultResultOrder('ipv4first');
}

const colors = require('picocolors');
const executionProcess = process.env.EXECUTIONS_PROCESS;
if (executionProcess) {
console.error(
colors.yellow('Please unset the deprecated env variable'),
colors.bold(colors.yellow('EXECUTIONS_PROCESS')),
);
}
if (executionProcess === 'own') {
console.error(
colors.bold(colors.red('Application failed to start because "Own" mode has been removed.')),
);
console.error(
colors.red(
'If you need the isolation and performance gains, please consider using queue mode instead.\n\n',
),
);
process.exit(-1);
}

(async () => {
const oclif = await import('@oclif/core');
await oclif.execute({});
Expand Down
5 changes: 0 additions & 5 deletions packages/cli/src/commands/BaseCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,6 @@ export abstract class BaseCommand extends Command {
'Support for MySQL/MariaDB has been deprecated and will be removed with an upcoming version of n8n. Please migrate to PostgreSQL.',
);
}
if (process.env.EXECUTIONS_PROCESS === 'own') {
throw new ApplicationError(
'Own mode has been removed. If you need the isolation and performance gains, please consider using queue mode.',
);
}

if (process.env.N8N_SKIP_WEBHOOK_DEREGISTRATION_SHUTDOWN) {
this.logger.warn(
Expand Down
5 changes: 0 additions & 5 deletions packages/cli/src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,6 @@ if (userManagement.jwtRefreshTimeoutHours >= userManagement.jwtSessionDurationHo

config.set('userManagement.jwtRefreshTimeoutHours', 0);
}
if (config.getEnv('executions.process') !== 'IGNORED') {
throw new ApplicationError(
'Own mode has been removed. If you need the isolation and performance gains, please consider using queue mode.',
);
}

setGlobalState({
defaultTimezone: config.getEnv('generic.timezone'),
Expand Down
8 changes: 0 additions & 8 deletions packages/cli/src/config/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,14 +234,6 @@ export const schema = {
},

executions: {
// By default workflows get always executed in the main process.
// TODO: remove this and all usage of `executions.process` when we're sure that nobody has this in their config file anymore.
process: {
doc: 'Own mode has been removed and is only here for backwards compatibility of config files. N8n will use main mode for executions unless `executions.mode` is set to `queue`.',
format: ['main', 'own', 'IGNORED'] as const,
default: 'IGNORED',
env: 'EXECUTIONS_PROCESS',
},
mode: {
doc: 'If it should run executions directly or via queue',
format: ['regular', 'queue'] as const,
Expand Down

0 comments on commit e40de08

Please sign in to comment.