LDAP Group Sync Search Box Broken
Summary
When trying to sync a group with LDAP, the "LDAP Group cn" search box never returns. Looking at the browser console, there are multiple javascript errors. The network tab shows the search request successful, with accurate search results.
Steps to reproduce
- Have GitLab installed w/ LDAP configured
- Create a group
- Navigate to settings -> LDAP Group
- Open browser console.
- Try to search for an LDAP group.
- Observe the search never returns & multiple errors in the browser console.
This was tested on both Chrome and FireFox.
What is the current bug behavior?
LDAP group search does not respond/populate.
What is the expected correct behavior?
LDAP group search should show group search results.
Relevant logs and/or screenshots
Console Log: ``` api.js:176 Uncaught TypeError: a.wrapAjaxCall(...).done is not a function at Object.ldap_groups (api.js:176) at Object.query (ldap_groups_select.js:23) at n.updateResults (select2.js:1772) at HTMLInputElement. (select2.js:681) at HTMLInputElement.dispatch (jquery.js:4732) at HTMLInputElement.g.handle (jquery.js:4544)
UI, console & network response Screenshots below.



### Output of checks
#### Results of GitLab environment info
<details>
<summary>Expand for output related to GitLab environment info</summary>
<pre>
sudo gitlab-rake gitlab:env:info
System information
System: CentOS 7.3.1611
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: 10.5.0
Redis Version: 3.2.5
Git Version: 2.13.0
Sidekiq Version:5.0.0
Go Version: unknown
GitLab information
Version: 9.3.0-ee
Revision: 7523f02
Directory: /opt/gitlab/embedded/service/gitlab-rails
DB Adapter: postgresql
DB Version: 9.6.3
URL: https://<GitLab URL>
HTTP Clone URL: https://<GitLab URL>/some-group/some-project.git
SSH Clone URL: git@<GitLab URL>:some-group/some-project.git
Elasticsearch: yes
Geo: yes
Geo node: Primary
Using LDAP: yes
Using Omniauth: no
GitLab Shell
Version: 5.0.5
Repository storage paths:
- default: /gitlab/data/repositories
Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks
Git: /opt/gitlab/embedded/bin/git
</pre>
</details>
#### Results of GitLab application Check
<details>
<summary>Expand for output related to the GitLab application check</summary>
<pre>
$ sudo gitlab-rake gitlab:check SANITIZE=true
Checking GitLab Shell ...
GitLab Shell version >= 5.0.5 ? ... OK (5.0.5)
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: ...
2/1 ... ok
2/2 ... ok
8/4 ... repository is empty
14/6 ... ok
12/27 ... ok
12/28 ... ok
15/29 ... ok
15/30 ... ok
12/31 ... ok
16/32 ... ok
16/33 ... ok
16/34 ... ok
16/35 ... ok
16/36 ... ok
16/37 ... ok
16/39 ... ok
16/40 ... ok
16/41 ... ok
6/45 ... ok
27/46 ... ok
20/47 ... ok
15/48 ... ok
27/49 ... ok
27/50 ... ok
23/52 ... ok
14/53 ... ok
14/54 ... ok
13/55 ... ok
15/57 ... ok
14/58 ... ok
43/59 ... ok
43/61 ... ok
9/62 ... ok
12/63 ... ok
52/65 ... repository is empty
6/67 ... ok
6/68 ... ok
27/69 ... ok
8/70 ... ok
43/71 ... ok
14/72 ... ok
34/73 ... ok
56/74 ... ok
27/75 ... ok
61/77 ... ok
6/78 ... ok
55/79 ... repository is empty
62/81 ... ok
43/83 ... ok
43/84 ... ok
63/85 ... repository is empty
66/86 ... ok
55/88 ... repository is empty
34/90 ... repository is empty
42/91 ... ok
Running /opt/gitlab/embedded/service/gitlab-shell/bin/check
Check GitLab API access: OK
Access to /var/opt/gitlab/.ssh/authorized_keys: OK
Send ping to redis server: OK
gitlab-shell self-check successful
Checking GitLab Shell ... Finished
Checking Sidekiq ...
Running? ... yes
Number of Sidekiq processes ... 1
Checking Sidekiq ... Finished
Checking Reply by email ...
Reply by email is disabled in config/gitlab.yml
Checking Reply by email ... Finished
Checking LDAP ...
Server: ldapmain
LDAP authentication... Success
LDAP users with access to your GitLab server (only showing the first 100 results )
<LDAP User Info>
Checking LDAP ... Finished
Checking GitLab ...
Git configured correctly? ... yes
Database config exists? ... yes
All migrations up? ... yes
Database contains orphaned GroupMembers? ... no
GitLab config exists? ... yes
GitLab config up to date? ... yes
Log directory writable? ... yes
Tmp directory writable? ... yes
Uploads directory exists? ... yes
Uploads directory has correct permissions? ... yes
Uploads directory tmp has correct permissions? ... yes
Init script exists? ... skipped (omnibus-gitlab has no init script)
Init script up-to-date? ... skipped (omnibus-gitlab has no init script)
Projects have namespace: ...
2/1 ... yes
2/2 ... yes
8/4 ... yes
14/6 ... yes
12/27 ... yes
12/28 ... yes
15/29 ... yes
15/30 ... yes
12/31 ... yes
16/32 ... yes
16/33 ... yes
16/34 ... yes
16/35 ... yes
16/36 ... yes
16/37 ... yes
16/39 ... yes
16/40 ... yes
16/41 ... yes
6/45 ... yes
27/46 ... yes
20/47 ... yes
15/48 ... yes
27/49 ... yes
27/50 ... yes
23/52 ... yes
14/53 ... yes
14/54 ... yes
13/55 ... yes
15/57 ... yes
14/58 ... yes
43/59 ... yes
43/61 ... yes
9/62 ... yes
12/63 ... yes
52/65 ... yes
6/67 ... yes
6/68 ... yes
27/69 ... yes
8/70 ... yes
43/71 ... yes
14/72 ... yes
34/73 ... yes
56/74 ... yes
27/75 ... yes
61/77 ... yes
6/78 ... yes
55/79 ... yes
62/81 ... yes
43/83 ... yes
43/84 ... yes
63/85 ... yes
66/86 ... yes
55/88 ... yes
34/90 ... yes
42/91 ... yes
Redis version >= 2.8.0? ... yes
Ruby version >= 2.3.3 ? ... yes (2.3.3)
Git version >= 2.7.3 ? ... yes (2.13.0)
Active users: ... 54
Elasticsearch version 5.1 - 5.3? ... rake aborted!
NameError: undefined local variable or method `current_version' for #<SystemChec k::App::ElasticsearchCheck:0x007f2a098920a8>
Did you mean? checkout_version
/opt/gitlab/embedded/service/gitlab-rails/lib/system_check/app/elasticsearch_che ck.rb:21:in `check?'
/opt/gitlab/embedded/service/gitlab-rails/lib/system_check/simple_executor.rb:61 :in `run_check'
/opt/gitlab/embedded/service/gitlab-rails/lib/system_check/simple_executor.rb:35 :in `block in execute'
/opt/gitlab/embedded/service/gitlab-rails/lib/system_check/simple_executor.rb:34 :in `execute'
/opt/gitlab/embedded/service/gitlab-rails/lib/system_check.rb:19:in `run'
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/check.rake:42:in `blo ck (3 levels) in <main>'
/opt/gitlab/embedded/bin/bundle:22:in `load'
/opt/gitlab/embedded/bin/bundle:22:in `<main>'
Tasks: TOP => gitlab:check => gitlab:app:check
(See full trace by running task with --trace)
</pre>
</details>
### Possible fixes
None