Error: 'could not execute update query - ERROR: update or delete table "logical_network" violates foreign key constraint "fk_net_interface2logical_net" on table "network_interface" Detail: Key (id)=(###-###-##)' when deleting Org VDC in Cloud Director
search cancel

Error: 'could not execute update query - ERROR: update or delete table "logical_network" violates foreign key constraint "fk_net_interface2logical_net" on table "network_interface" Detail: Key (id)=(###-###-##)' when deleting Org VDC in Cloud Director

book

Article ID: 375420

calendar_today

Updated On:

Products

VMware Cloud Director

Issue/Introduction

  • Unable to remove Org VDC networks from an Organization VDC.
  • Unable to delete Organization VDC
  • Attempting to delete either the Org VDC or its network from the VMware Cloud Director (VCD) UI fails, and you see a message similar to:
    • Error: [ #######-####-####-####-########### ] could not execute update query - ERROR: update or delete on table "logical_network" violates foreign key constraint "fk_net_interface2logical_net" on table "network_interface" Detail: Key (id)=(#######-####-####-####-###########) is still referenced from table "network_interface".
  • The message may be related to another referenced network, such as:
    • ERROR: update or delete on table "logical_network" violates foreign key constraint "fk_logical2logical_network" on table "logical_network" Detail: Key (id)=(#######-####-####-####-###########) is still referenced from table "logical_network".
    • ERROR: "[############## ] Cannot delete organization VDC network ############ (###############) - could not delete: [com.vmware.vcloud.common.model.net.LogicalNetworkModel#############]; SQL [/* delete com.vmware.vcloud.common.model.net.LogicalNetworkModel */ delete from logical_network where id=? and version_number=?]; constraint [fk_logical2logical_network]; nested exception is org.hibernate.exception.ConstraintViolationException: could not delete: [com.vmware.vcloud.common.model.net.LogicalNetworkModel##########] - could not delete: [com.vmware.vcloud.common.model.net.LogicalNetworkModel#############] - ERROR: update or delete on table "logical_network" violates foreign key constraint "fk_logical2logical_network" on table "logical_network" Detail: Key (id)=(#############) is still referenced from table "logical_network"."
  • Need to remove stale network entries from the database

Environment

VMware Cloud Director 10.6.x

Cause

There are NICs listed in the network_interface table as connected to a logical network in this Org VDC.

These NICs are preventing deletion of the Org VDC as they are not connected to any VM which still exists.

Resolution

The workaround for this issue requires modification of the Cloud Director database.

For assistance, contact Broadcom Support and note this Article ID (375420) in the problem description. For more information, see this article: