LDAP Error 500

When I try to check my conf with gitlab-rake gitlab:ldap:check I have an error :

Checking LDAP ...

LDAP users with access to your GitLab server (only showing the first 100 results)
Server: ldapmain
rake aborted!
NoMethodError: undefined method `to_sym' for nil:NilClass
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/ldap/adapter.rb:26:in `users'
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/check.rake:791:in `block (2 levels) in print_users'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/ldap/adapter.rb:8:in `call'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/ldap/adapter.rb:8:in `block in open'
/opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/net-ldap-0.12.1/lib/net/ldap.rb:616:in `block in open'
/opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/net-ldap-0.12.1/lib/net/ldap.rb:685:in `block in open'
/opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/net-ldap-0.12.1/lib/net/ldap/instrumentation.rb:19:in `instrument'
/opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/net-ldap-0.12.1/lib/net/ldap.rb:680:in `open'
/opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/net-ldap-0.12.1/lib/net/ldap.rb:616:in `open'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/ldap/adapter.rb:7:in `open'
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/check.rake:790:in `block in print_users'
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/check.rake:788:in `each'
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/check.rake:788:in `print_users'
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/check.rake:775:in `block (3 levels) in <top (required)>'
Tasks: TOP => gitlab:ldap:check
(See full trace by running task with --trace)

My gitlab.rb file :

gitlab_rails['ldap_enabled'] = true
gitlab_rails['ldap_servers'] = YAML.load <<-'EOS' # remember to close this block with 'EOS' below

 main: # 'main' is the GitLab 'provider ID' of this LDAP server
    label: 'LDAP'
    host: 'myip'
    port: 389
#    uid: 'sAMAccountName'
    method: 'plain' # "tls" or "ssl" or "plain"
    bind_dn: 'cn=reader,dc=myldap,dc=fr'
    password: 'mypassword'
    active_directory: false
    base: 'ou=people,dc=myldap,dc=fr'
      username: 'uid'
      email:    'mail'
      name:       'cn'
      first_name: 'givenName'
      last_name:  'sn'

Gitlab starts, I can access to the login page but when I send my credentials, I have an error 500.
I use Gitlab Version : 8.6.2-ce.0 with omnibus on a Debian 8.3
Have you any ideas ?
Thanks for your help.

Hi everyone,

After modifying

#    uid: 'sAMAccountName'


uid: 'uid'`

It’s works better :slight_smile:


Thank you for marking the question as solved and still updating us on the solution :slight_smile:

1 Like