error when maas can't meet juju constraints is confusing and not helpful

Bug #1274085 reported by Jeff Lane 
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Fix Released
Wishlist
Jeroen T. Vermeulen

Bug Description

While trying to deploy landscape via MAAS and Juju, we are running into issues with juju constraints not being met by MAAS. Unfortunately, we have no indication of WHAT constraints were failed. Here's the output from the maas server:

ERROR 2014-01-29 11:52:38,522 maasserver ################################ Exception: No matching node is available. ################################
ERROR 2014-01-29 11:52:38,522 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 831, in acquire
    raise NodesNotAvailable("No matching node is available.")
NodesNotAvailable: No matching node is available.

As someone using maas and juju, this is entirely unhelpful as neither MAAS not Juju tell me what is wrong here.

MAAS should handle this error more cleanly and actually say what constraint was not met (even if it's a raw constraint and not pretty). Thus something like this:

ERROR: MAAS could not find a machine matching the constraint "mem=16GB"

Related branches

Raphaël Badin (rvb)
Changed in maas:
status: New → Triaged
importance: Undecided → High
Revision history for this message
Julian Edwards (julian-edwards) wrote :

I don't see what maas is doing wrong really, the requesting API client really ought to be more helpful since it knows the constraints it was using. In this case Juju should be reporting better errors to its users.

I'll leave this as a wishlist bug in case anyone feels like changing what's logged by MAAS, but given this is an API request the onus is on the API client to inform its users as we should not be expecting them to go diving through MAAS logs to see why a node is not allocated to them.

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

> I'll leave this as a wishlist bug in case anyone feels like changing what's logged by MAAS, but given this is an API request the onus
> is on the API client to inform its users as we should not be expecting them to go diving through MAAS logs to see why a node
> is not allocated to them.

IIRC juju simply returns the text of the error given by MAAS when acquiring a node fails. Improving the exception message in MAAS will solve the problem. Whether or not juju should be responsible for displaying a more useful error message is, I think, debatable. For juju, it would mean distinguishing the "constraints cannot be met" errors from all the other errors that can be returned from MAAS, even if they have the same error code (CONFLICT).

Revision history for this message
Julian Edwards (julian-edwards) wrote : Re: [Bug 1274085] Re: error when maas can't meet juju constraints is confusing and not helpful

On Thursday 30 Jan 2014 08:39:16 Raphaël Badin wrote:
> > I'll leave this as a wishlist bug in case anyone feels like changing
> > what's logged by MAAS, but given this is an API request the onus is on
> > the API client to inform its users as we should not be expecting them to
> > go diving through MAAS logs to see why a node is not allocated to them.
>
> IIRC juju simply returns the text of the error given by MAAS when
> acquiring a node fails. Improving the exception message in MAAS will
> solve the problem. Whether or not juju should be responsible for
> displaying a more useful error message is, I think, debatable. For
> juju, it would mean distinguishing the "constraints cannot be met"
> errors from all the other errors that can be returned from MAAS, even if
> they have the same error code (CONFLICT).

Juju is still best placed to print an error message, it should not be directly
printing errors sent from MAAS. It's a raw API error for goodness sake!

Juju knows what api call it issued. If it gets a 409 back it's pretty obvious
what's going on.

Changed in maas:
assignee: nobody → Jeroen T. Vermeulen (jtv)
status: Triaged → In Progress
Changed in maas:
status: In Progress → Fix Committed
Changed in maas:
milestone: none → 1.6.0
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.