diff --git a/packages/cli/src/services/orchestration/main/MultiMainSetup.ee.ts b/packages/cli/src/services/orchestration/main/MultiMainSetup.ee.ts index a731069c57927..2a23690906fdb 100644 --- a/packages/cli/src/services/orchestration/main/MultiMainSetup.ee.ts +++ b/packages/cli/src/services/orchestration/main/MultiMainSetup.ee.ts @@ -3,6 +3,7 @@ import { Service } from 'typedi'; import { TIME } from '@/constants'; import { SingleMainSetup } from '@/services/orchestration/main/SingleMainSetup'; import { getRedisPrefix } from '@/services/redis/RedisServiceHelper'; +import { ErrorReporterProxy as EventReporter } from 'n8n-workflow'; @Service() export class MultiMainSetup extends SingleMainSetup { @@ -79,6 +80,10 @@ export class MultiMainSetup extends SingleMainSetup { if (config.getEnv('multiMainSetup.instanceType') === 'leader') { this.emit('leadershipChange', leaderId); // stop triggers, pruning, etc. + EventReporter.report('[Multi-main setup] Leader failed to renew leader key', { + level: 'info', + }); + config.set('multiMainSetup.instanceType', 'follower'); } diff --git a/packages/workflow/src/ErrorReporterProxy.ts b/packages/workflow/src/ErrorReporterProxy.ts index 75c1b9fef313c..fc5a08828db2a 100644 --- a/packages/workflow/src/ErrorReporterProxy.ts +++ b/packages/workflow/src/ErrorReporterProxy.ts @@ -33,5 +33,7 @@ export const error = (e: unknown, options?: ReportingOptions) => { if (toReport) instance.report(toReport, options); }; +export const report = error; + export const warn = (warning: Error | string, options?: ReportingOptions) => error(warning, { level: 'warning', ...options }); diff --git a/packages/workflow/src/errors/application.error.ts b/packages/workflow/src/errors/application.error.ts index 79002c074cfba..e48ae91bee11f 100644 --- a/packages/workflow/src/errors/application.error.ts +++ b/packages/workflow/src/errors/application.error.ts @@ -1,7 +1,7 @@ import callsites from 'callsites'; import type { Event } from '@sentry/node'; -type Level = 'warning' | 'error' | 'fatal'; +type Level = 'warning' | 'error' | 'fatal' | 'info'; export type ReportingOptions = { level?: Level;