Updating pod fails if a VM interface has no MAC
Bug #1947656 reported by
Huw Wilkins
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MAAS |
Fix Released
|
High
|
Christian Grabowski |
Bug Description
If you try and update a pod you get an error about the mac_address field being blank, but as far as I can see there is no mac_address associated with a pod.
You can see this by updating a pod on bolla (change any field and save the form):
http://
You can also reproduce this via the API:
maas $PROFILE vmhost update $VM_HOST_ID tags=abc
Responds with:
{"mac_address": ["This field cannot be blank."]}
Related branches
~cgrabowski/maas:handle_VMs_without_MAC_address
Merged
into
maas:master
- Alexsander de Souza: Approve
- MAAS Lander: Approve
-
Diff: 284 lines (+135/-20)5 files modifiedsrc/maasserver/api/tests/test_interfaces.py (+3/-1)
src/maasserver/models/interface.py (+54/-16)
src/maasserver/models/node.py (+10/-2)
src/maasserver/models/tests/test_interface.py (+60/-1)
src/provisioningserver/events.py (+8/-0)
summary: |
- Updating a pod responds with mac_address error + Updating pod fails if a VM interface has no MAC |
Changed in maas: | |
status: | New → Triaged |
importance: | Undecided → High |
milestone: | none → 3.1.0 |
Changed in maas: | |
assignee: | nobody → Christian Grabowski (cgrabowski) |
Changed in maas: | |
status: | In Progress → Fix Committed |
Changed in maas: | |
milestone: | 3.1.0 → 3.1.0-beta5 |
Changed in maas: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
When trying this on bolla I get this traceback in logs:
2021-10-19 07:14:04 maasserver: [error] ####### ####### ####### ####### #### Exception: {'mac_address': ['This field cannot be blank.']} ####### ####### ####### ####### #### maas/16969/ usr/lib/ python3/ dist-packages/ django/ db/models/ query.py" , line 538, in get_or_create maas/16969/ usr/lib/ python3/ dist-packages/ django/ db/models/ query.py" , line 406, in get DoesNotExist( models. interface. PhysicalInterfa ce.DoesNotExist : PhysicalInterface matching query does not exist.
2021-10-19 07:14:04 maasserver: [error] Traceback (most recent call last):
File "/snap/
return self.get(**kwargs), False
File "/snap/
raise self.model.
maasserver.
During handling of the above exception, another exception occurred:
Traceback (most recent call last): maas/16969/ usr/lib/ python3/ dist-packages/ django/ core/handlers/ base.py" , line 113, in _get_response callback( request, *callback_args, **callback_kwargs) maas/16969/ lib/python3. 8/site- packages/ maasserver/ utils/views. py", line 284, in view_atomic_ with_post_ commit_ savepoint python3. 8/contextlib. py", line 75, in inner maas/16969/ lib/python3. 8/site- packages/ maasserver/ api/support. py", line 56, in __call__ .__call_ _(request, *args, **kwargs) maas/16969/ usr/lib/ python3/ dist-packages/ django/ views/decorator s/vary. py", line 20, in inner_func maas/16969/ usr/lib/ python3. 8/dist- packages/ piston3/ resource. py", line 197, in __call__ handler( e, request, meth, em_format) maas/16969/ usr/lib/ python3. 8/dist- packages/ piston3/ resource. py", line 195, in __call__ maas/16969/ lib/python3. 8/site- packages/ maasserver/ api/support. py", line 308, in dispatch maas/16969/ lib/python3. 8/site- packages/ maasserver/ api/support. py", line 158, in w...
File "/snap/
response = wrapped_
File "/snap/
return view_atomic(*args, **kwargs)
File "/usr/lib/
return func(*args, **kwds)
File "/snap/
response = super()
File "/snap/
response = func(*args, **kwargs)
File "/snap/
result = self.error_
File "/snap/
result = meth(request, *args, **kwargs)
File "/snap/
return function(self, request, *args, **kwargs)
File "/snap/