Symptoms:
Jan 5 16:21:16 ###.##.#.# core[6020]: 2020-01-05T16:21:16Z [ERROR] [/core/controllers/base.go:109]: Error occurred in UserLogin: pq: duplicate key value violates unique constraint "harbor_user_email_key"
Note: The preceding log excerpts are only examples. Date, time, and environmental variables may vary depending on your environment.
This is by design. The Harbor database schema uses the Active Directory email field as a Key Value and will not cache or add a user with the same email value as a previously cached LDAP user.
Workaround:
If the old user with the same email address is no longer accessing Harbor you can remove the user from the Harbor database cache. This will not permanently resolve the issue if the removed user is going to continue to access Harbor though.
Contact Support for assistance in removing the old user.