Unable to delete node due to maasserver_interface_ip_address violation

Bug #1496097 reported by Lee Trager
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
MAAS
Fix Released
Critical
Blake Rouse

Bug Description

After the new network model landed I am unable to delete nodes after they have been commissioned. The following was seen on a fresh MAAS install

From region.log
2015-09-15 12:01:26 [-] Error on request (17) node.action: insert or update on table "maasserver_interface_ip_addresses" violates foreign key constraint "interface_id_refs_id_1d0a9cd9772ab207"
 DETAIL: Key (interface_id)=(2) is not present in table "maasserver_interface".

 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 "/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/maasserver/utils/orm.py", line 481, in call_within_transaction
     return func_outside_txn(*args, **kwargs)
   File "/usr/lib/python2.7/dist-packages/maasserver/utils/orm.py", line 308, 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/django/db/transaction.py", line 305, in __exit__
     connection.commit()
   File "/usr/lib/python2.7/dist-packages/django/db/backends/__init__.py", line 168, in commit
     self._commit()
   File "/usr/lib/python2.7/dist-packages/django/db/backends/__init__.py", line 136, in _commit
     return self.connection.commit()
   File "/usr/lib/python2.7/dist-packages/django/db/utils.py", line 99, in __exit__
     six.reraise(dj_exc_type, dj_exc_value, traceback)
   File "/usr/lib/python2.7/dist-packages/django/db/backends/__init__.py", line 136, in _commit
     return self.connection.commit()
 django.db.utils.IntegrityError: insert or update on table "maasserver_interface_ip_addresses" violates foreign key constraint "interface_id_refs_id_1d0a9cd9772ab207"
 DETAIL: Key (interface_id)=(2) is not present in table "maasserver_interface".

The UI gives the following when trying to delete a node
The delete action for 1 node failed with the error: insert or update on table "maasserver_interface_ip_addresses" violates foreign key contraint "interface_id_refs_id_1d0a9cd9772ab207" DETAIL: Key (interface_id)=(2) is not present in table "maasserver_interface".

Related branches

Changed in maas:
assignee: nobody → Blake Rouse (blake-rouse)
milestone: none → 1.9.0
Revision history for this message
Blake Rouse (blake-rouse) wrote :

This also affects the ability to delete an interface.

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

Duplicates of this bug

Other bug subscribers

Remote bug watches

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