Some search with elasticsearch leads to 500 errors

Hello,

for some keywords in search we end up on 500 error page, for example role leads to the following error:

Completed 500 Internal Server Error in 483ms (ActiveRecord: 8.6ms | Elasticsearch: 307.0ms)

ActionView::Template::Error (undefined method `repository' for nil:NilClass):
     8:     = link_to search_filter_path(scope: 'commits') do
     9:       = _("Commits")
    10:       %span.badge.badge-pill
    11:         = limited_count(@search_results.commits_count)
    12:   %li{ class: active_when(@scope == 'wiki_blobs') }
    13:     = link_to search_filter_path(scope: 'wiki_blobs') do
    14:       = _("Wiki")

ee/app/models/concerns/elastic/repositories_search.rb:66:in `block in find_commits_by_message_with_elastic'
ee/app/models/concerns/elastic/repositories_search.rb:62:in `map'
ee/app/models/concerns/elastic/repositories_search.rb:62:in `find_commits_by_message_with_elastic'
ee/lib/gitlab/elastic/search_results.rb:240:in `block in commits'
gitlab-rake gitlab:check SANITIZE=true:
Checking GitLab subtasks ...

Checking GitLab Shell ...

GitLab Shell: ... GitLab Shell version >= 9.3.0 ? ... OK (9.3.0)
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 Gitaly ...

Gitaly: ... default ... OK

Checking Gitaly ... Finished

Checking Sidekiq ...

Sidekiq: ... Running? ... yes
Number of Sidekiq processes ... 1

Checking Sidekiq ... Finished

Checking Incoming Email ...

Incoming Email: ... Reply by email is disabled in config/gitlab.yml

Checking Incoming Email ... Finished

Checking LDAP ...

LDAP: ... Server: ldapmain
not verifying SSL hostname of LDAPS server 'ldap.kaliop.net:636'
LDAP authentication... Anonymous. No `bind_dn` or `password` configured
LDAP users with access to your GitLab server (only showing the first 100 results)
	User output sanitized. Found 100 users of 100 limit.

Checking LDAP ... Finished

Checking GitLab App ...

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: ... 
16/4 ... yes
18/7 ... yes
...
134/494 ... yes
87/495 ... yes
Redis version >= 2.8.0? ... yes
Ruby version >= 2.5.3 ? ... yes (2.6.3)
Git version >= 2.21.0 ? ... yes (2.21.0)
Git user has default SSH configuration? ... yes
Active users: ... 103
Elasticsearch version 5.6 - 6.x? ... yes (6.8.1)

Checking GitLab App ... Finished


Checking GitLab subtasks ... Finished

other words seems to be ok and indexing is running fine, thanks for your help, regards.

Edited Aug 27, 2019 by Florent Delrieu
Assignee Loading
Time tracking Loading