Overview
In an on-premise deployment, when an external directory account’s attribute changes but some attribute remains the same, directory sync in IDE Services can fail due to a uniqueness conflict on email.
for example: duplicate key value violates unique constraint "TBE_USER_UNIQ_EMAIL"
This typically occurs because IDE Services still contains an older user record tied to the previous ser entry with the same attribute. The steps below describe how to remove the stale record so sync can recreate the user entry correctly.
Answer
Resolving LDAP Sync Failure
The directory sync failed because an account identifier changed in the external directory, which led to duplicate records in the IDE Services database. Follow these steps to resolve this issue:
-
-
Identify the stale user entry
- In the IDE Services Users page, find the user that still has the old username (for example,
usernaem) but the correct email (user.name@example.org). - Open that user and copy their ID (UUID).
- In the IDE Services Users page, find the user that still has the old username (for example,
-
Temporarily disable LDAP user import (but keep LDAP logins) In
application.yaml(or Helm values), set:tbe: users: import: enabled: false- Leave
tbe.auth.ldap.enabled: trueas it is, so LDAP logins remain available.. - Restart the IDE Services server so this change takes effect.
- During this step, scheduled LDAP user/group synchronization is paused, so it is recommended to do it during a short maintenance window.
- Leave
-
Delete the stale user via REST API
From an admin machine (using an Automation token with user‑management rights):
curl -v -L -X DELETE "https://<ides_host>/api/v1/users/<USER_ID>" \ -H "accept: */*" \ -H "Authorization: Automation <token_value>"Replace:
<ides_host>with your IDE Services URL.<USER_ID>with the UUID from step 1.<token_value>with your Automation token.
Expected result: HTTP 200 or 204, and the user no longer appears in the Users list.
-
Re‑enable LDAP user import
Restore import configuration, for example:
tbe: users: import: enabled: trueThen restart IDE Services again.
-
Run a manual sync and verify
- In the IDE Services Web UI, go to Users → Synchronize users (or wait for the next scheduled sync).
- Confirm:
- The sync completes without the
TBE_USER_UNIQ_EMAILerror. - The user is present once, with the correct
sAMAccountNameand the same email address.
- The sync completes without the
Repeat these steps for other clearly identified mis‑synced LDAP users, but it is recommented to limit it to confirmed problematic accounts.
-
Comments
0 comments
Please sign in to leave a comment.