Merge lp:~pwlars/ubuntu-ci-services-itself/image-build-error-report into lp:ubuntu-ci-services-itself

Proposed by Paul Larson
Status: Rejected
Rejected by: Paul Larson
Proposed branch: lp:~pwlars/ubuntu-ci-services-itself/image-build-error-report
Merge into: lp:ubuntu-ci-services-itself
Diff against target: 18 lines (+5/-3)
1 file modified
image-builder/run_worker (+5/-3)
To merge this branch: bzr merge lp:~pwlars/ubuntu-ci-services-itself/image-build-error-report
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Canonical CI Engineering Pending
Review via email: mp+208271@code.launchpad.net

Commit message

Improve failure completion message from imagebuilder to include the command that failed

Description of the change

This is a really basic fix for https://bugs.launchpad.net/ubuntu-ci-services-itself/+bug/1284672 but I have some other stuff in the works to provide a log artifact in swift at the end with detailed logs. This will still be useful even with the other patch though, as the user will need to link to that artifact to get the full logs, but this will give the failing command, providing more insight into what went wrong. Example output when this is enabled:
04:38:59 INFO PROGRESS_TRIGGER: STATUS: {u'message': u'Adding requested packages to the image...'}
04:39:22 INFO PROGRESS_TRIGGER: COMPLETED: {u'message': u"CalledProcessError: Command '['chroot', '/tmp/tmpQ0D6qb/mountpoint', '/usr/bin/apt-get', 'update']' returned non-zero exit status 100", u'exit': True, u'result': u'FAILED'}

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:277
http://s-jenkins.ubuntu-ci:8080/job/uci-engine-ci/235/
Executed test runs:

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/uci-engine-ci/235/rebuild

review: Approve (continuous-integration)
Revision history for this message
Paul Larson (pwlars) wrote :

Unmerged revisions

277. By Paul Larson

Return the exception details in the failure status

Fixes LP:1284672

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'image-builder/run_worker'
2--- image-builder/run_worker 2014-02-22 16:22:26 +0000
3+++ image-builder/run_worker 2014-02-26 04:47:54 +0000
4@@ -51,9 +51,11 @@
5 if amqp_utils.progress_completed(trigger, {'image_id': image_id}):
6 log.error(
7 'Unable to notify progress-trigger completition of action')
8- except Exception as e:
9- type, val, tb = sys.exc_info()
10- amqp_utils.progress_failed(trigger, {'message': val.message})
11+ except Exception:
12+ exc_type, val, tb = sys.exc_info()
13+ exc_name = type(exc_type).__class__.__name__
14+ amqp_utils.progress_failed(
15+ trigger, {'message': '%s: %s' % (exc_name, val)})
16 log.exception('Image build failed:')
17
18 finally:

Subscribers

People subscribed via source and target branches