adding a device with no mac address gives an internal server error

Bug #1566109 reported by Tim Penhey
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Fix Released
Critical
Mike Pontillo

Bug Description

While testing the gomaasapi new 2.0 support, I ended up trying to create a device without specifying any mac_addresses.

This resulted in a 500 Internal server error response.

Other validation like bad hostnames, or invalid mac addresses do give 400 bad requests as expected.

Related branches

Changed in maas:
milestone: none → 2.0.0
importance: Undecided → Critical
Changed in maas:
status: New → In Progress
importance: Critical → High
importance: High → Critical
assignee: nobody → Mike Pontillo (mpontillo)
Revision history for this message
Mike Pontillo (mpontillo) wrote :

Note: in the dev environment, I was not able to reproduce this defect exactly as described. In general, when no MACs are provided, I see:

$ bin/maas test devices create hostname=router2
{"mac_addresses": ["This field is required."]}

This is an error propagated from Django and returns a 400 (according to the logs).

However, if I structure the request like this, I do see a 500 response[1]:

$ bin/maas test devices create
'dict' object has no attribute 'getlist'

[1]: https://paste.ubuntu.com/15765568/

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

I have some code which I think will fix this issue. If it turns out to not make an impact, I'll need to know the exact contents of the attempted POST request.

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.