Having recently updated to MaaS 2.6.2 from 2.5.x http calls to the MaaS API are failing that used to succeed.
The call is (values are replaced but keys are identical):
POST /MAAS/api/2.0/machines
Content-Type: application/json
Body: {"architecture":"amd64/generic",
"hostname":"fooey",
"mac_addresses":"AA:AA:AA:AA:AA",
"power_parameters": {"power_address":"10.10.10.10","power_pass":"password=","power_user":"user"},
"power_type":"redfish"}
This returns a 500 with the message Accessing deferred field is not allowed: suppressed
, which appears to be a reference to the suppressed
field on a script result.
I’ve pasted the logs from the maas region controller below. It appears to be querying for a node before it is created or something of the sort. I’m able to create machines successfully through the UI - so the environment isn’t totally broken. Could someone tell me if there were breaking changes to the POST /machines
endpoint or whether this is a bug?
Logs:
2020-01-09 08:32:23 maasserver.utils.asynchronous: [critical] Failure when cancelling hook.
Traceback (most recent call last):
File "/usr/lib/python3.6/threading.py", line 864, in run
self._target(*self._args, **self._kwargs)
File "/usr/lib/python3/dist-packages/provisioningserver/utils/twisted.py", line 852, 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 250, in inContext
result = inContext.theWork()
File "/usr/lib/python3/dist-packages/twisted/python/threadpool.py", line 266, in <lambda>
inContext.theWork = lambda: context.call(ctx, func, *args, **kw)
File "/usr/lib/python3/dist-packages/twisted/python/context.py", line 122, in callWithContext
return self.currentContext().callWithContext(ctx, func, *args, **kw)
File "/usr/lib/python3/dist-packages/twisted/python/context.py", line 85, in callWithContext
return func(*args,**kw)
File "/usr/lib/python3/dist-packages/provisioningserver/utils/twisted.py", line 885, in callInContext
return func(*args, **kwargs)
File "/usr/lib/python3/dist-packages/provisioningserver/utils/twisted.py", line 234, in wrapper
result = func(*args, **kwargs)
File "/usr/lib/python3/dist-packages/maasserver/utils/orm.py", line 756, in call_within_transaction
return func_outside_txn(*args, **kwargs)
File "/usr/lib/python3/dist-packages/maasserver/utils/orm.py", line 563, in retrier
return func(*args, **kwargs)
File "/usr/lib/python3.6/contextlib.py", line 52, in inner
return func(*args, **kwds)
File "/usr/lib/python3/dist-packages/maasserver/models/node.py", line 4528, in _start_bmc_unavailable
system_id=self.system_id)
File "/usr/lib/python3/dist-packages/maasserver/models/event.py", line 55, in register_event_and_event_type
if system_id is not None else None)
File "/usr/lib/python3/dist-packages/django/db/models/manager.py", line 85, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/usr/lib/python3/dist-packages/django/db/models/query.py", line 380, in get
self.model._meta.object_name
maasserver.models.node.DoesNotExist: Node matching query does not exist.
2020-01-09 08:32:23 maasserver: [error] ################################ Exception: Accessing deferred field is not allowed: suppressed ################################
2020-01-09 08:32:23 maasserver: [error] Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/django/core/handlers/base.py", line 185, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/usr/lib/python3/dist-packages/maasserver/utils/views.py", line 277, in view_atomic_with_post_commit_savepoint
return view_atomic(*args, **kwargs)
File "/usr/lib/python3.6/contextlib.py", line 52, in inner
return func(*args, **kwds)
File "/usr/lib/python3/dist-packages/maasserver/api/support.py", line 70, 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 229, in __call__
else: stream = srl.render(request)
File "/usr/lib/python3/dist-packages/piston3/emitters.py", line 411, in render
seria = json.dumps(self.construct(), cls=DjangoJSONEncoder, ensure_ascii=False, indent=4)
File "<string>", line 236, in emitter_new_construct
File "<string>", line 34, in _any
File "<string>", line 162, in _model
File "/usr/lib/python3/dist-packages/maasserver/api/nodes.py", line 354, in commissioning_status_name
return get_script_status_name(handler.commissioning_status(node))
File "/usr/lib/python3/dist-packages/maasserver/api/nodes.py", line 350, in commissioning_status
return get_status_from_qs(node._cached_commissioning_script_results)
File "/usr/lib/python3/dist-packages/metadataserver/models/scriptset.py", line 80, in get_status_from_qs
not script_result.suppressed):
File "/usr/lib/python3/dist-packages/maasserver/monkey.py", line 45, in DeferredAttributePreventer__get__
"Accessing deferred field is not allowed: %s" % self.field_name)
maasserver.monkey.DeferredValueAccessError: Accessing deferred field is not allowed: suppressed
2020-01-09 08:32:23 regiond: [info] 10.112.128.16 POST /MAAS/api/2.0/machines/ HTTP/1.1 --> 500 INTERNAL_SERVER_ERROR (referrer: -; agent: Go-http-client/1.1)