diff --git a/runner/pool/pool.go b/runner/pool/pool.go index 9f5fc1972..b9414bef3 100644 --- a/runner/pool/pool.go +++ b/runner/pool/pool.go @@ -270,7 +270,7 @@ func (r *basePoolManager) persistJobToDB(ctx context.Context, jobParams params.J "is_new_job", isNewJob, "job_action", jobParams.Action, ) - return fmt.Errorf("job %d should not be recorded", jobParams.WorkflowJobID) + return fmt.Errorf("job %d should not be recorded: %w", jobParams.WorkflowJobID, runnerErrors.ErrUnprocessable) } slog.DebugContext( diff --git a/util/util.go b/util/util.go index f07859e5c..374313a13 100644 --- a/util/util.go +++ b/util/util.go @@ -139,6 +139,12 @@ func MaybeAddWrapperToExtraSpecs(ctx context.Context, param commonParams.Bootstr return param } } + if data == nil { + // Unmarshal returned nil. An explicit `null` was probably passed. + // Any other valid json would either fail to unmarshal or unmarshal + // into an actual map we can use. + return param + } if _, ok := data["runner_install_template"]; ok { // User has already set a runner install template override. Do not touch.