Error:"update or delete on table "gateway_logical_resource" violates foreign key constraint "fk_firewa_group2gate_logi_res" on table "firewall_group"" when deleting edge gateway.
search cancel

Error:"update or delete on table "gateway_logical_resource" violates foreign key constraint "fk_firewa_group2gate_logi_res" on table "firewall_group"" when deleting edge gateway.

book

Article ID: 421998

calendar_today

Updated On:

Products

VMware Cloud Director

Issue/Introduction

  • Deleting an edge gateway from VMware Cloud Director(VCD) UI fails with the error:

 could not delete: [com.vmware.vcloud.common.model.logicalresource.GatewayLogicalResourceModel#########-####-####-####-############]
 - ERROR: update or delete on table "gateway_logical_resource" violates foreign key constraint "fk_firewa_group2gate_logi_res" on table "firewall_group"
  Detail: Key (id)=(########-####-####-####-############) is still referenced from table "firewall_group".

  • Deleting the Organization VDC(OVDC) where the edge gateway is present fails due to gateway references.

Environment

VMware Cloud Director 10.6.1.2

Cause

Child objects can prevent the parent objects from getting removed.  Edge gateways and it's child objects should be successfully removed before an OVDC can be deleted.

Resolution

To resolve the issue, the edge gateway can be deleted via the API and then the OVDC can be deleted via the UI.

  1. Identify the UUID of the gateway in the OVDC. 
    1. Navigate to the tenant portal > Data Centers > <Affected Data Center> > Under Networking > Edges
    2. Select the affected gateway from the list.
    3. The UI will show the General information of the gateway and the URL in the browser will now be updated to the format below:
      https://<VCD IP or FQDN>/tenant/<Tenant Name>/vdcs/########-####-####-####-############/org-vdc-edge-gateways/cloud/urn:vcloud:gateway:########-####-####-####-############/config/general
    4. Note the UUID of the format urn:vcloud:gateway:########-####-####-####-############ to proceed with the next steps.
  2. Establish a connection via API. See How to establish an API connection VMware Cloud Director 
  3. With Swagger UI, check the 'edgeGateway' section to manage individual edge gateway(s):
    1. Using GET request and the UUID captured in Step 1, retrieve the information of the gateway to be deleted.
    2. Using the DELETE request  and the UUID captured in Step 1, remove the gateway. Select the force option to be 'true'.
    3. Verify from the VCD UI that the edge is removed successfully.
  4. Delete the OVDC from the UI and verify it is successful.

If the above does not resolve the issue,contact Broadcom Support and note this Article ID (421998) in the problem description. For more information, see Creating and managing Broadcom support cases.

Additional Information

Edge Gateway APIs