diff options
Diffstat (limited to 'app/workers/run_pipeline_schedule_worker.rb')
-rw-r--r-- | app/workers/run_pipeline_schedule_worker.rb | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/app/workers/run_pipeline_schedule_worker.rb b/app/workers/run_pipeline_schedule_worker.rb index dd0f14a5cab..12042ebc4f0 100644 --- a/app/workers/run_pipeline_schedule_worker.rb +++ b/app/workers/run_pipeline_schedule_worker.rb @@ -27,8 +27,9 @@ class RunPipelineScheduleWorker # rubocop:disable Scalability/IdempotentWorker user, ref: schedule.ref) .execute!(:schedule, ignore_skip_ci: true, save_on_errors: false, schedule: schedule) - rescue Ci::CreatePipelineService::CreateError - # no-op. This is a user operation error such as corrupted .gitlab-ci.yml. + rescue Ci::CreatePipelineService::CreateError => e + # This is a user operation error such as corrupted .gitlab-ci.yml. Log the error for debugging purpose. + log_extra_metadata_on_done(:pipeline_creation_error, e) rescue StandardError => e error(schedule, e) end @@ -37,10 +38,16 @@ class RunPipelineScheduleWorker # rubocop:disable Scalability/IdempotentWorker def error(schedule, error) failed_creation_counter.increment + log_error(schedule, error) + track_error(schedule, error) + end + def log_error(schedule, error) Gitlab::AppLogger.error "Failed to create a scheduled pipeline. " \ "schedule_id: #{schedule.id} message: #{error.message}" + end + def track_error(schedule, error) Gitlab::ErrorTracking .track_and_raise_for_dev_exception(error, issue_url: 'https://gitlab.com/gitlab-org/gitlab-foss/issues/41231', |