# Trying to integrate elasticsearch into gitlab, create\_empty\_index fails

**URL:** <https://discuss.elastic.co/t/trying-to-integrate-elasticsearch-into-gitlab-create-empty-index-fails/114662>\
**Category:** Elasticsearch\
**Created:** [January 9, 2018, 8:39am UTC](https://discuss.elastic.co/t/trying-to-integrate-elasticsearch-into-gitlab-create-empty-index-fails/114662 "2018-01-09T08:39:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kamikater](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kamikater/32/26376_2.png) [@Kamikater](https://discuss.elastic.co/u/Kamikater)\
**Post date:** [January 9, 2018, 8:39am UTC](https://discuss.elastic.co/t/trying-to-integrate-elasticsearch-into-gitlab-create-empty-index-fails/114662/1 "2018-01-09T08:39:02Z")

</div>

I am trying to use the elasticsearch tool for our gitlab repository. I follow [this guide](https://docs.gitlab.com/ee/integration/elasticsearch.html#adding-gitlab-39-s-data-to-the-elasticsearch-index) 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`)?

---

<div class="post-metadata">

**Author:** ![colings86](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/colings86/32/44960_2.png) [@colings86](https://discuss.elastic.co/u/colings86)\
**Post date:** [January 9, 2018, 8:48am UTC](https://discuss.elastic.co/t/trying-to-integrate-elasticsearch-into-gitlab-create-empty-index-fails/114662/2 "2018-01-09T08:48:20Z")

</div>

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

```auto
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:

```auto
|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|

```

---

<div class="post-metadata">

**Author:** ![Kamikater](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kamikater/32/26376_2.png) [@Kamikater](https://discuss.elastic.co/u/Kamikater)\
**Post date:** [January 9, 2018, 11:20am UTC](https://discuss.elastic.co/t/trying-to-integrate-elasticsearch-into-gitlab-create-empty-index-fails/114662/3 "2018-01-09T11:20:08Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 6, 2018, 11:20am UTC](https://discuss.elastic.co/t/trying-to-integrate-elasticsearch-into-gitlab-create-empty-index-fails/114662/4 "2018-02-06T11:20:09Z")

</div>

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