Cannot change power settings for machine

Bug #1566920 reported by Gavin Panella
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Fix Released
High
Blake Rouse

Bug Description

In the UI I tried to change a node from virsh to manual power control.
Apparently this worked, but later I noticed that it had not. Checking
the logs shows what happened:

Error on request (89) machine.update: {"mac_addresses": ["This field is required."], "architecture": ["'i386/generic' is not a valid ar
chitecture. It should be one of: 'amd64/generic'."]}
Traceback (most recent call last):
  File "/usr/lib/python3.5/threading.py", line 862, in run
    self._target(*self._args, **self._kwargs)
  File ".../src/provisioningserver/utils/twisted.py", line 842, in worker
    return target()
  File "/usr/lib/python3/dist-packages/twisted/_threads/_threadworker.py", line 46, in work
    task()
  File "/usr/lib/python3/dist-packages/twisted/_threads/_team.py", line 190, in doWork
    task()
--- <exception caught here> ---
  File "/usr/lib/python3/dist-packages/twisted/python/threadpool.py", line 246, in inContext
    result = inContext.theWork()
  File "/usr/lib/python3/dist-packages/twisted/python/threadpool.py", line 262, in <lambda>
    inContext.theWork = lambda: context.call(ctx, func, *args, **kw)
  File "/usr/lib/python3/dist-packages/twisted/python/context.py", line 118, in callWithContext
    return self.currentContext().callWithContext(ctx, func, *args, **kw)
  File "/usr/lib/python3/dist-packages/twisted/python/context.py", line 81, in callWithContext
    return func(*args,**kw)
  File ".../src/maasserver/utils/orm.py", line 516, in call_within_transaction
    return func_outside_txn(*args, **kwargs)
  File ".../src/maasserver/utils/orm.py", line 343, in retrier
    return func(*args, **kwargs)
  File "/usr/lib/python3.5/contextlib.py", line 30, in inner
    return func(*args, **kwds)
  File ".../src/maasserver/websockets/handlers/machine.py", line 262, in update
    data = super(NodeHandler, self).update(params)
  File ".../src/maasserver/websockets/base.py", line 399, in update
    raise HandlerValidationError(form.errors)
maasserver.websockets.base.HandlerValidationError: {'mac_addresses': ['This field is required.'], 'architecture': ["'i386/generic' is not a valid architecture. It should be one of: 'amd64/generic'."]}

There are two bugs here:

- The UI was misleading; the error was not shown to me. This is a known
  problem (bug 1556963) that affects all of the UI.

- Editing power parameters in the UI is a separate interaction to
  editing MACs or setting the architecture, so it's incorrect to
  validate those fields when editing power parameters.

Tags: ui

Related branches

Revision history for this message
Blake Rouse (blake-rouse) wrote :

I fixed the real issue of this bug which is that you should not be able to modify the power parameters of the machine unless one rack controller is connected to that region controller.

The other issues that you pointed out can be solved at a later date as the UI error reporting is an issue all across the UI and we really need to improve on that. Split out the form I don't think adds much in this case as you still need a connected rack controller to validate the power parameters.

Changed in maas:
milestone: none → 2.0.0
assignee: nobody → Blake Rouse (blake-rouse)
Changed in maas:
status: Triaged → 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.