[2.0,2.1] Allocate using subnets or not_subnets with space fails

Bug #1637192 reported by Martin Packman
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Fix Released
High
Mike Pontillo
1.9
Won't Fix
High
Mike Pontillo
2.0
Won't Fix
High
Mike Pontillo

Bug Description

Attempting to use the undocumented subnets or not_subnets params to `machines allocate` with spaces as suggested in bug 1636919 results in a MAAS internal server error due to unorderable types.

$ maas env20 machines allocate subnets=space:0 verbose=true dry_run=true --debug
500 INTERNAL SERVER ERROR

         Connection: close
       Content-Type: text/plain; charset=utf-8
               Date: Thu, 27 Oct 2016 13:23:19 GMT
             Server: TwistedWeb/16.0.0
             Status: 500
  Transfer-Encoding: chunked
               Vary: Cookie
    X-Frame-Options: SAMEORIGIN

unorderable types: Subnet() < Subnet()

Related branches

Revision history for this message
Andres Rodriguez (andreserl) wrote :

Can you please attach logs ? /var/log/maas/*.log

Changed in maas:
status: New → Incomplete
Revision history for this message
Andres Rodriguez (andreserl) wrote :

(obviously, logs while the error you see above happens)

Revision history for this message
Martin Packman (gz) wrote :

I only see the one line corresponding to this request, do I need to turn on more detailed logging?

Oct 27 15:20:24 juju-qa-maas-server-1 maas.api: [INFO] Request from user root to acquire a machine with constraints <QueryDict: {'verbose': ['true'], 'dry_run': ['true'], 'subnets': ['space:0']}>

Revision history for this message
Mike Pontillo (mpontillo) wrote :

The internal server error is a bad behavior on MAAS's part, but without a traceback it's difficult to diagnose. However, with your steps it was easy to recreate the problem in my test bed; I was able to get a traceback as follows:

http://paste.ubuntu.com/23390488/

(You probably saw the message in maas.log, but `regiond.log` has the details of the failure.)

Martin, can you confirm that this only happens in MAAS 2.x?

Changed in maas:
status: Incomplete → Triaged
importance: Undecided → High
importance: High → Critical
milestone: none → 2.1.1
no longer affects: maas/2.1
summary: - Allocate using subnets or not_subnets with space fails
+ [2.0,2.1] Allocate using subnets or not_subnets with space fails
Revision history for this message
Martin Packman (gz) wrote :

Yes, just with the subnets/not_subnets params on 2.0 and 2.1, the networks/not_networks on 1.9 gives reasonable results. Is with more than just spaces values though, vlans at least are also affected. Fishing around for other potentially valid but broken commands mostly gets me bug 1637203 instead.

Changed in maas:
assignee: nobody → Mike Pontillo (mpontillo)
importance: Critical → High
Revision history for this message
Mike Pontillo (mpontillo) wrote :

I thought this was a critical issue at first, but I downgraded it to 'high'. (And thankfully, I don't think this will be a showstopper for juju.)

This issue can only occur when no node was available matching the specified constraints. If that happens, we try to render an error message reading:

    No available node matches constraints: <constraints>

The code that renders the constraints into human-readable form (for the sole purpose of placing it in that error message) doesn't like the new "space:<whatever>" syntax, and ends up crashing instead. (oops.)

Also, from code inspection, it looks like this issue *could* exist in MAAS 1.9 as well as MAAS 2.0. (But it's possible that it doesn't crash there; I haven't tested it.)

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