diff --git a/packages/cli/src/scaling/scaling.service.ts b/packages/cli/src/scaling/scaling.service.ts index f965587263..0645642ddb 100644 --- a/packages/cli/src/scaling/scaling.service.ts +++ b/packages/cli/src/scaling/scaling.service.ts @@ -114,6 +114,7 @@ export class ScalingService { executionId, workerId: this.instanceSettings.hostId, errorMsg: error.message, + errorStack: error.stack ?? '', }; await job.progress(msg); @@ -295,12 +296,18 @@ export class ScalingService { }); break; case 'job-failed': - this.logger.error(`Execution ${msg.executionId} (job ${jobId}) failed`, { - workerId: msg.workerId, - errorMsg: msg.errorMsg, - executionId: msg.executionId, - jobId, - }); + this.logger.error( + [ + `Execution ${msg.executionId} (job ${jobId}) failed`, + msg.errorStack ? `\n${msg.errorStack}\n` : '', + ].join(''), + { + workerId: msg.workerId, + errorMsg: msg.errorMsg, + executionId: msg.executionId, + jobId, + }, + ); break; case 'abort-job': break; // only for worker diff --git a/packages/cli/src/scaling/scaling.types.ts b/packages/cli/src/scaling/scaling.types.ts index 38cb6805de..ae7e790a16 100644 --- a/packages/cli/src/scaling/scaling.types.ts +++ b/packages/cli/src/scaling/scaling.types.ts @@ -56,6 +56,7 @@ export type JobFailedMessage = { executionId: string; workerId: string; errorMsg: string; + errorStack: string; }; /** Message sent by main to worker to abort a job. */