Failing commission on 50-maas-01-commissioning

Hi all, I have a very strange problem while commissioning a node it always fails on 50-maas-01-commissioning . However the script runs perfectly fine, returns “correct” (?) output and its exit status is 0. It is also interesting that the stderr tab on MaaS has only the output of downloading the script from the rackd controller (with no error or anything that indicates problem). If I ssh to the host during comissioning I can also run the script perfectly fine.

Any suggestions ?

If the output was successfully returned there may have been an error while MAAS processed it. I would check your logs in /var/log/maas/*.log to see if any exceptions where raised during commissioning.

It’s strange I haven’t noticed… I actually get an exception

django.core.exceptions.ValidationError: {'__all__': ['Interface with this Node and Name already exists.']}

I suppose that as this node was in Ready state when re-comissioned, something went wrong. I have done it with a dozen other server with no problem at all.

It shouldn’t be possible to commission while in a ready state. MAAS will reject commissioning results unless the machine is in commissioning. Its hard to say what went wrong without seeing the script output and MAAS logs. From that message it appears that MAAS at least thinks an interface is being duplicated.

The machine was in Ready state and from this state, MaaS allows to go again to Comissioning. In any case, the issue has been solved by deleting the node and enlisting again. Thank you for your assistance!

I can reproduce this issue. I tried deleting my node and re-enlisting, but it continues to happen. MAAS 2.9.3-beta1 (snap install). Script output is here.

2021-08-17 21:21:35 metadataserver.api: [critical] akis.maas(tpcccy): commissioning script '50-maas-01-commissioning' failed during post-processing.
	Traceback (most recent call last):
	  File "/snap/maas/15419/lib/python3.8/site-packages/metadataserver/api.py", line 820, in signal
	    target_status = process(node, request, status)
	  File "/snap/maas/15419/lib/python3.8/site-packages/metadataserver/api.py", line 641, in _process_commissioning
	    self._store_results(
	  File "/snap/maas/15419/lib/python3.8/site-packages/metadataserver/api.py", line 529, in _store_results
	    script_result.store_result(
	  File "/snap/maas/15419/lib/python3.8/site-packages/metadataserver/models/scriptresult.py", line 384, in store_result
	    signal_status = try_or_log_event(
	--- <exception caught here> ---
	  File "/snap/maas/15419/lib/python3.8/site-packages/metadataserver/api.py", line 447, in try_or_log_event
	    func(*args, **kwargs)
	  File "/snap/maas/15419/lib/python3.8/site-packages/metadataserver/builtin_scripts/hooks.py", line 783, in process_lxd_results
	    _process_lxd_resources(node, data["resources"])
	  File "/snap/maas/15419/lib/python3.8/site-packages/metadataserver/builtin_scripts/hooks.py", line 531, in _process_lxd_resources
	    update_node_network_information(node, data, numa_nodes)
	  File "/snap/maas/15419/lib/python3.8/site-packages/metadataserver/builtin_scripts/hooks.py", line 330, in update_node_network_information
	    update_interface_details(
	  File "/snap/maas/15419/lib/python3.8/site-packages/metadataserver/builtin_scripts/hooks.py", line 241, in update_interface_details
	    interface.save(update_fields=["updated", *update_fields])
	  File "/snap/maas/15419/lib/python3.8/site-packages/maasserver/models/interface.py", line 1627, in save
	    return super().save(*args, **kwargs)
	  File "/snap/maas/15419/lib/python3.8/site-packages/maasserver/models/cleansave.py", line 186, in save
	    self.validate_unique(exclude=[self._meta.pk.name])
	  File "/snap/maas/15419/usr/lib/python3/dist-packages/django/db/models/base.py", line 987, in validate_unique
	    raise ValidationError(errors)
	django.core.exceptions.ValidationError: {'__all__': ['Interface with this Node and Name already exists.']}

This issue has just appeared in 3.3.0~beta2.

@ashy250611, have you tried this with the 3.3 formal release, which has been out for some time now?

I reverted to using 3.2 which sorted my problem. I will look to upgrade soon.