LDAP users lost


I changed my LDAP hostname address and now I cannot get back my users.
I have 5-6 users that were created via LDAP, after changing the LDAP hostname, it tries to recreate the users but since they already exists, it fails:
2022/05/15 15:40:05 …/ldap/source_sync.go:120:Sync() [E] SyncExternalUsers[LDAP Synology]: Error creating user XXX: user already exists [name: XXX]

Not sure how to tell Gitea that those are the same users.
Also another strange thing is now I cannot see the users if I do “gitea admin users list”,

Any idea how to fix this? Thanks!

1 Like

Can you add an entry to /etc/hosts with the name of the previous LDAP server but with the new IP so that Gitea knows it is the same?

It was a fixed IP previously and switch to a hostname now. So I don’t think I can do that with /etc/hosts

The new hostname is converted to an IP, you just need to figure out which. Using

$ ping hostname

will tell you.

If you created a new auth source, the old users are still point to old auth source id with login_type and login_id. So they cannot be found. But I think it’s still a bug, the search condition is not same as creating condition.

Have you tried to rename the old logins and old mail addresses ? You should be able to recreate the users then…