_timestamp removed from Elasticsearch 5

Summary

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}

Steps to reproduce

Install / connect GitLab 8.13.5-ee to Elasticsearch 5.0
Attempt to create indexes/recreate indexes by using the following command;

sudo gitlab-rake gitlab:elastic:recreate_index

or

sudo gitlab-rake gitlab:elastic:create_empty_index  

Expected behavior

A successful (re)creation of GitLab elasticsearch indexes

Actual behavior

# sudo gitlab-rake gitlab:elastic:recreate_index gitlab-production :force
I, [2016-11-15T06:54:16.859650 #22231]  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/gitlab/metrics/instrumentation.rb:157:in `create_empty_index'
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/elastic.rake:115:in `block (3 levels) in <top (required)>'
/opt/gitlab/embedded/bin/bundle:22:in `load'
/opt/gitlab/embedded/bin/bundle:22:in `<main>'

or

# sudo gitlab-rake gitlab:elastic:recreate_index
I, [2016-11-15T07:00:24.816463 #27618]  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/gitlab/metrics/instrumentation.rb:157:in `create_empty_index'
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/elastic.rake:115: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:recreate_index
(See full trace by running task with --trace)

Relevant logs and/or screenshots

(Paste any relevant logs - please use code blocks (```) to format console output, logs, and code as it's very hard to read otherwise.)

Output of checks

Results of GitLab application Check

sudo gitlab-rake gitlab:check SANITIZE=true
{....}
Elasticsearch version >= 2.0? ... no
Elasticsearch has plugin delete-by-query installed? ... rake aborted!
Elasticsearch::Transport::Transport::Errors::NotFound: [404] {"error":{"root_cause":[{"type":"index_not_found_exception","reason":"no such index","resource.type":"index_expression","resource.id":"","index_uuid":"_na_","index":""}],"type":"index_not_found_exception","reason":"no such index","resource.type":"index_expression","resource.id":"","index_uuid":"_na_","index":""},"status":404}
/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/cat/plugins.rb:29:in `plugins'
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/check.rake:1001:in `check_elasticsearch'
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/check.rake:33: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:check => gitlab:app:check
(See full trace by running task with --trace)

Results of GitLab environment info

sudo gitlab-rake gitlab:env:info

I, [2016-11-15T12:59:39.382232 #1688]  INFO -- sentry: ** [Raven] Raven 2.0.2 ready to catch errors

System information
System:		Ubuntu 14.04
Current User:	git
Using RVM:	no
Ruby Version:	2.3.1p112
Gem Version:	2.6.6
Bundler Version:1.13.6
Rake Version:	10.5.0
Sidekiq Version:4.2.1

GitLab information
Version:	8.13.5-ee
Revision:	94cc667
Directory:	/opt/gitlab/embedded/service/gitlab-rails
DB Adapter:	PostgreSQL
DB Version:	9.2.18
URL:		https://some.gitlabserver.com
HTTP Clone URL:	https://some.gitlabserver.com/some-group/some-project.git
SSH Clone URL:	git@some.gitlabserver.com:some-group/some-project.git
Elasticsearch:	yes
Geo:		no
Using LDAP:	no
Using Omniauth:	yes
Omniauth Providers: google_oauth2, github, gitlab, bitbucket, saml

GitLab Shell
Version:	3.6.6
Repository storage paths:
- default: 	/var/opt/gitlab/git-data/repositories
Hooks:		/opt/gitlab/embedded/service/gitlab-shell/hooks/
Git:		/opt/gitlab/embedded/bin/git

I know the documentation says Elasticsearch 2.x + but breaking changes in Elasticsearch 5 appear to be just that, breaking changes.

I am unable to run any of the elasticsearch rake tasks required to keep/maintain the recently upgraded Elasticsearch GitLab indexes now that they live in Elasticsearch 5.0

Assignee Loading
Time tracking Loading