diff --git a/app/release-controller/src/selfUpgrade.ts b/app/release-controller/src/selfUpgrade.ts index 5f8dd02b..da023d7a 100644 --- a/app/release-controller/src/selfUpgrade.ts +++ b/app/release-controller/src/selfUpgrade.ts @@ -36,7 +36,8 @@ export const buildReleaseControllerDefinition = ( name: CONTROLLER_PROCESS_NAME, script: path.join(workspaceRoot, 'app', 'release-controller', 'dist', 'index.js'), cwd: path.join(workspaceRoot, 'app', 'release-controller'), - args: ['daemon'], + // The CLI defaults to daemon. Omitting a one-element args array avoids PM2 + // serializing it as the literal `["daemon"]` during an in-process self-upgrade. env: { ...sanitizeManagedProcessEnv(config.baseEnv), GATEWAY_DATABASE_URL: config.gatewayDatabaseUrl, diff --git a/app/release-controller/test/releaseController.test.ts b/app/release-controller/test/releaseController.test.ts index 3cd4a2b6..aeb56f8e 100644 --- a/app/release-controller/test/releaseController.test.ts +++ b/app/release-controller/test/releaseController.test.ts @@ -445,8 +445,8 @@ describe('upgradeReleaseController', () => { expect(starts.at(-1)).toMatchObject({ name: 'sammo:release-controller', cwd: path.join(workspace, 'app', 'release-controller'), - args: ['daemon'], }); + expect(starts.at(-1)?.args).toBeUndefined(); }); it('restores the old controller definition when the new daemon cannot start', async () => {