Error: "Could not execute JDBC batch update; SQL [/* Method: OrgService.deleteUser */ /*" when deleting a user
search cancel

Error: "Could not execute JDBC batch update; SQL [/* Method: OrgService.deleteUser */ /*" when deleting a user

book

Article ID: 320429

calendar_today

Updated On:

Products

VMware Cloud Director

Issue/Introduction

  • When deleting a user in VMware Cloud Director (VCD) UI, the task fails and you may see an error similar to:

    Could not execute JDBC batch update; SQL [/* Method: OrgService.deleteUser */ /* delete com.vmware.vcloud.common.model.OrganizationMember */ delete from org_member where org_member_id=?]; constraint [fk_custom_entity2org_member]; nested exception is org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update - Could not execute JDBC batch update - Batch entry 0 /* Method: OrgService.deleteUser */ /* Method: OrgService.deleteUser */ /* delete com.vmware.vcloud.common.model.OrganizationMember */ delete from org_member where org_member_id='###'::uuid was aborted: ERROR: update or delete on table "org_member" violates foreign key constraint "fk_custom_entity2org_member" on table "defined_entity" Detail: Key (org_member_id)=(###) is still referenced from table "defined_entity". Call getNextException to see other errors in the batch. - ERROR: update or delete on table "org_member" violates foreign key constraint "fk_custom_entity2org_member" on table "defined_entity" Detail: Key (org_member_id)=(###) is still referenced from table "defined_entity".

  • This error may also be triggered by trying to delete a user with an account lacking the correct privileges

Environment

VMware Cloud Director 10.x

Cause

This issue may occur when there are stale database entries remain in the defined_entity table, preventing VMware Cloud Director from transferring ownership of objects associated with the user prior to deletion.

Resolution

Attempt to delete the user using a System Administrator (local) account by performing the following steps:

  1. Log in to the Provider Portal using a System Administrator account.
  2. Navigate to Administration > Users.
  3. Locate the user.
  4. Select user and click Disable.
  5. Once disabled, click Delete.

If this fails, database modifications may be required to resolve this issue.

Please open a Support Request with Broadcom Technical Support and reference this Knowledge Base article (Article ID: 320429).