Jonathan MERCIER opened issue #354767: Unable to update mail when is provided by LDAP at GitLab.org / GitLab

Jonathan MERCIER
2022-03-07T16:20:21Z

Dear,

I updated an user's mail on my LDAP server and gitlab continue to keep the old email.

What I done:

Update user's mail on LDAP

check by query ldap

# ldapsearch "uid=someone" mail
...
dn: uid=someone,cn=users,cn=accounts,dc=myorganization,dc=com
mail: firstname.lastname@myorganization.com

Go to my dedicated gitlab server

Open Admin Area -> Users -> I see the old mail

I tried to force by edit through the admin area -> Is not possible when it is managed by LDAP

Ok I go to force sync

# gitlab-rake gitlab:ldap:check
# gitlab-rake gitlab:ldap:group_sync

-> It is again old mail

I try to update it through rake console

> user = User.find_by_email("someone@gmail.com")
> user.email = "firstname.lastname@myorganization.com"
> user.save
=> false

-> That do not works!

Second try through rake console

> user = User.find_by_email("someone@gmail.com")
> user.public_email = "someone@gmail.com"
> user.email = "firstname.lastname@myorganization.com"
> user.save
=> true

finally the mail was updated successfully, but it is not easy. Is it possible to force ldap sync for user data ?

Thanks

Best regards