mirror of
https://github.com/n8n-io/n8n.git
synced 2026-09-01 15:47:41 +08:00
fix(core): Skip AuthRolesService.init() for workers to prevent scope deletion (#25245)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -136,7 +136,11 @@ export abstract class BaseCommand<F = never> {
|
||||
);
|
||||
|
||||
// Initialize the auth roles service to make sure that roles are correctly setup for the instance.
|
||||
await Container.get(AuthRolesService).init();
|
||||
// Only run on main instance - workers should not modify auth roles/scopes as they may have
|
||||
// different code versions, and scope sync would incorrectly delete scopes they don't know about.
|
||||
if (this.instanceSettings.instanceType === 'main') {
|
||||
await Container.get(AuthRolesService).init();
|
||||
}
|
||||
|
||||
if (process.env.EXECUTIONS_PROCESS === 'own') process.exit(-1);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user