无法从 Ldapmain 对您进行身份验证,因为"未定义的方法'外部电子邮件='



My Gitlab Environment:

  1. GitLab 9.5.2
  2. GitLab Shell 5.8.0
  3. GitLab 主力 v3.0.0
  4. GitLab API v4
  5. Git 2.13.5
  6. 红宝石 2.3.3p222
  7. 导轨 4.2.8
  8. PostgreSQL 9.6.3

我的 Gitlab LDAP 配置:

 gitlab_rails['ldap_enabled'] = true
##! **remember to close this block with 'EOS' below**
 gitlab_rails['ldap_servers'] = YAML.load <<-'EOS'
   main: # 'main' is the GitLab 'provider ID' of this LDAP server
     label: 'LDAP'
     host: '192.168.21.7'
     port: 389
     uid: 'mail'
     bind_dn: 'cn=MyUserName,ou=MIS,ou=SZ,dc=r-pac,dc=local'
     password: 'MyPassword'
     encryption: 'plain' # "start_tls" or "simple_tls" or "plain"
     verify_certificates: false
     ca_file: ''
     ssl_version: ''
     active_directory: true
     allow_username_or_email_login: false
     block_auto_created_users: false
     base: 'ou=MIS,ou=SZ,dc=r-pac,dc=local'
     user_filter: ''
     attributes:
       username: ['uid', 'userid', 'sAMAccountName']
       email:    ['mail']
       name:       'cn'
       first_name: 'givenName'
       last_name:  'sn'
     ## EE only
     group_base: ''
     admin_group: ''
     sync_ssh_keys: false
 EOS

我今天无法登录。这总是可能的。登录时抛出异常:

无法从 Ldapmain 对您进行身份验证,因为"未定义的方法 #<用户 的="外部电子邮件=">你的意思是? 外部="。

我执行命令检查gitlab-rake gitlab:ldap:check

Checking LDAP ...
Server: ldapmain
LDAP authentication... Success
LDAP users with access to your GitLab server (only showing the first 100 results)
......

有人可以帮助我吗?谢谢:)

问题的原因是我将Gitlab9.5.2版本升级到10.0.3
感谢 VonC 提供了指向类似问题解决方案的链接:

https://forum.gitlab.com/t/cannot-login-after-upgrade-to-9-0/7066
https://gitlab.com/gitlab-org/gitlab-ce/issues/29957我执行gitlab-rake db:migrategitlab-ctl restart命令,但没有工作LDAP身份验证登录仍然存在问题。

最后,我尝试升级到10.1.0,发现LDAP身份验证登录的问题解决了:)。

有这种问题的朋友,如果你也打算使用升级 解决LDAP身份验证登录问题的方法,请备份您的 Gitlab数据,一旦升级无法解决问题,请使用备份 数据还原和回滚Gitlab,避免一些意外 失败了,我的Gitlab就是这样一个悲惨的案例

最新更新