Error: "Batch update returned unexpected row count" when adding Active Directory users in VMware Cloud Director
search cancel

Error: "Batch update returned unexpected row count" when adding Active Directory users in VMware Cloud Director

book

Article ID: 426551

calendar_today

Updated On:

Products

VMware Cloud Director

Issue/Introduction

  • When attempting to import or add users from an Active Directory (AD) or LDAP identity provider into a VMware Cloud Director (VCD) Organization, the operation fails.
  • The UI displays a a failure message
  • The vcloud-container-debug.log contains the following error pattern: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
  • Database logs reveal a unique constraint violation: Detail: Key (org_id, member_type, member_name)=(<ORG_UUID>, 1, <USERNAME>) already exists.

Environment

VMware vCloud Director

Cause

The issue is caused by a duplicate username conflict within the VCD database. VCD enforces a unique constraint on the combination of org_id, member_type, and member_name in the usr table.

This typically occurs during domain migrations or when multiple identity sources are used for the same Organization. If a username (e.g., jsmith) already exists in the Organization from an "Old Domain," VCD will reject the creation of a user with the same name from a "New Domain," even though they are technically different accounts in Active Directory.

Resolution

To resolve this issue, the conflicting user record must be removed or modified so the new identity can be registered.

  1. Log in to the VMware Cloud Director Tenant Portal as an Organization Administrator.
  2. Navigate to Administration > Users.
  3. Search for the username(s) identified in the error message.
  4. Verify which identity provider the existing user belongs to.
  5. If the user belongs to the decommissioned or "Old" domain:
  6. Right-click the user and select Disable (optional safety step).
  7. Right-click the user and select Delete.
    • Note: If the user owns resources (vApps, Catalogs), you must select Transfer Ownership before the system allows deletion.
  8. Once the old user is deleted, attempt to add the user from the New Domain again.