Unable to delete a tenant in AVI Load Balancer
search cancel

Unable to delete a tenant in AVI Load Balancer

book

Article ID: 422382

calendar_today

Updated On:

Products

VMware Avi Load Balancer

Issue/Introduction

Symptoms:

  • While deleting a tenant, the below error is observed on the UI.
    • "We have encountered a problem during your request:"
      "Server Error"
  • Error when checked using the inspect element of the browser (right-click on empty space in the browser >> Inspect >> Network >> select request >> Header).

Environment

  • VMware AVI Load Balancer
    • 22.x
    • 30.x
    • 31.x

Cause

  • The error is seen when you have any reference object attached to the Tenant.
  • The error occurs due to a configured email referring to the Tenant.
    • In the /var/lib/avi/log/portal_exception.log on the controller, we could see the error while deleting the tenant . 

      • ERROR [error_handler.process_exception:95] ^[[31mError in DELETE /api/tenant/tenant-################### : ^[[0m
        Traceback (most recent call last):
          File "/opt/avi/python/lib/avi/rest/octavius.py", line 156, in send_octavius_grpc
            resp = grpc_action_method(req_pb)
          File "/usr/local/lib/python3.8/dist-packages/grpc/_channel.py", line 946, in __call__
            return _end_unary_response_blocking(state, call, False, None)
          File "/usr/local/lib/python3.8/dist-packages/grpc/_channel.py", line 849, in _end_unary_response_blocking
            raise _InactiveRpcError(state)
        grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
                status = StatusCode.UNKNOWN
                details = "ERROR: update or delete on table "api_tenant" violates foreign key constraint "api_alertemailc_tenant_ref_id_51aaaa002cd59cfb_fk_api_tenant_id" on table "api_alertemailconfig" (SQLSTATE 23503)"
                debug_error_string = "{"created":"@1765376663.430771373","description":"Error received from peer ipv4:127.0.0.1:5125","file":"src/core/lib/surface/call.cc","file_line":952,"grpc_message":"ERROR: update or delete on table "api_tenant" violates foreign key constraint "api_alertemailc_tenant_ref_id_-###################_api_tenant_id" on table "api_alertemailconfig" (SQLSTATE 23503)","grpc_status":2}"
        >

Resolution

  • Delete any configured email referencing the Tenant.