Trying to integrate elasticsearch into gitlab, create_empty_index fails

I am trying to use the elasticsearch tool for our gitlab repository. I follow this guide to integrate the gitlab data to the Elasticsearch index, however I already fail at the first step. Executing

gitlab-rake gitlab:elastic:create_empty_index --trace

results in this error:

** Invoke gitlab:elastic:create_empty_index (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute gitlab:elastic:create_empty_index
rake aborted!
Elasticsearch::Transport::Transport::Errors::BadRequest: [400] {"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"Failed to parse value [1] as only [true] or [false] are allowed."}],"type,"reason":"Failed to parse value [1] as only [true] or [false] are allowed."},"status":400}
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/elasticsearch-transport-5.0.3/lib/elasticsearch/transport/transport/base.rb:201:in `__raise_transport_error'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/elasticsearch-transport-5.0.3/lib/elasticsearch/transport/transport/base.rb:318:in `perform_request'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/elasticsearch-transport-5.0.3/lib/elasticsearch/transport/transport/http/faraday.rb:20:in `perform_request'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/elasticsearch-transport-5.0.3/lib/elasticsearch/transport/client.rb:131:in `perform_request'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/elasticsearch-api-5.0.3/lib/elasticsearch/api/namespace/common.rb:21:in `perform_request'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/elasticsearch-api-5.0.3/lib/elasticsearch/api/actions/indices/create.rb:86:in `create'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/elastic/helper.rb:29:in `create_empty_index'
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/elastic.rake:95:in `block (3 levels) in <top (required)>'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.1.0/lib/rake/task.rb:251:in `block in execute'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.1.0/lib/rake/task.rb:251:in `each'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.1.0/lib/rake/task.rb:251:in `execute'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.1.0/lib/rake/task.rb:195:in `block in invoke_with_call_chain'
/opt/gitlab/embedded/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.1.0/lib/rake/task.rb:188:in `invoke_with_call_chain'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.1.0/lib/rake/task.rb:181:in `invoke'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.1.0/lib/rake/application.rb:153:in `invoke_task'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.1.0/lib/rake/application.rb:109:in `block (2 levels) in top_level'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.1.0/lib/rake/application.rb:109:in `each'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.1.0/lib/rake/application.rb:109:in `block in top_level'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.1.0/lib/rake/application.rb:118:in `run_with_threads'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.1.0/lib/rake/application.rb:103:in `top_level'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.1.0/lib/rake/application.rb:81:in `block in run'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.1.0/lib/rake/application.rb:179:in `standard_exception_handling'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.1.0/lib/rake/application.rb:78:in `run'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.1.0/exe/rake:27:in `<top (required)>'
/opt/gitlab/embedded/bin/rake:23:in `load'
/opt/gitlab/embedded/bin/rake:23:in `<top (required)>'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/cli/exec.rb:74:in `load'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/cli/exec.rb:74:in `kernel_load'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/cli/exec.rb:27:in `run'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/cli.rb:332:in `exec'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/vendor/thor/lib/thor.rb:359:in `dispatch'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/cli.rb:20:in `dispatch'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/vendor/thor/lib/thor/base.rb:440:in `start'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/cli.rb:11:in `start'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/exe/bundle:34:in `block in <top (required)>'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/friendly_errors.rb:100:in `with_friendly_errors'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/exe/bundle:26:in `<top (required)>'
/opt/gitlab/embedded/bin/bundle:23:in `load'
/opt/gitlab/embedded/bin/bundle:23:in `<main>'
Tasks: TOP => gitlab:elastic:create_empty_index

How can I resolve this issue? Why can't 1 be parsed to true (or false)?

What version of Elasticsearch did you install? What version of Gitlab are you using?

In recent versions of Elasticsearch the parsing has been made more strict to prevent unexpected errors so the API requires script true and false values and rejects lenient boolean values like 0, 1, "on", "off".

It looks like your version of Gitlab is using an Elasticsearch 5.0.3 client so I suspect you are using a 6.x version of Elasticsearch and that is why you are getting the error. Note that on the guide you linked it says

Elasticsearch 6.0+ is not supported currently. We will support 6.0+ in the future.

Also note (from the same link) the Elasticsearch version requirements for different Gitlab versions:

|GitLab Enterprise Edition 8.4 - 8.17|Elasticsearch 2.4 with Delete By Query Plugin installed|
|GitLab Enterprise Edition 9.0+|Elasticsearch 5.1 - 5.5|

1 Like

Why is it that one always will miss the most vital information? Yes, version incompatibility will most likely be the root problem here (I installed Elasticsearch from the repository and it's the newest version, 6.1.1). I'll try it with a version <6 and will report back if I have been successful or not.

Thanks!

EDIT: I now installed Elasticsearch 5.5 and it installed correctly, thanks again!

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.