[2.0] subnet.list: list index out of range error when using a /31 subnet
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MAAS |
Fix Released
|
Critical
|
Mike Pontillo | ||
maas (Ubuntu) |
Confirmed
|
Undecided
|
Mike Pontillo |
Bug Description
xenial 16.04
maas 2.0.0~beta2+
browsing to Nodes, DNS, Networks, or DHCP Snippets (anything that has IP ranges) returns "index out of range"
initial investigation looks like the same problem as the divide by zero error, MAASIPRange isnt being populated. Hard to see why that is though.
2016-04-14 21:22:43 [-] Error on request (15) subnet.list: list index out of range
Apr 14 21:22:43 hostname sh[46786]: #011--- <exception caught here> ---
Apr 14 21:22:43 hostname sh[46786]: #011 File "/usr/lib/
Apr 14 21:22:43 hostname sh[46786]: #011 result = inContext.theWork()
Apr 14 21:22:43 hostname sh[46786]: #011 File "/usr/lib/
Apr 14 21:22:43 hostname sh[46786]: #011 inContext.theWork = lambda: context.call(ctx, func, *args, **kw)
Apr 14 21:22:43 hostname sh[46786]: #011 File "/usr/lib/
Apr 14 21:22:43 hostname sh[46786]: #011 return self.currentCon
Apr 14 21:22:43 hostname sh[46786]: #011 File "/usr/lib/
Apr 14 21:22:43 hostname sh[46786]: #011 return func(*args,**kw)
Apr 14 21:22:43 hostname sh[46786]: #011 File "/usr/lib/
Apr 14 21:22:43 hostname sh[46786]: #011 return func(*args, **kwargs)
Apr 14 21:22:43 hostname sh[46786]: #011 File "/usr/lib/
Apr 14 21:22:43 hostname sh[46786]: #011 return func_outside_
Apr 14 21:22:43 hostname sh[46786]: #011 File "/usr/lib/
Apr 14 21:22:43 hostname sh[46786]: #011 return func(*args, **kwargs)
Apr 14 21:22:43 hostname sh[46786]: #011 File "/usr/lib/
Apr 14 21:22:43 hostname sh[46786]: #011 return func(*args, **kwds)
Apr 14 21:22:43 hostname sh[46786]: #011 File "/usr/lib/
Apr 14 21:22:43 hostname sh[46786]: #011 for obj in objs
Apr 14 21:22:43 hostname sh[46786]: #011 File "/usr/lib/
Apr 14 21:22:43 hostname sh[46786]: #011 for obj in objs
Apr 14 21:22:43 hostname sh[46786]: #011 File "/usr/lib/
Apr 14 21:22:43 hostname sh[46786]: #011 return self.dehydrate(obj, data, for_list=for_list)
Apr 14 21:22:43 hostname sh[46786]: #011 File "/usr/lib/
Apr 14 21:22:43 hostname sh[46786]: #011 metadata = IPRangeStatisti
Apr 14 21:22:43 hostname sh[46786]: #011 File "/usr/lib/
Apr 14 21:22:43 hostname sh[46786]: #011 self.first_
Apr 14 21:22:43 hostname sh[46786]: #011 File "/usr/lib/
Apr 14 21:22:43 hostname sh[46786]: #011 return self.ranges[
Apr 14 21:22:43 hostname sh[46786]: #011builtins.
Related branches
- Blake Rouse (community): Approve
- LaMont Jones (community): Approve
-
Diff: 117 lines (+44/-7)5 files modified.idea/maas.iml (+1/-1)
.idea/misc.xml (+1/-1)
.idea/modules.xml (+1/-1)
src/provisioningserver/utils/network.py (+15/-4)
src/provisioningserver/utils/tests/test_network.py (+26/-0)
Changed in maas: | |
milestone: | none → 2.0.0 |
importance: | Undecided → Critical |
summary: |
- subnet.list: list index out of range + [2.0] subnet.list: list index out of range |
Changed in maas: | |
status: | New → Triaged |
assignee: | nobody → Mike Pontillo (mpontillo) |
Changed in maas: | |
status: | Triaged → Incomplete |
Changed in maas: | |
status: | Incomplete → In Progress |
Changed in maas (Ubuntu): | |
status: | New → Confirmed |
assignee: | nobody → Mike Pontillo (mpontillo) |
Changed in maas: | |
status: | In Progress → Fix Committed |
Changed in maas: | |
status: | Fix Committed → Fix Released |
This one is more puzzling than I first thought. It seems you have a subnet that has no IP addresses in it, and I'm not sure how this can happen. (the divide by zero you mentioned was due to a /32 subnet, and we already have unit tests for /32 and /128 subnets.)
Which subnets are defined on your MAAS server? Are you able to log into the MAAS CLI and tell me which is the problematic subnet? To narrow it down, run this command against each subnet:
maas <profile> subnet statistics <cidr> include_ suggestions= True include_ranges=True
The one that doesn't work is the one causing the problem.