Merge lp://staging/~julian-edwards/maas/rndc-crash-bug-1386488 into lp://staging/~maas-committers/maas/trunk

Proposed by Julian Edwards
Status: Merged
Approved by: Julian Edwards
Approved revision: no longer in the source branch.
Merged at revision: 3313
Proposed branch: lp://staging/~julian-edwards/maas/rndc-crash-bug-1386488
Merge into: lp://staging/~maas-committers/maas/trunk
Diff against target: 207 lines (+56/-14)
4 files modified
src/maasserver/middleware.py (+16/-0)
src/maasserver/node_action.py (+7/-6)
src/maasserver/tests/test_middleware.py (+23/-5)
src/maasserver/tests/test_node_action.py (+10/-3)
To merge this branch: bzr merge lp://staging/~julian-edwards/maas/rndc-crash-bug-1386488
Reviewer Review Type Date Requested Status
Graham Binns (community) Approve
Review via email: mp+239941@code.staging.launchpad.net

Commit message

Catch ExternalProcessError from rndc_command (and anywhere else that might raise it in the future) when dealing with node actions in the web UI and API. The API now returns a SERVICE_UNAVAILABLE instead of a 500 with a stacktrace in the appserver log.

Description of the change

I've done this with a middleware change for the API and followed the example of the RPC exceptions in the node actions and extended its concept to be a little more general, in particular the test.

To post a comment you must log in.
Revision history for this message
Julian Edwards (julian-edwards) wrote :

Marking WIP, something is wrong with the diff.

Revision history for this message
Julian Edwards (julian-edwards) wrote :

Right, fixed, please to be reviewing.

Revision history for this message
Graham Binns (gmb) wrote :

Looks good to me. Rambly thought inline, but no changes needed.

review: Approve
Revision history for this message
Julian Edwards (julian-edwards) wrote :

On Wednesday 29 Oct 2014 07:36:57 you wrote:
> Ultimately, when NodeActionErrors are caught (in the form from which the
> action originated), the error's message is added to the UI as a warning.
> In this case, you might see something like:
>
> "Command `rndc -c /etc/bind/maas/rndc.conf.maas reload maas` returned
> non-zero exit status 1: rndc: 'reload' failed: dynamic zone"
>
> In the UI.
>
> Actually, that's not so terrible (in that it can then be reported to an
> admin, or the admin can go and fix it… I wonder if we shouldn't be
> sanitising some of those kind of messages for non-admins, though. Not,
> however, a concern for this branch; just a rambly 7:30am thought.

I think that given the likelihood of this error ever happening I don't mind
dumping the whole thing there. If a user sees it, they'll just grab an
operator/admin and report what they see, which is actually very useful.

Cheers, thanks for the review!

Revision history for this message
MAAS Lander (maas-lander) wrote :
Download full text (19.1 KiB)

The attempt to merge lp:~julian-edwards/maas/rndc-crash-bug-1386488 into lp:maas failed. Below is the output from the failed tests.

Ign http://security.ubuntu.com trusty-security InRelease
Ign http://nova.clouds.archive.ubuntu.com trusty InRelease
Get:1 http://security.ubuntu.com trusty-security Release.gpg [933 B]
Ign http://nova.clouds.archive.ubuntu.com trusty-updates InRelease
Get:2 http://security.ubuntu.com trusty-security Release [59.7 kB]
Hit http://nova.clouds.archive.ubuntu.com trusty Release.gpg
Get:3 http://nova.clouds.archive.ubuntu.com trusty-updates Release.gpg [933 B]
Hit http://nova.clouds.archive.ubuntu.com trusty Release
Get:4 http://nova.clouds.archive.ubuntu.com trusty-updates Release [59.7 kB]
Hit http://nova.clouds.archive.ubuntu.com trusty/main Sources
Hit http://nova.clouds.archive.ubuntu.com trusty/universe Sources
Get:5 http://security.ubuntu.com trusty-security/main Sources [48.3 kB]
Hit http://nova.clouds.archive.ubuntu.com trusty/main amd64 Packages
Hit http://nova.clouds.archive.ubuntu.com trusty/universe amd64 Packages
Hit http://nova.clouds.archive.ubuntu.com trusty/main Translation-en
Hit http://nova.clouds.archive.ubuntu.com trusty/universe Translation-en
Get:6 http://security.ubuntu.com trusty-security/universe Sources [11.2 kB]
Get:7 http://security.ubuntu.com trusty-security/main amd64 Packages [151 kB]
Get:8 http://nova.clouds.archive.ubuntu.com trusty-updates/main Sources [133 kB]
Get:9 http://nova.clouds.archive.ubuntu.com trusty-updates/universe Sources [89.3 kB]
Get:10 http://security.ubuntu.com trusty-security/universe amd64 Packages [50.4 kB]
Hit http://security.ubuntu.com trusty-security/main Translation-en
Get:11 http://nova.clouds.archive.ubuntu.com trusty-updates/main amd64 Packages [351 kB]
Hit http://security.ubuntu.com trusty-security/universe Translation-en
Get:12 http://nova.clouds.archive.ubuntu.com trusty-updates/universe amd64 Packages [216 kB]
Hit http://nova.clouds.archive.ubuntu.com trusty-updates/main Translation-en
Hit http://nova.clouds.archive.ubuntu.com trusty-updates/universe Translation-en
Ign http://nova.clouds.archive.ubuntu.com trusty/main Translation-en_US
Ign http://nova.clouds.archive.ubuntu.com trusty/universe Translation-en_US
Fetched 1,171 kB in 2s (410 kB/s)
Reading package lists...
sudo DEBIAN_FRONTEND=noninteractive apt-get -y \
     --no-install-recommends install apache2 authbind bind9 bind9utils build-essential bzr-builddeb curl daemontools debhelper dh-apport distro-info dnsutils firefox freeipmi-tools gjs ipython isc-dhcp-common libjs-raphael libjs-yui3-full libjs-yui3-min libpq-dev make pep8 postgresql pyflakes python-amqplib python-bzrlib python-celery python-convoy python-crochet python-cssselect python-curtin python-dev python-distro-info python-django python-django-piston python-django-south python-djorm-ext-pgarray python-docutils python-extras python-fixtures python-flake8 python-formencode python-hivex python-httplib2 python-jinja2 python-jsonschema python-lockfile python-lxml python-mimeparse python-mock python-netaddr python-netifaces python-nose python-oauth python-oops python-oops-amqp python-oops-datedir-repo python-oops-twisted python-oops-wsgi ...

Revision history for this message
MAAS Lander (maas-lander) wrote :

There are additional revisions which have not been approved in review. Please seek review and approval of these new revisions.

Revision history for this message
MAAS Lander (maas-lander) wrote :
Download full text (19.1 KiB)

The attempt to merge lp:~julian-edwards/maas/rndc-crash-bug-1386488 into lp:maas failed. Below is the output from the failed tests.

Ign http://security.ubuntu.com trusty-security InRelease
Get:1 http://security.ubuntu.com trusty-security Release.gpg [933 B]
Ign http://nova.clouds.archive.ubuntu.com trusty InRelease
Get:2 http://security.ubuntu.com trusty-security Release [59.7 kB]
Ign http://nova.clouds.archive.ubuntu.com trusty-updates InRelease
Hit http://nova.clouds.archive.ubuntu.com trusty Release.gpg
Get:3 http://nova.clouds.archive.ubuntu.com trusty-updates Release.gpg [933 B]
Hit http://nova.clouds.archive.ubuntu.com trusty Release
Get:4 http://nova.clouds.archive.ubuntu.com trusty-updates Release [59.7 kB]
Get:5 http://security.ubuntu.com trusty-security/main Sources [48.3 kB]
Hit http://nova.clouds.archive.ubuntu.com trusty/main Sources
Get:6 http://security.ubuntu.com trusty-security/universe Sources [11.2 kB]
Get:7 http://security.ubuntu.com trusty-security/main amd64 Packages [151 kB]
Get:8 http://security.ubuntu.com trusty-security/universe amd64 Packages [50.4 kB]
Hit http://nova.clouds.archive.ubuntu.com trusty/universe Sources
Hit http://nova.clouds.archive.ubuntu.com trusty/main amd64 Packages
Hit http://nova.clouds.archive.ubuntu.com trusty/universe amd64 Packages
Hit http://nova.clouds.archive.ubuntu.com trusty/main Translation-en
Hit http://security.ubuntu.com trusty-security/main Translation-en
Hit http://nova.clouds.archive.ubuntu.com trusty/universe Translation-en
Hit http://security.ubuntu.com trusty-security/universe Translation-en
Get:9 http://nova.clouds.archive.ubuntu.com trusty-updates/main Sources [133 kB]
Get:10 http://nova.clouds.archive.ubuntu.com trusty-updates/universe Sources [89.3 kB]
Get:11 http://nova.clouds.archive.ubuntu.com trusty-updates/main amd64 Packages [351 kB]
Get:12 http://nova.clouds.archive.ubuntu.com trusty-updates/universe amd64 Packages [216 kB]
Hit http://nova.clouds.archive.ubuntu.com trusty-updates/main Translation-en
Hit http://nova.clouds.archive.ubuntu.com trusty-updates/universe Translation-en
Ign http://nova.clouds.archive.ubuntu.com trusty/main Translation-en_US
Ign http://nova.clouds.archive.ubuntu.com trusty/universe Translation-en_US
Fetched 1,171 kB in 2s (407 kB/s)
Reading package lists...
sudo DEBIAN_FRONTEND=noninteractive apt-get -y \
     --no-install-recommends install apache2 authbind bind9 bind9utils build-essential bzr-builddeb curl daemontools debhelper dh-apport distro-info dnsutils firefox freeipmi-tools gjs ipython isc-dhcp-common libjs-raphael libjs-yui3-full libjs-yui3-min libpq-dev make pep8 postgresql pyflakes python-amqplib python-bzrlib python-celery python-convoy python-crochet python-cssselect python-curtin python-dev python-distro-info python-django python-django-piston python-django-south python-djorm-ext-pgarray python-docutils python-extras python-fixtures python-flake8 python-formencode python-hivex python-httplib2 python-jinja2 python-jsonschema python-lockfile python-lxml python-mimeparse python-mock python-netaddr python-netifaces python-nose python-oauth python-oops python-oops-amqp python-oops-datedir-repo python-oops-twisted python-oops-wsgi ...

Revision history for this message
Julian Edwards (julian-edwards) wrote :

Lint, pointless fscking makework since 1984.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.