LDAP: NoMethodError after upgrading from 10.3.5-ee to 10.4.0-ee Docker
Summary
After upgrading from 10.3.5-ee to 10.4.0-ee the hosted GitLab Website and SSH (while pushing) sometimes raises an error 500.
If you have a look into the logs and check it sounds like a problem with LDAP?
Steps to reproduce
- Upgrade to 10.4.0-ee docker
- Visit host / push
What is the current bug behavior?
- After a refresh or retry of a push, the gitlab works normaly
What is the expected correct behavior?
- No error 500
Relevant logs and/or screenshots
gitlab_rails['ldap_servers'] = YAML.load <<-'EOS'
main: # 'main' is the GitLab 'provider ID' of this LDAP server
label: 'LDAP'
host: 'xxx.xx.xxxx'
port: 3268
uid: 'sAMAccountName'
bind_dn: 'CN=Administrator,OU=Users,OU=xx,DC=xx,DC=xx'
password: 'PW'
encryption: 'plain' # "start_tls" or "simple_tls" or "plain"
verify_certificates: false
timeout: 10
active_directory: true
allow_username_or_email_login: false
block_auto_created_users: false
base: 'DC=xx,DC=xx,DC=xx'
user_filter: '(memberOf=CN=SVN,OU=xx,OU=xx,DC=xx,DC=xx,DC=xx)'
attributes:
username: ['sAMAccountName']
email: ['mail', 'email', 'userPrincipalName']
first_name: 'givenName'
last_name: 'sn'
EOS
Log:
==> /var/log/gitlab/gitlab-rails/production.log <==
Started GET "/admin" for 172.17.0.1 at 2018-01-24 09:20:58 +0000
Processing by Admin::DashboardController#index as HTML
Completed 500 Internal Server Error in 23ms (ActiveRecord: 2.0ms | Elasticsearch: 0.0ms)
==> /var/log/gitlab/gitlab-rails/production_json.log <==
{"method":"GET","path":"/admin","format":"html","controller":"Admin::DashboardController","action":"index","status":500,"error":"NoMethodError: undefined method `downcase' for false:FalseClass","duration":25.13,"view":0.0,"db":2.03,"time":"2018-01-24T09:20:58.213Z","params":{},"remote_ip":"172.17.0.1","user_id":2,"username":"pbbd28"}
==> /var/log/gitlab/gitlab-rails/production.log <==
NoMethodError (undefined method `downcase' for false:FalseClass):
lib/gitlab/ldap/person.rb:124:in `map'
lib/gitlab/ldap/person.rb:124:in `validate_entry'
lib/gitlab/ldap/person.rb:71:in `initialize'
lib/gitlab/ldap/adapter.rb:39:in `new'
lib/gitlab/ldap/adapter.rb:39:in `block in users'
lib/gitlab/ldap/adapter.rb:38:in `map'
lib/gitlab/ldap/adapter.rb:38:in `users'
lib/gitlab/ldap/adapter.rb:44:in `user'
lib/gitlab/ldap/person.rb:23:in `find_by_dn'
lib/gitlab/ldap/access.rb:72:in `find_ldap_user'
lib/gitlab/ldap/access.rb:81:in `ldap_user'
lib/gitlab/ldap/access.rb:40:in `allowed?'
lib/gitlab/ldap/access.rb:21:in `block in allowed?'
lib/gitlab/ldap/access.rb:13:in `block in open'
lib/gitlab/ldap/adapter.rb:14:in `block in open'
lib/gitlab/ldap/adapter.rb:13:in `open'
lib/gitlab/ldap/access.rb:12:in `open'
lib/gitlab/ldap/access.rb:18:in `allowed?'
app/controllers/application_controller.rb:220:in `ldap_security_check'
lib/gitlab/middleware/multipart.rb:93:in `call'
lib/gitlab/request_profiler/middleware.rb:14:in `call'
lib/gitlab/jira/middleware.rb:15:in `call'
lib/gitlab/middleware/go.rb:18:in `call'
lib/gitlab/etag_caching/middleware.rb:11:in `call'
lib/gitlab/middleware/read_only.rb:31:in `call'
lib/gitlab/request_context.rb:18:in `call'
lib/gitlab/metrics/requests_rack_middleware.rb:27:in `call'
(Paste any relevant logs - please use code blocks (```) to format console output, logs, and code as it's very hard to read otherwise.)
Output of checks
- Docker Container
Results of GitLab environment info
Expand for output related to GitLab environment info
System information System: Proxy: no Current User: git Using RVM: no Ruby Version: 2.3.6p384 Gem Version: 2.6.13 Bundler Version:1.13.7 Rake Version: 12.3.0 Redis Version: 3.2.11 Git Version: 2.14.3 Sidekiq Version:5.0.5 Go Version: unknown
GitLab information Version: 10.4.0-ee Revision: 00592f0 Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: postgresql DB Version: 9.6.5 URL: http://xxx.xx.xxxx.com HTTP Clone URL: http://xxx.xx.xxxx/some-group/some-project.git SSH Clone URL: ssh://xxx.xx.xxxx/some-group/some-project.git Elasticsearch: no Geo: no Using LDAP: yes Using Omniauth: no
GitLab Shell Version: 5.11.0 Repository storage paths:
- default: /var/opt/gitlab/git-data/repositories Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks Git: /opt/gitlab/embedded/bin/git
Results of GitLab application Check
Expand for output related to the GitLab application check
Checking GitLab Shell ...
GitLab Shell version >= 5.11.0 ? ... OK (5.11.0) Repo base directory exists? default... yes Repo storage directories are symlinks? default... no Repo paths owned by git:root, or git:git? default... yes Repo paths access is drwxrws---? default... yes hooks directories in repos are links: ... 5/1 ... ok 5/2 ... ok 5/3 ... ok 5/4 ... ok 2/7 ... ok 21/9 ... ok 5/10 ... ok 5/11 ... ok 9/12 ... ok 18/17 ... ok 18/20 ... ok Running /opt/gitlab/embedded/service/gitlab-shell/bin/check Check GitLab API access: OK Redis available via internal API: OK
Access to /var/opt/gitlab/.ssh/authorized_keys: OK gitlab-shell self-check successful
Checking GitLab Shell ... Finished
Checking Sidekiq ...
Running? ... yes Number of Sidekiq processes ... 1
Checking Sidekiq ... Finished
Reply by email is disabled in config/gitlab.yml Checking LDAP ...
Server: ldapmain LDAP authentication... Success LDAP users with access to your GitLab server (only showing the first 100 results) rake aborted! NoMethodError: undefined method
downcase' for false:FalseClass /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/ldap/person.rb:124:inmap' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/ldap/person.rb:124:invalidate_entry' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/ldap/person.rb:71:ininitialize' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/ldap/adapter.rb:39:innew' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/ldap/adapter.rb:39:inblock in users' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/ldap/adapter.rb:38:inmap' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/ldap/adapter.rb:38:inusers' /opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/check.rake:364:inblock (2 levels) in check_ldap' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/ldap/adapter.rb:14:inblock in open' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/ldap/adapter.rb:13:inopen' /opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/check.rake:359:inblock in check_ldap' /opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/check.rake:355:ineach' /opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/check.rake:355:incheck_ldap' /opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/check.rake:344:inblock (3 levels) in <top (required)>' /opt/gitlab/embedded/bin/bundle:23:inload' /opt/gitlab/embedded/bin/bundle:23:in `' Tasks: TOP => gitlab:check => gitlab:ldap:check (See full trace by running task with --trace)