fix(core): Improve the startup error when EXECUTIONS_PROCESS is set (#8630)

Co-authored-by: Omar Ajoue <krynble@gmail.com>
This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™ 2024-02-14 15:35:42 +01:00 committed by GitHub
parent 9c7e0266ee
commit a2a3ca160f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 21 additions and 12 deletions

View file

@ -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.', '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) { if (process.env.N8N_SKIP_WEBHOOK_DEREGISTRATION_SHUTDOWN) {
this.logger.warn( this.logger.warn(

View file

@ -73,11 +73,26 @@ if (userManagement.jwtRefreshTimeoutHours >= userManagement.jwtSessionDurationHo
config.set('userManagement.jwtRefreshTimeoutHours', 0); config.set('userManagement.jwtRefreshTimeoutHours', 0);
} }
if (config.getEnv('executions.process') !== 'IGNORED') {
throw new ApplicationError( import colors from 'picocolors';
'Own mode has been removed. If you need the isolation and performance gains, please consider using queue mode.', const executionProcess = config.getEnv('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);
}
setGlobalState({ setGlobalState({
defaultTimezone: config.getEnv('generic.timezone'), defaultTimezone: config.getEnv('generic.timezone'),

View file

@ -234,12 +234,11 @@ export const schema = {
}, },
executions: { 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. // TODO: remove this and all usage of `executions.process` when we're sure that nobody has this in their config file anymore.
process: { 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`.', doc: 'Deprecated key, that will be removed in the future. Please remove it from your configuration and environment variables to prevent issues in the future.',
format: ['main', 'own', 'IGNORED'] as const, format: String,
default: 'IGNORED', default: '',
env: 'EXECUTIONS_PROCESS', env: 'EXECUTIONS_PROCESS',
}, },
mode: { mode: {