Elastic indexing task does not handle errors properly
Reproduced on EE master. I don't have any index in ES server. I run rake gitlab:elastic:index
.
I see this
$ be rake gitlab:elastic:index
Index created
Index status has been reset
Indexing project repositories...I, [2017-05-10T19:19:24.461874 #95161] INFO -- : Indexing Gitlab Org / Gitlab Test (ID=1)...
I, [2017-05-10T19:19:28.184211 #95161] INFO -- : Indexing Gitlab Org / Gitlab Test (ID=1) is done!
I, [2017-05-10T19:19:28.185730 #95161] INFO -- : Indexing Gitlab Org / Gitlab Ce (ID=2)...
I, [2017-05-10T19:20:01.113759 #95161] INFO -- : Indexing Gitlab Org / Gitlab Ce (ID=2) is done!
I, [2017-05-10T19:20:01.115423 #95161] INFO -- : Indexing Gitlab Org / Gitlab Ci (ID=3)...
I, [2017-05-10T19:20:06.334836 #95161] INFO -- : Indexing Gitlab Org / Gitlab Ci (ID=3) is done!
I, [2017-05-10T19:20:06.335931 #95161] INFO -- : Indexing Gitlab Org / Gitlab Shell (ID=4)...
I, [2017-05-10T19:20:10.322744 #95161] INFO -- : Indexing Gitlab Org / Gitlab Shell (ID=4) is done!
I, [2017-05-10T19:20:10.323933 #95161] INFO -- : Indexing Documentcloud / Underscore (ID=5)...
I, [2017-05-10T19:20:14.978830 #95161] INFO -- : Indexing Documentcloud / Underscore (ID=5) is done!
I, [2017-05-10T19:20:14.980447 #95161] INFO -- : Indexing Twitter / Flight (ID=6)...
I, [2017-05-10T19:20:18.709942 #95161] INFO -- : Indexing Twitter / Flight (ID=6) is done!
I, [2017-05-10T19:20:18.710907 #95161] INFO -- : Indexing Twitter / Typeahead.Js (ID=7)...
I, [2017-05-10T19:20:22.657519 #95161] INFO -- : Indexing Twitter / Typeahead.Js (ID=7) is done!
I, [2017-05-10T19:20:22.658468 #95161] INFO -- : Indexing H5bp / Html5 Boilerplate (ID=8)...
I, [2017-05-10T19:20:26.971866 #95161] INFO -- : Indexing H5bp / Html5 Boilerplate (ID=8) is done!
I, [2017-05-10T19:20:27.058812 #95161] INFO -- : Indexing Projects...
I, [2017-05-10T19:20:27.059252 #95161] INFO -- : Indexing Issues...
I, [2017-05-10T19:20:27.060184 #95161] INFO -- : Indexing MergeRequests...
I, [2017-05-10T19:20:27.060557 #95161] INFO -- : Indexing Snippets...
I, [2017-05-10T19:20:27.060960 #95161] INFO -- : Indexing Notes...
I, [2017-05-10T19:20:27.061711 #95161] INFO -- : Indexing Milestones...
I, [2017-05-10T19:20:27.508879 #95161] INFO -- : Indexing Projects... done
I, [2017-05-10T19:20:27.556806 #95161] INFO -- : Indexing MergeRequests... done
I, [2017-05-10T19:20:27.692020 #95161] INFO -- : Indexing Snippets... done
I, [2017-05-10T19:20:28.277658 #95161] INFO -- : Indexing Issues... done
I, [2017-05-10T19:20:30.533979 #95161] INFO -- : Indexing Notes... done
rake aborted!
ArgumentError: gitlab-development does not exist to be imported into. Use create_index! or the :force option to create it.
/Users/valery/.rvm/gems/ruby-2.3.3/gems/elasticsearch-model-0.1.9/lib/elasticsearch/model/importing.rb:118:in `import'
/Users/valery/.rvm/gems/ruby-2.3.3/gems/elasticsearch-model-0.1.9/lib/elasticsearch/model.rb:116:in `import'
/Users/valery/gdk-ee/gitlab/app/models/concerns/elastic/application_search.rb:111:in `import_with_parent'
/Users/valery/gdk-ee/gitlab/lib/tasks/gitlab/elastic.rake:83:in `block (4 levels) in <top (required)>'
Tasks: TOP => gitlab:elastic:index_database => gitlab:elastic:index_milestones
(See full trace by running task with --trace)
~/gdk-ee/gitlab
cc @nick.thomas
@smcgivern I think we should fix that before relase