500 error when performing search
Steps to reproduce
Entering text into the search box & hitting return causes a 500 error.
Expected behavior
Search results
Actual behavior
500 server error
Relevant logs and/or screenshots
Started GET "/search/autocomplete?project_id=&project_ref=&term=retry" for 108.193.48.141 at 2016-09-23 18:49:55 +0000
Processing by SearchController#autocomplete as */*
Parameters: {"project_id"=>"", "project_ref"=>"", "term"=>"retry"}
Completed 200 OK in 47ms (Views: 0.1ms | ActiveRecord: 7.6ms)
Started GET "/search?utf8=%E2%9C%93&search=retry&group_id=&project_id=&repository_ref=" for 108.193.48.141 at 2016-09-23 18:49:55 +0000
Processing by SearchController#show as HTML
Parameters: {"utf8"=>"✓", "search"=>"retry", "group_id"=>"", "project_id"=>"", "repository_ref"=>""}
Completed 500 Internal Server Error in 101ms (ActiveRecord: 3.9ms)
ActionView::Template::Error ([500] {"took":18,"timed_out":false,"_shards":{"total":5,"successful":0,"failed":5,"failures":[{"shard":0,"index":"gitlab-production","node":"2tFyqFUnSU6lqXBBEV0m6g","reason":{"type":"illegal_state_exception","reason":"can't load global ordinals for reader of type: class org.apache.lucene.search.highlight.WeightedSpanTermExtractor$DelegatingLeafReader must be a DirectoryReader"}}]},"hits":{"total":50,"max_score":1.485551,"hits":[]}}):
74: = link_to search_filter_path(scope: 'blobs') do
75: Code
76: %span.badge
77: = @search_results.blobs_count
78: %li{class: ("active" if @scope == 'commits')}
79: = link_to search_filter_path(scope: 'commits') do
80: Commits
lib/gitlab/elastic/search_results.rb:107:in `blobs'
lib/gitlab/elastic/search_results.rb:41:in `blobs_count'
app/views/search/_category.html.haml:77:in `block in _app_views_search__category_html_haml___1551257166066962752_52711880'
app/views/search/_category.html.haml:74:in `_app_views_search__category_html_haml___1551257166066962752_52711880'
app/views/search/show.html.haml:6:in `_app_views_search_show_html_haml__1101617400580891753_55540660'
lib/gitlab/request_profiler/middleware.rb:15:in `call'
lib/gitlab/middleware/go.rb:16:in `call'
lib/gitlab/middleware/readonly_geo.rb:29:in `call'
Output of checks
Results of GitLab application Check
$ sudo gitlab-rake gitlab:check SANITIZE=true
Checking GitLab Shell ...
GitLab Shell version >= 3.6.0 ? ... OK (3.6.0)
Repo base directory exists?
default... yes
Repo storage directories are symlinks?
default... no
Repo paths owned by git:git?
default... yes
Repo paths access is drwxrws---?
default... yes
hooks directories in repos are links: ...
3/3 ... ok
2/4 ... ok
2/5 ... ok
3/6 ... ok
3/7 ... ok
3/8 ... ok
4/9 ... ok
3/10 ... ok
4/11 ... ok
4/12 ... ok
4/13 ... ok
2/14 ... ok
4/15 ... ok
4/16 ... ok
2/17 ... ok
2/18 ... ok
3/20 ... ok
2/25 ... ok
2/26 ... ok
2/27 ... ok
3/28 ... ok
5/29 ... ok
2/31 ... ok
2/32 ... ok
2/34 ... ok
2/35 ... ok
2/36 ... ok
2/37 ... ok
2/38 ... ok
2/39 ... ok
2/40 ... ok
2/41 ... ok
2/44 ... ok
2/45 ... ok
3/46 ... ok
2/47 ... ok
2/48 ... ok
3/49 ... ok
3/50 ... ok
5/51 ... ok
2/52 ... ok
2/53 ... ok
2/54 ... ok
2/55 ... ok
2/56 ... ok
2/57 ... ok
2/58 ... ok
2/60 ... ok
2/61 ... ok
3/62 ... ok
3/63 ... ok
3/64 ... ok
3/65 ... ok
3/66 ... ok
3/67 ... ok
3/68 ... ok
3/69 ... ok
3/70 ... ok
3/71 ... ok
3/72 ... ok
3/73 ... ok
3/74 ... ok
3/75 ... ok
3/76 ... ok
3/77 ... ok
3/78 ... ok
3/79 ... ok
3/80 ... ok
3/81 ... ok
3/82 ... ok
3/83 ... ok
3/84 ... ok
3/85 ... ok
3/86 ... ok
6/87 ... ok
2/88 ... ok
8/90 ... ok
2/91 ... ok
8/92 ... ok
8/93 ... ok
8/94 ... ok
8/95 ... ok
8/96 ... ok
2/97 ... ok
8/98 ... ok
8/99 ... ok
2/100 ... ok
2/101 ... ok
8/102 ... ok
8/103 ... ok
9/105 ... ok
2/106 ... ok
3/107 ... 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 ...
IMAP server credentials are correct? ... yes
Init.d configured correctly? ... skipped (omnibus-gitlab has no init script)
MailRoom running? ... can't check because of previous errors
Checking Reply by email ... Finished
Checking LDAP ...
LDAP is disabled in config/gitlab.yml
Checking LDAP ... Finished
Checking GitLab ...
Git configured with autocrlf=input? ... yes
Database config exists? ... yes
All migrations up? ... yes
Database contains orphaned GroupMembers? ... no
GitLab config exists? ... yes
GitLab config outdated? ... no
Log directory writable? ... yes
Tmp directory writable? ... yes
Uploads directory setup correctly? ... 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: ...
3/3 ... yes
2/4 ... yes
2/5 ... yes
3/6 ... yes
3/7 ... yes
3/8 ... yes
4/9 ... yes
3/10 ... yes
4/11 ... yes
4/12 ... yes
4/13 ... yes
2/14 ... yes
4/15 ... yes
4/16 ... yes
2/17 ... yes
2/18 ... yes
3/20 ... yes
2/25 ... yes
2/26 ... yes
2/27 ... yes
3/28 ... yes
5/29 ... yes
2/31 ... yes
2/32 ... yes
2/34 ... yes
2/35 ... yes
2/36 ... yes
2/37 ... yes
2/38 ... yes
2/39 ... yes
2/40 ... yes
2/41 ... yes
2/44 ... yes
2/45 ... yes
3/46 ... yes
2/47 ... yes
2/48 ... yes
3/49 ... yes
3/50 ... yes
5/51 ... yes
2/52 ... yes
2/53 ... yes
2/54 ... yes
2/55 ... yes
2/56 ... yes
2/57 ... yes
2/58 ... yes
2/60 ... yes
2/61 ... yes
3/62 ... yes
3/63 ... yes
3/64 ... yes
3/65 ... yes
3/66 ... yes
3/67 ... yes
3/68 ... yes
3/69 ... yes
3/70 ... yes
3/71 ... yes
3/72 ... yes
3/73 ... yes
3/74 ... yes
3/75 ... yes
3/76 ... yes
3/77 ... yes
3/78 ... yes
3/79 ... yes
3/80 ... yes
3/81 ... yes
3/82 ... yes
3/83 ... yes
3/84 ... yes
3/85 ... yes
3/86 ... yes
6/87 ... yes
2/88 ... yes
8/90 ... yes
2/91 ... yes
8/92 ... yes
8/93 ... yes
8/94 ... yes
8/95 ... yes
8/96 ... yes
2/97 ... yes
8/98 ... yes
8/99 ... yes
2/100 ... yes
2/101 ... yes
8/102 ... yes
8/103 ... yes
9/105 ... yes
2/106 ... yes
3/107 ... yes
Redis version >= 2.8.0? ... yes
Ruby version >= 2.1.0 ? ... yes (2.3.1)
Your git bin path is "/opt/gitlab/embedded/bin/git"
Git version >= 2.7.3 ? ... yes (2.7.4)
Active users: 4
Elasticsearch version >= 2.0? ... yes (2.3.1)
Elasticsearch has plugin delete-by-query installed? ... no
Checking GitLab ... Finished
Results of GitLab environment info
$ sudo gitlab-rake gitlab:env:info
System information
System: Ubuntu 16.04
Current User: git
Using RVM: no
Ruby Version: 2.3.1p112
Gem Version: 2.6.6
Bundler Version:1.13.1
Rake Version: 10.5.0
Sidekiq Version:4.1.4
GitLab information
Version: 8.12.0-ee
Revision: 0af2753
Directory: /opt/gitlab/embedded/service/gitlab-rails
DB Adapter: PostgreSQL
DB Version: 9.2.18
URL: https://gitlab.example.com
HTTP Clone URL: https://gitlab.example.com/some-group/some-project.git
SSH Clone URL: git@gitlab.example.com:some-group/some-project.git
Elasticsearch: yes
Geo: no
Using LDAP: no
Using Omniauth: yes
Omniauth Providers: gitlab, github
GitLab Shell
Version: 3.6.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