Can't use Elasticsearch as GitLab tries to use '_timestamp' which has been deprecated in ES
Summary
When trying to enable and setup Elasticsearch integration with GitLab an error occurs due to GitLab trying to use a deprecated function in Elasticsearch.
Steps to reproduce
Follow the documentation here: https://docs.gitlab.com/ee/integration/elasticsearch.html
Expected behaviour
Unsure as I haven't been able to get it working, however I'm guessing I'd see some sort of completion message and be able to proceed to indexing into ES.
Actual behaviour
root@int-gitlab-01:~ # sudo gitlab-rake gitlab:elastic:create_empty_index
I, [2017-01-09T14:21:48.366440 #26760] INFO -- sentry: ** [Raven] Raven 2.0.2 ready to catch errors
rake aborted!
Elasticsearch::Transport::Transport::Errors::BadRequest: [400] {"error":{"root_cause":[{"type":"mapper_parsing_exception","reason":"Failed to parse mapping [project_wiki]: [_timestamp] is removed in 5.0. As a replacement, you can use an ingest pipeline to add a field with the current timestamp to your documents."}],"type":"mapper_parsing_exception","reason":"Failed to parse mapping [project_wiki]: [_timestamp] is removed in 5.0. As a replacement, you can use an ingest pipeline to add a field with the current timestamp to your documents.","caused_by":{"type":"illegal_argument_exception","reason":"[_timestamp] is removed in 5.0. As a replacement, you can use an ingest pipeline to add a field with the current timestamp to your documents."}},"status":400}
/opt/gitlab/embedded/service/gem/ruby/2.3.0/gems/elasticsearch-transport-1.0.15/lib/elasticsearch/transport/transport/base.rb:146:in `__raise_transport_error'
/opt/gitlab/embedded/service/gem/ruby/2.3.0/gems/elasticsearch-transport-1.0.15/lib/elasticsearch/transport/transport/base.rb:256:in `perform_request'
/opt/gitlab/embedded/service/gem/ruby/2.3.0/gems/elasticsearch-transport-1.0.15/lib/elasticsearch/transport/transport/http/faraday.rb:20:in `perform_request'
/opt/gitlab/embedded/service/gem/ruby/2.3.0/gems/elasticsearch-transport-1.0.15/lib/elasticsearch/transport/client.rb:125:in `perform_request'
/opt/gitlab/embedded/service/gem/ruby/2.3.0/gems/elasticsearch-api-1.0.15/lib/elasticsearch/api/namespace/common.rb:21:in `perform_request'
/opt/gitlab/embedded/service/gem/ruby/2.3.0/gems/elasticsearch-api-1.0.15/lib/elasticsearch/api/actions/indices/create.rb:77: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:97:in `block (3 levels) in <top (required)>'
/opt/gitlab/embedded/bin/bundle:22:in `load'
/opt/gitlab/embedded/bin/bundle:22:in `<main>'
Tasks: TOP => gitlab:elastic:create_empty_index
(See full trace by running task with --trace)
Results of GitLab environment info
- GitLab 8.15.3-ee (Omnibus).
- Elasticsearch Stable (5.1.1) 3 node, 5 shard, 2 replica cluster.
- GitLab configured with the nodes as such
int-elastic-01.fqdn, int-elastic-02.fqdn, int-elastic-03.fqdn.
Possible fixes
Update the library or code that GitLab uses to drop or replace the use of _timestamp which isn't supported by Elasticsearch.