Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

failed to update ldap user (Duplicate entry in BD) #258

Open
Alexander-Kazandzhiyan opened this issue Apr 25, 2024 · 2 comments
Open

failed to update ldap user (Duplicate entry in BD) #258

Alexander-Kazandzhiyan opened this issue Apr 25, 2024 · 2 comments
Labels
bug Something isn't working v1 Old version of wg-portal

Comments

@Alexander-Kazandzhiyan
Copy link

We have a problem
portal v.1.0.18
LDAP - FreeIPA server

Variables:
LDAP_BASEDN=cn=users,cn=accounts,dc=example,dc=com
LDAP_SYNC_FILTER=(&(objectClass=organizationalPerson)(memberof=cn=vpnusers,cn=groups,cn=accounts,dc=example,dc=com))
LDAP_LOGIN_FILTER=(&(objectClass=organizationalPerson)(memberof=cn=vpnusers,cn=groups,cn=accounts,dc=example,dc=com)(!(nsaccountlock=TRUE))(uid={{login_identifier}}))
LDAP_ATTR_GROUPS=memberOf
LDAP_ADMIN_GROUP=cn=vpnadmins,cn=groups,cn=accounts,dc=example,dc=com

All working good. All users of group vpnusers is in portals user-list. But if on FreeIPA i remove user, for example, testvpn1 from group vpnusers it marks red in user-list in portal. Its ok. But When i add this user in vpnusers group back we have errors in docker logs of portal:
if we use sqlite:

DEBU[2024-04-25 13:49:16] updating ldap user [email protected]
ERRO[2024-04-25 13:49:16] failed to update ldap user [email protected] in database: failed to update user [email protected]: UNIQUE constraint failed: users.email

if we use mysql:

DEBU[2024-04-25 13:53:56] updating ldap user [email protected]
ERRO[2024-04-25 13:53:56] failed to update ldap user [email protected] in database: failed to update user [email protected]: Error 1062 (23000): Duplicate entry '[email protected]' for key 'users.PRIMARY'

and user testvpn1 still red in user-list.

Do you know this problem? What we must to do with this situation?
PS Now We have around 8 users with this truble.

@Alexander-Kazandzhiyan
Copy link
Author

if i select user record from DB i see that user mark deleted

mysql> select * from users where firstname = 'testvpn1';
+-----------------------+--------+----------+-----------+----------+-------+----------+-------------------------+-------------------------+-------------------------+
| email                 | source | is_admin | firstname | lastname | phone | password | created_at              | updated_at              | deleted_at              |
+-----------------------+--------+----------+-----------+----------+-------+----------+-------------------------+-------------------------+-------------------------+
| [email protected] | ldap   |        0 | testvpn1  | testvpn1 |       |          | 2023-10-12 09:56:41.886 | 2023-10-12 09:56:41.891 | 2024-04-25 13:47:52.948 |
+-----------------------+--------+----------+-----------+----------+-------+----------+-------------------------+-------------------------+-------------------------+
1 row in set (0.00 sec)

@h44z h44z added v1 Old version of wg-portal bug Something isn't working labels Jul 4, 2024
@WiseLife42
Copy link

Hi,

Have you found the solution yet?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working v1 Old version of wg-portal
Projects
None yet
Development

No branches or pull requests

3 participants