-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
SyncExternalUsers is deactivating ldap users #3815
Comments
Do you have user filter set |
It should be |
no asterisk in the actual filter, no [see screen shot] - that's only appearing in the log output i don't know go really at all, but could that asterisk be coming from https://github.com/go-gitea/gitea/blob/master/modules/auth/ldap/ldap.go#L293 ? it looks like userFilter might be getting explicitly set with a literal '*'? |
what else can i do to troubleshoot this further? |
I experienced similar behaviour until I set the username attribute to |
setting username to sAMAaccountName didn't help... my gitea installation with active directory backend is still deactivating users... same goes for the instance with openldap backend... ;c( |
I can't seem to reproduce that |
I am not that fine with go... but returned two bools (which i assume was isadmin and isactive) while search result returns just isadmin |
I can verify the issue - upon each run of My user filter is much simpler:
|
I can verfiy the issue, too. I reverted to an older image.
|
We should maybe raise this issue to kind/bug tag and add to 1.5.0 release ? |
I can not seem to reproduce this bug with either MS AD or OpenLDAP :( |
@lafriks Any idea how we could further debug the problem? I am using the pre-build docker container. Also, in #3815 (comment) you mentioned that the filter should contain |
@liquidat I'm testing OpenLDAP with same configuration as in tests: https://github.com/go-gitea/gitea/blob/master/integrations/auth_ldap_test.go#L99 |
I realized that even if I add an admin filter which should match my user, the user is not an admin afterwards. |
I'm having the same issue. This behavior started maybe a week ago... everything was fine before. I updated my docker image one week before this started to happen. |
Can you please give your LDAP source configuration and LDAP server software being used. |
Using MS Active Directory: User Filter= (sAMAccountName=%s) |
@liquidat everyone can provide, the more cases are provided the better chances to find where is the problem |
LDAP Source configuration:
LDAP Server software:
|
i've just experienced some additional developments wrt to this issue. today, for the first time, i performed a git operation using ssh rather than http, and observed the following symptom:
if i activate the user manually [e.g. via the admin panel], the symptom is gone and i'm able to perform operations successfully. after the scheduled task runs and the user gets deactivated, the symptom reappears. git operations via https don't exhibit this symptom. they work even with the user inactive, in the same way i can log into the web ui, even with an inactive user. |
here are my configuration details [i'm sorry, i've had to mask some particulars]
the directory server is microsoft active directory, running on windows server 2008 r2 datacenter 64 bit service pack 1 |
We got the same issue here with OpenLDAP Authentication Type: LDAP (via BindDN)
Logfile
|
It seems this isse comes up, if you do the following:
then the userid doesnt match to id. Maybe it would make more sense, to check in ldap the username (uid, samaccountname) instead of using an id. |
in my case, the only local account is the administrator account. there are no other local accounts. |
@lafriks Any news? The complete notification stack (Gitea/Mail) is broken as a result of this behavior... |
@KimonHoffmann you can set in LDAP auth source to use paged search, this would fix size limit exceeded error. |
@lafriks yes, I know, sorry for not clearly expressing what I was trying to say. I was trying to give other people who are struggling with this error a hint on what may cause it. What I meant to say was that in my case the fact that the Active-flags were not synchronized from LDAP was a side effect of the sync job never running to completion, because it aborted prematurely with the "Size limit exceeded" error. Once I fixed the latter by enabling paging in the LDAP config, the Active flags were synchronized as expected. |
@KimonHoffmann I set the paging size 1000 and 2000 but I am still getting my users deactivated from Active Directory. What paging size did you use? |
@tonysgi: I have the paging set to the rather low value of 200. Please note that you can easily determine, whether or not the page size is the problem by looking for the "Size limit exceeded" message in the log, while performing a synchronization. I might be wrong in my assessment, but from what I've learned while investigating this problem on my installation is that the synchronization process appears to first fetch all user records and if that succeeded synchronizes the active flags in a second step. So any error that makes the first step not run to completion causes the active flags to be reset. Having a look into the logfile while the synchronization is in progress could yield pointers on what your specific problem may be. |
same problem! help wanted. #4402 |
In my case my problem was solved by case-sensitively setting user attributes as in the following list. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions. |
This issue has been automatically closed because of inactivity. You can re-open it if needed. |
We are hitting this same issue. I don't think is solved. Our log says when it disables all our users:
I check and our openldap server is configured with oclSizeLimit = 100, and on the gitea side we have marked it to Any ideas of how I can help to solve this issue? Things to look into? Tests that will be useful for that? |
What version are you using? |
We compiled ourselves gitea using the tag 1.8.3. |
same problem here, it only works if I manually specify the username attribute. My guess is that there is a bug in the search code compared to the authentication :) |
I am also having this issue. Latest docker, really small MS AD (its a lab), every time the sync runs it deactivates my user. Happy to grab any logs etc needed if you can mention what and where. |
please check gitea.log for any errors/warnings related to LDAP sync |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions. |
Imho this should be resolved on master branch |
I have the same problem. We are using gitea with: ssh=2.16.5 |
[x]
):Description
i've set up and am using ldap authentication. this seems to be working fine. users in the specified ldap group are able to log in, and are able to use the system. upon a new user's initial login, they are active, and the user management panel confirms this.
however, once SyncExternalUsers runs, it decides all ldap users need to be deactivated, and does so [see logs referenced above].
once this happens, the user is still able to log in, but is shown in the user management panel as inactive, and cannot be seen by other users [for example, in explore -> users].
users can be manually reactivated, by editing that user's settings in the user management panel, and the user is then again visible, etc., but as soon as SyncExternalUsers runs again, it deactivates everyone.
The text was updated successfully, but these errors were encountered: