Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Elasticsearch 7.0 #10664

Closed
angristan opened this issue May 1, 2019 · 5 comments · Fixed by #13828
Closed

Support Elasticsearch 7.0 #10664

angristan opened this issue May 1, 2019 · 5 comments · Fixed by #13828
Labels
suggestion Feature suggestion

Comments

@angristan
Copy link
Contributor

Elasticsearch 7 was released about a month ago: https://www.elastic.co/blog/elasticsearch-7-0-0-released.

Currently the elasticsearch gems are pinned at 6.0.2, so Mastodon is not compatible with ES 7.

The gems have been updated for 7.0.0 support: https://github.com/elastic/elasticsearch-ruby/releases

@angristan
Copy link
Contributor Author

I guess more work is needed, since mapping types have been removed.

mastodon~/live> env RAILS_ENV=production ./bin/tootctl search deploy
Resetting StatusesIndex
Traceback (most recent call last):
	28: from ./bin/tootctl:5:in `<main>'
	27: from /home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/thor-0.20.3/lib/thor/base.rb:466:in `start'
	26: from /home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
	25: from /home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
	24: from /home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
	23: from /home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/thor-0.20.3/lib/thor.rb:238:in `block in subcommand'
	22: from /home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/thor-0.20.3/lib/thor/invocation.rb:115:in `invoke'
	21: from /home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
	20: from /home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
	19: from /home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
	18: from /home/mastodon/live/lib/mastodon/search_cli.rb:18:in `deploy'
	17: from /home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/chewy-5.0.0/lib/chewy/rake_helper.rb:63:in `upgrade'
	16: from /home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/chewy-5.0.0/lib/chewy/rake_helper.rb:218:in `subscribed_task_stats'
	15: from /home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/notifications.rb:180:in `subscribed'
	14: from /home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/chewy-5.0.0/lib/chewy/rake_helper.rb:219:in `block in subscribed_task_stats'
	13: from /home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/notifications.rb:180:in `subscribed'
	12: from /home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/chewy-5.0.0/lib/chewy/rake_helper.rb:220:in `block (2 levels) in subscribed_task_stats'
	11: from /home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/chewy-5.0.0/lib/chewy/rake_helper.rb:71:in `block in upgrade'
	10: from /home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/chewy-5.0.0/lib/chewy/rake_helper.rb:71:in `each'
	 9: from /home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/chewy-5.0.0/lib/chewy/rake_helper.rb:73:in `block (2 levels) in upgrade'
	 8: from /home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/chewy-5.0.0/lib/chewy/rake_helper.rb:299:in `reset_one'
	 7: from /home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/chewy-5.0.0/lib/chewy/index/actions.rb:176:in `reset!'
	 6: from /home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/chewy-5.0.0/lib/chewy/index/actions.rb:62:in `create!'
	 5: from /home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/elasticsearch-api-7.0.0/lib/elasticsearch/api/actions/indices/create.rb:95:in `create'
	 4: from /home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/elasticsearch-api-7.0.0/lib/elasticsearch/api/namespace/common.rb:38:in `perform_request'
	 3: from /home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/elasticsearch-transport-7.0.0/lib/elasticsearch/transport/client.rb:160:in `perform_request'
	 2: from /home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/elasticsearch-transport-7.0.0/lib/elasticsearch/transport/transport/http/faraday.rb:37:in `perform_request'
	 1: from /home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/elasticsearch-transport-7.0.0/lib/elasticsearch/transport/transport/base.rb:338:in `perform_request'
/home/mastodon/live/vendor/bundle/ruby/2.6.0/gems/elasticsearch-transport-7.0.0/lib/elasticsearch/transport/transport/base.rb:218:in `__raise_transport_error': [400] {"error":{"root_cause":[{"type":"mapper_parsing_exception","reason":"Root mapping definition has unsupported parameters:  [status : {date_detection=false, properties={account_id={type=long}, id={type=long}, text={type=text, fields={stemmed={analyzer=content, type=text}}}, searchable_by={type=long}}}]"}],"type":"mapper_parsing_exception","reason":"Failed to parse mapping [_doc]: Root mapping definition has unsupported parameters:  [status : {date_detection=false, properties={account_id={type=long}, id={type=long}, text={type=text, fields={stemmed={analyzer=content, type=text}}}, searchable_by={type=long}}}]","caused_by":{"type":"mapper_parsing_exception","reason":"Root mapping definition has unsupported parameters:  [status : {date_detection=false, properties={account_id={type=long}, id={type=long}, text={type=text, fields={stemmed={analyzer=content, type=text}}}, searchable_by={type=long}}}]"}},"status":400} (Elasticsearch::Transport::Transport::Errors::BadRequest)

@noellabo
Copy link
Contributor

noellabo commented May 5, 2019

I replied to chewy's issue dealing with the same issue.
toptal/chewy#673 (comment)

To solve this problem, we need to send a pull request to chewy to enable the compatibility option. Here is an example of a fix.
noellabo/chewy@94e8a6c

Correctly, we need to rewrite chewy without using the deprecated Type.

And there is another easy solution. In nginx, rewrite compatibility options to url parameters.
https://gist.github.com/Vincanote/2b18ba8aa33d068a9cc012b9a4d891af by @Vincanote

@Dee-2015
Copy link

Thank you for the update.

The include_type_name parameter will be removed in 8.X.

Any idea how much work it would be to rewrite chewy without the Type?

@dimlau
Copy link

dimlau commented Sep 25, 2019

Mastodon v3.0.0 rc1
The nginx side solution doesn't work any more!

@subelsky
Copy link

FYI there is a chewy PR that should fix this: toptal/chewy#673

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
suggestion Feature suggestion
Projects
None yet
6 participants