Internal server error when trying to stop a node with no power type
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MAAS |
Fix Released
|
Critical
|
Graham Binns |
Bug Description
Now that bug 1274871 is fixed, it's possible for a Node to exist without a known power type (in effect, manually-power on and off only). MAAS can't handle stopping nodes with no power type set.
To reproduce:
- Commission a node.
- Using `maas shell`, set the Node's power type to '':
>>> from maasserver.
>>> n = Node.objects.
>>> n.power_type = ''
>>> n.save()
- On the Node page, click "Start node" and start the node manually (since it has no power type, MAAS can't start it for you).
- On the Node page, click "Stop node".
You'll see a white default apache "Internal Server Error" page.
If you try to stop the node through the CLI, you'll see something like this:
ubuntu@ubuntu:~⟫ maas-cli maas node stop node-07307b52-
Node power type is unconfigured
Either way, the node stays up in MAAS: essentially there's no way to mark it stopped without using `maas shell` to change the status of the node.
maas.log shows a perfectly cromulent error in both cases:
ERROR 2014-01-31 12:25:46,175 django.request Internal Server Error: /MAAS/nodes/
Traceback (most recent call last):
File "/usr/lib/
response = wrapped_
File "/usr/lib/
return self.dispatch(
File "/usr/lib/
return super(NodeView, self).dispatch(
File "/usr/lib/
return handler(request, *args, **kwargs)
File "/usr/lib/
return super(BaseUpdat
File "/usr/lib/
return self.form_
File "/usr/lib/
self.object = form.save()
File "/usr/lib/
message = action.
File "/usr/lib/
self.
File "/usr/lib/
Node.
File "/usr/lib/
node_power_type = node.get_
File "/usr/lib/
raise ValueError("Node power type is unconfigured")
ValueError: Node power type is unconfigured
MAAS ought to be able to handle this properly; it handles *starting* nodes with no power type perfectly fine.
Related branches
- Jeroen T. Vermeulen (community): Approve
- Raphaël Badin (community): Approve
-
Diff: 86 lines (+30/-5)2 files modifiedsrc/maasserver/models/node.py (+16/-4)
src/maasserver/models/tests/test_node.py (+14/-1)
tags: | added: trivial |
Changed in maas: | |
assignee: | nobody → Graham Binns (gmb) |
status: | Triaged → In Progress |
Changed in maas: | |
status: | In Progress → Fix Committed |
Changed in maas: | |
milestone: | none → 14.04 |
Changed in maas: | |
status: | Fix Committed → Fix Released |
The workaround is to set the power type to wake-on-LAN before trying to stop the node, but really you shouldn't have to do that to make this work.