IP address issues when subnet is misidentified internally

Bug #1511894 reported by Ricardo Bánffy
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
MAAS
Won't Fix
Critical
Unassigned

Bug Description

While investigating lp:1510629, we noted Subnet.objects.get_best_subnet_for_ip(ipaddr) was returning None because it could not return a subnet for a given IP.

From the log:

2015-10-30 18:10:33 [-] Unhandled failure dispatching AMP command. This is probably a bug. Please ensure that this error is handled within application code or declared in the signature of the UpdateLeases command. [trusty-test:pid=11003:cmd=UpdateLeases:ask=19f]
 Traceback (most recent call last):
   File "/usr/lib/python2.7/threading.py", line 783, in __bootstrap
     self.__bootstrap_inner()
   File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
     self.run()
   File "/usr/lib/python2.7/threading.py", line 763, in run
     self.__target(*self.__args, **self.__kwargs)
   File "/usr/lib/python2.7/dist-packages/provisioningserver/utils/twisted.py", line 791, in _worker
     return super(ThreadPool, self)._worker()
 --- <exception caught here> ---
   File "/usr/lib/python2.7/dist-packages/twisted/python/threadpool.py", line 191, in _worker
     result = context.call(ctx, function, *args, **kwargs)
   File "/usr/lib/python2.7/dist-packages/twisted/python/context.py", line 118, in callWithContext
     return self.currentContext().callWithContext(ctx, func, *args, **kw)
   File "/usr/lib/python2.7/dist-packages/twisted/python/context.py", line 81, in callWithContext
     return func(*args,**kw)
   File "/usr/lib/python2.7/dist-packages/provisioningserver/utils/twisted.py", line 200, in wrapper
     return func(*args, **kwargs)
   File "/usr/lib/python2.7/dist-packages/maasserver/utils/orm.py", line 480, in call_within_transaction
     return func_outside_txn(*args, **kwargs)
   File "/usr/lib/python2.7/dist-packages/maasserver/utils/orm.py", line 307, in retrier
     return func(*args, **kwargs)
   File "/usr/lib/python2.7/dist-packages/django/db/transaction.py", line 339, in inner
     return func(*args, **kwargs)
   File "/usr/lib/python2.7/dist-packages/maasserver/rpc/leases.py", line 51, in update_leases
     StaticIPAddress.objects.update_leases(nodegroup, leases)
   File "/usr/lib/python2.7/dist-packages/maasserver/models/staticipaddress.py", line 451, in update_leases
     subnet_family = subnet.get_ipnetwork().version
 exceptions.AttributeError: 'NoneType' object has no attribute 'get_ipnetwork'

The effect is that ip_address is returned as an empty string to the UI.

Revision history for this message
Ricardo Bánffy (rbanffy) wrote :
Revision history for this message
Ricardo Bánffy (rbanffy) wrote :
Revision history for this message
Ricardo Bánffy (rbanffy) wrote :

Copying relevant information fron lp:1510629

VM node was commissioned and left on with SSH enabled. It got IP address 10.0.0.11, which is in the dynamic range of the DHCP configuration. Database shows one IP address, with DHCP alloc_type:

maasdb=# select id, ip, alloc_type from maasserver_staticipaddress;
 id | ip | alloc_type
----+----+------------
 11 | | 5
(1 row)

Changed in maas:
assignee: nobody → Ricardo Bánffy (rbanffy)
importance: Undecided → Critical
status: New → In Progress
Gavin Panella (allenap)
Changed in maas:
assignee: Ricardo Bánffy (rbanffy) → nobody
status: In Progress → Triaged
Revision history for this message
Andres Rodriguez (andreserl) wrote :

Dear user,

This is an automated message.

We believe this bug report is no longer an issue in the latest version of MAAS. For such reason, we are making this issue as Won't Fix. If you believe this issue is still present in the latest version of MAAS, please re-open this bug report.

Changed in maas:
status: Triaged → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.