After performing bulk action on maas nodes, Internal Server Error

Bug #1376023 reported by David Britton
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
MAAS
Fix Released
Critical
Julian Edwards

Bug Description

From django log file:

ERROR 2014-09-30 16:49:00,224 django.request Internal Server Error: /MAAS/nodes/
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py", line 112, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/lib/python2.7/dist-packages/django/views/generic/base.py", line 69, in view
    return self.dispatch(request, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/django/views/generic/base.py", line 87, in dispatch
    return handler(request, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/maasserver/views/nodes.py", line 276, in post
    return super(NodeListView, self).post(request, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/django/views/generic/edit.py", line 171, in post
    return self.form_valid(form)
  File "/usr/lib/python2.7/dist-packages/maasserver/views/nodes.py", line 288, in form_valid
    stats = form.save()
  File "/usr/lib/python2.7/dist-packages/maasserver/forms.py", line 1910, in save
    return self.perform_action(action_name, system_ids)
  File "/usr/lib/python2.7/dist-packages/maasserver/forms.py", line 1858, in perform_action
    action_instance.execute(allow_redirect=False)
  File "/usr/lib/python2.7/dist-packages/maasserver/node_action.py", line 352, in execute
    self.node.release_or_erase()
  File "/usr/lib/python2.7/dist-packages/maasserver/models/node.py", line 1297, in release_or_erase
    self.release()
  File "/usr/lib/python2.7/dist-packages/maasserver/models/node.py", line 1261, in release
    Node.objects.stop_nodes([self.system_id], self.owner)
  File "/usr/lib/python2.7/dist-packages/maasserver/models/node.py", line 339, in stop_nodes
    nodes = self.get_nodes(by_user, NODE_PERMISSION.EDIT, ids=ids)
  File "/usr/lib/python2.7/dist-packages/maasserver/models/node.py", line 264, in get_nodes
    nodes = self._filter_visible_nodes(from_nodes, user, perm)
  File "/usr/lib/python2.7/dist-packages/maasserver/models/node.py", line 227, in _filter_visible_nodes
    if user.is_superuser:
AttributeError: 'NoneType' object has no attribute 'is_superuser'

Related branches

Revision history for this message
David Britton (dpb) wrote :

OK, I think it's while releasing a node in the 'releasing failed' state.

Revision history for this message
Richard Harding (rharding) wrote :

I also have this in the 1.7.0 when I tried to release a node in the state. I did an abort operation and managed to move forward with it.

Raphaël Badin (rvb)
Changed in maas:
status: New → Triaged
importance: Undecided → Critical
Revision history for this message
Raphaël Badin (rvb) wrote :

It seems a node was in the 'releasing failed' state with no owner.

This is an impossible situation and caused this bug. Can you describe how you got the node 'releasing failed'? I'm trying to reproduce this but I cannot get my node to be 'releasing failed' with no owner (the owner is only cleared with the 'release' operation is successful).

Changed in maas:
status: Triaged → Incomplete
Revision history for this message
David Britton (dpb) wrote :

IIRC, this was when the AMT power template was not retrying operations and it failed a lot at weird times. Does that help?

Changed in maas:
status: Incomplete → Confirmed
Christian Reis (kiko)
Changed in maas:
milestone: none → 1.7.0
Graham Binns (gmb)
Changed in maas:
assignee: nobody → Graham Binns (gmb)
Graham Binns (gmb)
Changed in maas:
status: Confirmed → Triaged
Revision history for this message
Graham Binns (gmb) wrote :

Happy to take this on Monday if no-one else picks it up before, but un-assigning myself for now to save confusion if someone's after a relatively easy fix.

Changed in maas:
assignee: Graham Binns (gmb) → nobody
Changed in maas:
status: Triaged → In Progress
assignee: nobody → Julian Edwards (julian-edwards)
Revision history for this message
Julian Edwards (julian-edwards) wrote :

I know why this data is corrupt. It's the migration from the old POWER_FAILED state to the new FAILED_RELEASING. The old one didn't have an owner set.

Changed in maas:
status: In Progress → Fix Committed
Changed in maas:
status: Fix Committed → Fix Released
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.