StaticIPAddress object can't be deleted because its id attribute is set to None

Bug #1495889 reported by Gavin Panella on 2015-09-15
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
High
Blake Rouse

Bug Description

Found in regiond.log when starting commissioning via the web UI:

Error on request (23) node.action: StaticIPAddress object can't be
deleted because its id attribute is set to None.
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)
--- <exception caught here> ---
  File ".../twisted/python/threadpool.py", line 191, in _worker
    result = context.call(ctx, function, *args, **kwargs)
  File ".../twisted/python/context.py", line 118, in callWithContext
    return self.currentContext().callWithContext(ctx, func, *args, **kw)
  File ".../twisted/python/context.py", line 81, in callWithContext
    return func(*args,**kw)
  File ".../maasserver/utils/orm.py", line 481, in
  call_within_transaction
    return func_outside_txn(*args, **kwargs)
  File ".../maasserver/utils/orm.py", line 308, in retrier
    return func(*args, **kwargs)
  File ".../django/db/transaction.py", line 339, in inner
    return func(*args, **kwargs)
  File ".../maasserver/websockets/handlers/node.py", line 508, in action
    return action.execute(**extra_params)
  File ".../maasserver/node_action.py", line 248, in execute
    self.node.start_commissioning(self.user)
  File ".../maasserver/utils/orm.py", line 465, in
  call_within_transaction
    return func_within_txn(*args, **kwargs)
  File ".../django/db/transaction.py", line 339, in inner
    return func(*args, **kwargs)
  File ".../maasserver/models/node.py", line 921, in start_commissioning
    self._clear_networking_configuration()
  File ".../maasserver/models/node.py", line 1822, in
  _clear_networking_configuration
    interface.unlink_ip_address(ip_address)
  File ".../maasserver/models/interface.py", line 803, in
  unlink_ip_address
    self.ensure_link_up()
  File ".../maasserver/models/interface.py", line 753, in ensure_link_up
    self.link_subnet(INTERFACE_LINK_TYPE.LINK_UP, subnet)
  File ".../maasserver/models/interface.py", line 715, in link_subnet
    return self._link_subnet_link_up(subnet)
  File ".../maasserver/models/interface.py", line 682, in
  _link_subnet_link_up
    self._remove_link_up()
  File ".../maasserver/models/interface.py", line 577, in
  _remove_link_up
    ip.delete()
  File ".../django/db/models/base.py", line 691, in delete
    assert self._get_pk_val() is not None, "%s object can't be deleted
    because its %s attribute is set to None." % (self._meta.object_name,
    self._meta.pk.attname)
  exceptions.AssertionError: StaticIPAddress object can't be deleted
  because its id attribute is set to None.

Just before I had commissioned these nodes but aborted, so these nodes were marked as New.

Related branches

Gavin Panella (allenap) on 2015-09-15
Changed in maas:
status: New → Triaged
importance: Undecided → High
description: updated
Blake Rouse (blake-rouse) wrote :

This has already been fixed in trunk. Are you sure you where using the latest trunk? As the arguments to the unlink_ip_address method do not match the correct signature that is in trunk.

Changed in maas:
assignee: nobody → Blake Rouse (blake-rouse)
milestone: none → 1.9.0
status: Triaged → Fix Committed
Gavin Panella (allenap) wrote :

Sorry, my fault. I forgot to merge trunk into my branch before building packages.

Changed in maas:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers