[2.1.1, trunk, bzr5510] Can't enlist machines

Bug #1636858 reported by Andres Rodriguez
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Fix Released
Critical
Lee Trager
2.0
Fix Released
Critical
Lee Trager
2.1
Fix Released
Critical
Lee Trager

Bug Description

Oct 26 13:11:57 maas-enlisting-node cloud-init[1292]: + maas-ipmi-autodetect-tool
Oct 26 13:11:57 maas-enlisting-node cloud-init[1292]: + power_type=
Oct 26 13:11:57 maas-enlisting-node cloud-init[1292]: + maas-enlist --serverurl http://192.168.122.1:5240/MAAS/api/2.0/machines/
Oct 26 13:11:57 maas-enlisting-node cloud-init[1292]: % Total % Received % Xferd Average Speed Time Time Time Current
Oct 26 13:11:57 maas-enlisting-node cloud-init[1292]: Dload Upload Total Spent Left Speed
Oct 26 13:11:58 maas-enlisting-node cloud-init[1292]: #015 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0#015100 166 0 0 100 166 0 470 --:--:-- --:--:-- --:--:-- 471
Oct 26 13:11:58 maas-enlisting-node cloud-init[1292]: curl: (22) The requested URL returned error: 400 BAD REQUEST
Oct 26 13:11:58 maas-enlisting-node cloud-init[1292]: + maas-enlist --serverurl http://192.168.122.1:5240/MAAS/api/2.0/machines/
Oct 26 13:11:58 maas-enlisting-node cloud-init[1292]: % Total % Received % Xferd Average Speed Time Time Time Current
Oct 26 13:11:58 maas-enlisting-node cloud-init[1292]: Dload Upload Total Spent Left Speed
Oct 26 13:11:58 maas-enlisting-node cloud-init[1292]: #015 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0#015100 166 0 0 100 166 0 599 --:--:-- --:--:-- --:--:-- 601
Oct 26 13:11:58 maas-enlisting-node cloud-init[1292]: curl: (22) The requested URL returned error: 400 BAD REQUEST

==========================================================================

2016-10-26 09:34:32 [twisted.python.log#info] ::ffff:192.168.122.190 - - [26/Oct/2016:13:34:31 +0000] "POST /MAAS/api/2.0/machines/ HTTP/1.1" 400 37 "-" "curl/7.47.0"
2016-10-26 09:34:32 [maasserver#error] ################################ Exception: ['Failed to parse JSON power_parameters'] ################################
2016-10-26 09:34:32 [maasserver#error] Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/maasserver/forms.py", line 254, in _get_power_parameters
    power_parameters = json.loads(power_parameters)
  File "/usr/lib/python3.5/json/__init__.py", line 319, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.5/json/decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.5/json/decoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/django/core/handlers/base.py", line 132, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/lib/python3/dist-packages/maasserver/utils/views.py", line 177, in view_atomic_with_post_commit_savepoint
    return view_atomic(*args, **kwargs)
  File "/usr/lib/python3.5/contextlib.py", line 30, in inner
    return func(*args, **kwds)
  File "/usr/lib/python3/dist-packages/maasserver/api/support.py", line 55, in __call__
    response = upcall(request, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/django/views/decorators/vary.py", line 21, in inner_func
    response = func(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/piston3/resource.py", line 190, in __call__
    result = self.error_handler(e, request, meth, em_format)
  File "/usr/lib/python3/dist-packages/piston3/resource.py", line 188, in __call__
    result = meth(request, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/maasserver/api/support.py", line 261, in dispatch
    return function(self, request, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/maasserver/api/machines.py", line 875, in create
    return create_machine(request)
  File "/usr/lib/python3/dist-packages/maasserver/api/machines.py", line 795, in create_machine
    form = Form(data=altered_query_data, request=request)
  File "/usr/lib/python3/dist-packages/maasserver/forms.py", line 223, in __init__
    WithPowerMixin.set_up_power_type(self, self.data)
  File "/usr/lib/python3/dist-packages/maasserver/forms.py", line 277, in set_up_power_type
    form, data, machine)
  File "/usr/lib/python3/dist-packages/maasserver/forms.py", line 256, in _get_power_parameters
    raise ValidationError("Failed to parse JSON power_parameters")
django.core.exceptions.ValidationError: ['Failed to parse JSON power_parameters']

Related branches

description: updated
description: updated
Revision history for this message
Brendan Donegan (brendan-donegan) wrote :
Revision history for this message
Blake Rouse (blake-rouse) wrote :

The CI passed because all machines that enlisted where IPMI based and have power parameters. In this case I believe that the machine that Andres is trying to enlist is not IPMI based. In this case the API should allow the machine to be created without a power type set.

Changed in maas:
status: New → Triaged
importance: Undecided → Critical
milestone: none → 2.1.1
Lee Trager (ltrager)
Changed in maas:
assignee: nobody → Lee Trager (ltrager)
Lee Trager (ltrager)
Changed in maas:
milestone: 2.1.1 → 2.0.1
milestone: 2.0.1 → 2.1.1
milestone: 2.1.1 → none
Changed in maas:
status: Triaged → Fix Committed
Lee Trager (ltrager)
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.