[trunk] maasserver.models.interface.MultipleObjectsReturned: Got more than one item.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MAAS |
Fix Released
|
Critical
|
Blake Rouse |
Bug Description
When trying to deploy a node, the following error is shown in the UI:
maasserver.
The regiond.log shows:
2015-08-17 20:32:00 [-] Error on request (120) node.action: Got more than one item. [11/1144]
Traceback (most recent call last):
File "/usr/lib/
File "/usr/lib/
File "/usr/lib/
--- <exception caught here> ---
File "/usr/lib/
result = context.call(ctx, function, *args, **kwargs)
File "/usr/lib/
return self.currentCon
File "/usr/lib/
return func(*args,**kw)
File "/usr/lib/
return func_outside_
File "/usr/lib/
return func(*args, **kwargs)
File "/usr/lib/
return func(*args, **kwargs)
File "/usr/lib/
return func(*args, **kwargs)
File "/usr/lib/
return func_within_
File "/usr/lib/
return func(*args, **kwargs)
File "/usr/lib/
return m(params)
File "/usr/lib/
return action.
File "/usr/lib/
File "/usr/lib/
return func_within_
File "/usr/lib/
return func(*args, **kwargs)
File "/usr/lib/
File "/usr/lib/
File "/usr/lib/
File "/usr/lib/
raise get_exception_
Related branches
- Blake Rouse (community): Approve
-
Diff: 547 lines (+524/-1)2 files modifiedsrc/maasserver/migrations/0163_unique_mac_and_name_for_interface.py (+516/-0)
src/maasserver/models/tests/test_interface.py (+8/-1)
- Mike Pontillo (community): Approve
-
Diff: 1546 lines (+1288/-156)7 files modifiedsrc/maasserver/migrations/0161_create_missing_physical_interfaces.py (+521/-0)
src/maasserver/migrations/0162_remove_duplicate_interfaces.py (+523/-0)
src/maasserver/models/macaddress.py (+0/-33)
src/maasserver/models/migrations/create_physical_interfaces_helper.py (+106/-0)
src/maasserver/models/migrations/tests/test_create_physical_interfaces_helper.py (+138/-0)
src/maasserver/models/tests/test_macaddress.py (+0/-119)
src/maasserver/start_up.py (+0/-4)
Changed in maas: | |
status: | New → Triaged |
assignee: | Mike Pontillo (mpontillo) → Blake Rouse (blake-rouse) |
status: | Triaged → In Progress |
Changed in maas: | |
status: | In Progress → Fix Committed |
Changed in maas: | |
status: | Fix Committed → Fix Released |
Looking at it myself, I found this out:
On /usr/lib/ python2. 7/dist- packages/ maasserver/ models/ macaddress. py line 331, I changed:
interface = get_one( PhysicalInterfa ce.objects. filter( mac=self) )
For
interface = PhysicalInterfa ce.objects. filter( mac=self)
And trying to reploy, I'd get (on regiond.log):
update_ host_maps= update_ host_maps) python2. 7/dist- packages/ maasserver/ models/ macaddress. py", line 334, in claim_static_ips claim_static_ ips(
exceptions. AttributeError: 'QuerySet' object has no attribute 'claim_static_ips'
File "/usr/lib/
return interface.
and on maas.log:
Aug 17 20:34:17 trusty-maas9 maas.macaddress: [ERROR] [<PhysicalInter face: name=eth0, type=physical, mac=74: d4:35:89: b9:cd>, <PhysicalInterface: d4:35:89: b9:cd>, <PhysicalInterface: name=eth0, type=physical, mac=74: d4:35:89: b9:cd>, <PhysicalInterface: nam d4:35:89: b9:cd>]
name=eth0, type=physical, mac=74:
e=eth0, type=physical, mac=74:
The big question, why would it return multiple eth0's since there's only one interface per node, or per that specific mac.