From 10a738589129f9d2babbca06ff4e35ec13cfcb40 Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Thu, 12 Jan 2017 16:52:28 -0500 Subject: [PATCH 1/2] Always display full message on git checkout error [Delivers #137546755] --- buildman/jobutil/workererror.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/buildman/jobutil/workererror.py b/buildman/jobutil/workererror.py index 44b96fb0a..9c1a3dbb6 100644 --- a/buildman/jobutil/workererror.py +++ b/buildman/jobutil/workererror.py @@ -16,7 +16,9 @@ class WorkerError(object): }, 'io.quay.builder.gitcheckout': { - 'message': 'Could not checkout git ref. Have you force pushed recently?', + 'message': 'Could not checkout git ref. If you force pushed recently, ' + + 'the commit may be missing.', + 'show_base_error': True, }, 'io.quay.builder.cannotextractbuildpack': { @@ -80,7 +82,8 @@ class WorkerError(object): }, 'io.quay.builder.errorduringphasetransition': { - 'message': 'Error during phase transition. If this problem persists please contact customer support.', + 'message': 'Error during phase transition. If this problem persists ' + + 'please contact customer support.', 'is_internal': True }, From 5218e60a253a39ce3da8d9586c655f6c7b68c7e1 Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Thu, 12 Jan 2017 16:53:12 -0500 Subject: [PATCH 2/2] Fix indentation in workererror --- buildman/jobutil/workererror.py | 144 ++++++++++++++++---------------- 1 file changed, 72 insertions(+), 72 deletions(-) diff --git a/buildman/jobutil/workererror.py b/buildman/jobutil/workererror.py index 9c1a3dbb6..9245f312e 100644 --- a/buildman/jobutil/workererror.py +++ b/buildman/jobutil/workererror.py @@ -5,91 +5,91 @@ class WorkerError(object): self._base_message = base_message self._error_handlers = { - 'io.quay.builder.buildpackissue': { - 'message': 'Could not load build package', - 'is_internal': True, - }, + 'io.quay.builder.buildpackissue': { + 'message': 'Could not load build package', + 'is_internal': True, + }, - 'io.quay.builder.gitfailure': { - 'message': 'Could not clone git repository', - 'show_base_error': True, - }, + 'io.quay.builder.gitfailure': { + 'message': 'Could not clone git repository', + 'show_base_error': True, + }, - 'io.quay.builder.gitcheckout': { - 'message': 'Could not checkout git ref. If you force pushed recently, ' + - 'the commit may be missing.', - 'show_base_error': True, - }, + 'io.quay.builder.gitcheckout': { + 'message': 'Could not checkout git ref. If you force pushed recently, ' + + 'the commit may be missing.', + 'show_base_error': True, + }, - 'io.quay.builder.cannotextractbuildpack': { - 'message': 'Could not extract the contents of the build package' - }, + 'io.quay.builder.cannotextractbuildpack': { + 'message': 'Could not extract the contents of the build package' + }, - 'io.quay.builder.cannotpullforcache': { - 'message': 'Could not pull cached image', - 'is_internal': True - }, + 'io.quay.builder.cannotpullforcache': { + 'message': 'Could not pull cached image', + 'is_internal': True + }, - 'io.quay.builder.dockerfileissue': { - 'message': 'Could not find or parse Dockerfile', - 'show_base_error': True - }, + 'io.quay.builder.dockerfileissue': { + 'message': 'Could not find or parse Dockerfile', + 'show_base_error': True + }, - 'io.quay.builder.cannotpullbaseimage': { - 'message': 'Could not pull base image', - 'show_base_error': True - }, + 'io.quay.builder.cannotpullbaseimage': { + 'message': 'Could not pull base image', + 'show_base_error': True + }, - 'io.quay.builder.internalerror': { - 'message': 'An internal error occurred while building. Please submit a ticket.', - 'is_internal': True - }, + 'io.quay.builder.internalerror': { + 'message': 'An internal error occurred while building. Please submit a ticket.', + 'is_internal': True + }, - 'io.quay.builder.buildrunerror': { - 'message': 'Could not start the build process', - 'is_internal': True - }, + 'io.quay.builder.buildrunerror': { + 'message': 'Could not start the build process', + 'is_internal': True + }, - 'io.quay.builder.builderror': { - 'message': 'A build step failed', - 'show_base_error': True - }, + 'io.quay.builder.builderror': { + 'message': 'A build step failed', + 'show_base_error': True + }, - 'io.quay.builder.tagissue': { - 'message': 'Could not tag built image', - 'is_internal': True - }, + 'io.quay.builder.tagissue': { + 'message': 'Could not tag built image', + 'is_internal': True + }, - 'io.quay.builder.pushissue': { - 'message': 'Could not push built image', - 'show_base_error': True, - 'is_internal': True - }, + 'io.quay.builder.pushissue': { + 'message': 'Could not push built image', + 'show_base_error': True, + 'is_internal': True + }, - 'io.quay.builder.dockerconnecterror': { - 'message': 'Could not connect to Docker daemon', - 'is_internal': True - }, + 'io.quay.builder.dockerconnecterror': { + 'message': 'Could not connect to Docker daemon', + 'is_internal': True + }, - 'io.quay.builder.missingorinvalidargument': { - 'message': 'Missing required arguments for builder', - 'is_internal': True - }, + 'io.quay.builder.missingorinvalidargument': { + 'message': 'Missing required arguments for builder', + 'is_internal': True + }, - 'io.quay.builder.cachelookupissue': { - 'message': 'Error checking for a cached tag', - 'is_internal': True - }, + 'io.quay.builder.cachelookupissue': { + 'message': 'Error checking for a cached tag', + 'is_internal': True + }, - 'io.quay.builder.errorduringphasetransition': { - 'message': 'Error during phase transition. If this problem persists ' + - 'please contact customer support.', - 'is_internal': True - }, + 'io.quay.builder.errorduringphasetransition': { + 'message': 'Error during phase transition. If this problem persists ' + + 'please contact customer support.', + 'is_internal': True + }, - 'io.quay.builder.clientrejectedtransition': { - 'message': 'Build can not be finished due to user cancellation.', - } + 'io.quay.builder.clientrejectedtransition': { + 'message': 'Build can not be finished due to user cancellation.', + } } def is_internal_error(self): @@ -110,10 +110,10 @@ class WorkerError(object): def extra_data(self): if self._base_message: return { - 'base_error': self._base_message, - 'error_code': self._error_code + 'base_error': self._base_message, + 'error_code': self._error_code } return { - 'error_code': self._error_code + 'error_code': self._error_code }