KeyError: u'power_type' when registering a node using the API/CLI

Bug #1317645 reported by Raphaël Badin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Triaged
Critical
Unassigned

Bug Description

Here is an error seen in the log when registering a node using the CLI:

ERROR 2014-05-07 19:25:49,521 maasserver Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py", line 114, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/lib/python2.7/dist-packages/django/views/decorators/vary.py", line 19, in inner_func
    response = func(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/piston/resource.py", line 167, in __call__
    result = self.error_handler(e, request, meth, em_format)
  File "/usr/lib/python2.7/dist-packages/piston/resource.py", line 165, in __call__
    result = meth(request, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/maasserver/api_support.py", line 189, in dispatch
    return function(self, request, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/maasserver/api.py", line 627, in new
    node = create_node(request)
  File "/usr/lib/python2.7/dist-packages/maasserver/api.py", line 542, in create_node
    if form.is_valid():
  File "/usr/lib/python2.7/dist-packages/maasserver/forms.py", line 554, in is_valid
    valid = super(WithMACAddressesMixin, self).is_valid()
  File "/usr/lib/python2.7/dist-packages/maasserver/forms.py", line 250, in is_valid
    is_valid = super(NodeForm, self).is_valid()
  File "/usr/lib/python2.7/dist-packages/django/forms/forms.py", line 129, in is_valid
    return self.is_bound and not bool(self.errors)
  File "/usr/lib/python2.7/dist-packages/django/forms/forms.py", line 121, in errors
    self.full_clean()
  File "/usr/lib/python2.7/dist-packages/maasserver/forms.py", line 139, in full_clean
    super(APIEditMixin, self).full_clean()
  File "/usr/lib/python2.7/dist-packages/django/forms/forms.py", line 274, in full_clean
    self._clean_form()
  File "/usr/lib/python2.7/dist-packages/django/forms/forms.py", line 300, in _clean_form
    self.cleaned_data = self.clean()
  File "/usr/lib/python2.7/dist-packages/maasserver/forms.py", line 428, in clean
    no_power_type = cleaned_data['power_type'] == ''
KeyError: u'power_type'

Looks like the cluster wasn't yet connected to the region. In any case, this is a crash so marking this bug Critical.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.