From a61761908fde2f032f00f07d0ccc479177db6d3f Mon Sep 17 00:00:00 2001 From: Tomasz Maczukin Date: Mon, 19 Mar 2018 14:17:46 +0100 Subject: Prevent auto-retry AccessDenied error from stopping transition to failed --- app/models/ci/build.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'app') diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb index f8a3600e863..4edcfd02157 100644 --- a/app/models/ci/build.rb +++ b/app/models/ci/build.rb @@ -140,7 +140,11 @@ module Ci next if build.retries_max.zero? if build.retries_count < build.retries_max - Ci::Build.retry(build, build.user) + begin + Ci::Build.retry(build, build.user) + rescue Gitlab::Access::AccessDeniedError => ex + Rails.logger.error "Unable to auto-retry job #{build.id}: #{ex}" + end end end -- cgit v1.2.1