New users from LDAP fail with undefined method `each_with_index`
Summary
New users from LDAP can not be created.
Steps to reproduce
- Create new LDAP account
- Try to login to Gitlab
What is the current bug behavior?
Before 9.5.4-ee
this would result with new user being created. Not anymore.
Relevant logs and/or screenshots
unicorn/unicorn_stdout.log
:
I, [2017-09-12T15:33:04.348571 #65579] INFO -- omniauth: (ldapmain) Callback phase initiated.
E, [2017-09-12T15:33:04.506635 #65579] ERROR -- omniauth: (ldapmain) Authentication failure! ldap_error: ActionView::Template::Error, undefined method `each_with_index' for nil:NilClass
gitlab-rails/production_json.log
:
{"method":"POST","path":"/users/auth/ldapmain/callback","format":"html","controller":"OmniauthCallbacksController","action":"ldapmain","status":500,"error":"ActionView::Template::Error: undefined method `each_with_index' for nil:NilClass","duration":99.87,"view":0.0,"db":3.23,"time":"2017-09-12T15:05:48.344Z","params":{"utf8":"✓","authenticity_token":"[FILTERED]","username":"steve","password":"[FILTERED]"},"remote_ip":"[FILTERED]","user_id":null,"username":null}
{"method":"POST","path":"/users/auth/ldapmain/callback","format":"html","controller":"OmniauthCallbacksController","action":"failure","status":302,"duration":4.43,"view":0.0,"db":0.0,"location":"[FILTERED]/users/sign_in","time":"2017-09-12T15:05:48.444Z","params":{"utf8":"✓","authenticity_token":"[FILTERED]","username":"steve","password":"[FILTERED]"},"remote_ip":"[FILTERED]","user_id":null,"username":null}
{"method":"GET","path":"/users/sign_in","format":"html","controller":"SessionsController","action":"new","status":200,"duration":59.71,"view":47.44,"db":0.68,"time":"2017-09-12T15:05:48.616Z","params":{},"remote_ip":"[FILTERED]","user_id":null,"username":null}
Output of checks
Results of GitLab environment info
System information
System: Debian 8.9
Proxy: no
Current User: git
Using RVM: no
Ruby Version: 2.3.3p222
Gem Version: 2.6.6
Bundler Version:1.13.7
Rake Version: 12.0.0
Redis Version: 3.2.5
Git Version: 2.13.5
Sidekiq Version:5.0.4
Go Version: unknown
GitLab information
Version: 9.5.4-ee
Revision: 08803f6
Directory: /opt/gitlab/embedded/service/gitlab-rails
DB Adapter: postgresql
DB Version: 9.6.3
Elasticsearch: yes
Geo: no
Using LDAP: yes
Using Omniauth: no
GitLab Shell
Version: 5.8.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