Description

Users may encounter the "Bad Request:  InputError: Site ABC-5067 has 1 active policy references. Please delete all policy references before attempting to delete the site" error in the Contrail Service Orchestration (CSO) UI while deleting a site. The error is due to stale entries in the database, which must be manually cleared in order to resolve the error.

This article explains how to manually clear these stale entries.

Symptoms

The following error is observed on the CSO UI while deleting a site:

Bad Request:  InputError: Site ABC-5067 has 1 active policy references. Please delete all policy references before attempting to delete the site.

Solution

This error is due to stale entries in the database that are not getting cleared with respect to this site. Manually clearing these back references will resolve the error.

To resolve the error, perform the following:

  1. Using the Postman API, get the UUID of the site that you need to delete. Search with the site-name as shown below to get an output and the UUID can be determined by using the output.

alt

  1. Using the following Postman API, check INTENT_POLICY_RULE_REF_extrefs for the site to get the UUID of the policy reference.

<Snip>
 
GET  https://<CSO IP?/topology-service/site/<site-uuid</a>>
 
                xtrefs": {
                                                                "INTENT_POLICY_RULE_REF_extrefs": {
                                                                                "30ffe467-d0f4-421b-ac7a-a3d15d40fd90": 1
  1. Delete the above policy reference UUID, which is the cause for the problem.

  2. Use the following API to delete the back reference associated with the site.

POST https://<cso</a> ip>t/topology-service/ref-count-update
 
{
    "ref-to-type": "site",
    "ref-from-type": "INTENT_POLICY_RULE_REF",
    "internal-object-type": "SITE",
    "ref-to-uuid": "4254d993-108e-4a6d-a5f4-59a5e20dd76e",   -> UUID of site
    "ref-from-uuid": "30ffe467-d0f4-421b-ac7a-a3d15d40fd90", - >UUID of policy reference
    "operation": "REF_DOWN"
}

After this is done, the site can be deleted without any problems.

Modification History

2023-05-17: Updated