Note: Email addresses and usernames are masked for privacy reasons.
Expected Behavior
LDAP synchronization should successfully sync user accounts from Active Directory to Zammad without validation errors.
Actual Behavior
During LDAP sync, one specific user account fails to synchronize and gets deactivated with the following error:
log text
E, [2025-10-14T11:02:32.673879#3686711-196180] ERROR ā : Validation failed: Email address '***@***is already used for another user. (ActiveRecord::RecordInvalid)
The error repeats during each LDAP sync cycle.
Steps to Reproduce
Configure LDAP integration with Active Directory
Create/have a user in AD
Run LDAP synchronization
User fails to sync with āEmail address is already used for another userā error
User account becomes deactivated
What Iāve Already Tried
Searched the database for duplicates with ***@*** ā none found
Searched via web interface (active and inactive users) ā none found
Verified the AD mail attribute ā correctly formatted with @
Why does Zammad report āEmail address is already used for another userā when no duplicate exists?
Could this be related to orphaned records in the external_sync table or soft-deleted users?
What SQL queries or Rails console commands can I run to fully detect any email conflicts?
How can I resolve this issueāshould I merge or delete duplicates, adjust uniqueness settings, or take another approach?
Related Community Topics
I found similar issues reported:
However, none of these describe the exact scenario where no duplicate can be found in the database or UI.
Additional Information
The production.log shows this error on every sync cycle. The AD user attributes are valid, but Zammad refuses to sync the account, claiming an email conflict that cannot be found.
Any guidance on troubleshooting or resolving this would be greatly appreciated!
Log Excerpt
text:
I, [2025-10-14T11:02:32.538276#3686711-196180] INFO ā : Skipping. No Role assignment found for login ***
E, [2025-10-14T11:02:32.673879#3686711-196180] ERROR ā : Validation failed: Email address ā@ā is already used for another user. (ActiveRecord::RecordInvalid)
I, [2025-10-14T11:05:31.056163#3686711-196180] INFO ā : LDAP job end
If Iād had to bet, Iād say that the user in question was created by a different LDAP server before (even if it was deleted after).
I believe I told you several times, or I mistake you with someone else: Do never ever execute SQL queries, especially none that change data in Zammads database.
This can break existing functionality and even cause data loss.
Use the rails console. Executing ExternalSync.last will give you an idea of how the data structure looks like. As Iām out for a while on this topic, I neither have a LDAP absend instance to play with, nor do I remember the exact structure in that case.