I'm getting exceptions while searching using cirrussearch from Mediawiki

I've installed the Elasticsearch 1.3.1 in Mediawiki 1.23, Elastica
extension version 1.0.1.2 (e112720
https://git.wikimedia.org/commit/mediawiki%2Fextensions%2FElastica.git/e1127206d16c364a2ad7b6d16f2287e49ce4a7fa)
, Cirrus search 0.2 (aeccd2e)
https://git.wikimedia.org/commit/mediawiki%2Fextensions%2FCirrusSearch.git/aeccd2ec58985ac281ce46951222d5a984b3aeaf
.

Whenever I'm searching from the Mediawiki, I'm facing issues and results
are not returned.

I'm seeing an message like "An error has occurred while searching: We could
not complete your search due to a temporary problem. Please try again
later."

When I enable the debug on Mediawiki, I see
"WarningSearch backend error during full_text search for 'wiki' after 342.
Error message: 6 CirrusSearch\ElasticsearchIntermediary::failure"

I tried to dig in the code and see what exactly the error message 6 and the
reason for failure, I see the below exception

Elastica\Exception\PartialShardFailureException Object ( [_request:protected
] => Elastica\Request Object ( [_connection:protected] => Elastica
Connection Object ( [_params:protected] => Array ( [config] => Array ( ) [
host] => localhost [enabled] => 1 [timeout] => 40 ) [_rawParams:protected]
=> Array ( ) ) [_params:protected] => Array ( [path] => wikidb/page/_search
[method] => GET [data] => Array ( [_source] => Array ( [0] => id [1] =>
title [2] => namespace [3] => redirect.* [4] => timestamp [5] => text_bytes
) [fields] => text.word_count [query] => Array ( [filtered] => Array ( [
query] => Array ( [bool] => Array ( [minimum_number_should_match] => 1 [
should] => Array ( [0] => Array ( [query_string] => Array ( [query] => wiki
[fields] => Array ( [0] => title.plain^20 [1] => heading.plain^5 [2] => text
.plain^1 [3] => file_text.plain^0.8 [4] => redirect.title.plain^15 [5] =>
title^10 [6] => heading^2.5 [7] => text^0.5 [8] => file_text^0.4 [9] =>
redirect.title^7.5 ) [auto_generate_phrase_queries] => 1 [phrase_slop] => 1
[default_operator] => AND [allow_leading_wildcard] => [fuzzy_prefix_length]
=> 2 ) ) [1] => Array ( [query_string] => Array ( [query] => wiki [fields]
=> Array ( [0] => title.near_match^40 [1] => redirect.title.near_match^30 )
[auto_generate_phrase_queries] => 1 [phrase_slop] => 1 [default_operator] =>
AND [allow_leading_wildcard] => [fuzzy_prefix_length] => 2 ) ) ) ) ) [filter
] => Array ( [terms] => Array ( [namespace] => Array ( [0] => 0 [1] => 100 )
) ) ) ) ......
....

[_error:protected] =>
[_transferInfo:protected] => Array
(
[url] => http:
//localhost:9200/wikidb/page/_search?search_type=dfs_query_then_fetch&timeout=20s
[content_type] => application/json; charset=UTF-8
[http_code] => 200
[header_size] => 114
[request_size] => 210
[filetime] => -1
[ssl_verify_result] => 0
[redirect_count] => 0
[total_time] => 0.182986
[namelookup_time] => 0.000206
[connect_time] => 0.000746
[pretransfer_time] => 0.000748
[size_upload] => 1929
[size_download] => 42551
[speed_download] => 232536
[speed_upload] => 10541
[download_content_length] => 42551
[upload_content_length] => 1929
[starttransfer_time] => 0.001095
[redirect_time] => 0
[certinfo] => Array
(
)

[redirect_url] =>
)

[_response:protected] => Array
(
[took] => 174
[timed_out] =>
[_shards] => Array
(
[total] => 8
[successful] => 2
[failed] => 6
[failures] => Array
(
[0] => Array
(
[index] => wikidb_content_first
[shard] => 3
[status] => 400
[reason] => RemoteTransportException[[Masked Marauder][inet[/SOMEIP:9301]][
search/phase/dfs]]; nested: SearchParseException[[wikidb_content_first][3]:
query[filtered(((title.plain:wiki^20.0 | heading.plain:wiki^5.0 | text.plain
:wiki | file_text.plain:wiki^0.8 | redirect.title.plain:wiki^15.0 | title:
wiki^10.0 | heading:wiki^2.5 | text:wiki^0.5 | file_text:wiki^0.4 | redirect
.title:wiki^7.5) (title.near_match:wiki^40.0 | redirect.title.near_match:
wiki^30.0))~1)->cache(namespace: namespace: d)],from[-1],size[50]: Parse
Failure [Failed to parse source [{"_source":["id","title","namespace",
"redirect.*","timestamp","text_bytes"],"fields":"text.word_count","query":{
"filtered":{"query":{"bool":{"minimum_number_should_match":1,"should":[{
"query_string":{"query":"wiki","fields":["title.plain^20","heading.plain^5",
"text.plain^1","file_text.plain^0.8","redirect.title.plain^15","title^10",
"heading^2.5","text^0.5","file_text^0.4","redirect.title^7.5"],
"auto_generate_phrase_queries":true,"phrase_slop":1,"default_operator":"AND"
,"allow_leading_wildcard":false,"fuzzy_prefix_length":2}},{"query_string":{
"query":"wiki","fields":["title.near_match^40",
"redirect.title.near_match^30"],"auto_generate_phrase_queries":true,
"phrase_slop":1,"default_operator":"AND","allow_leading_wildcard":false,
"fuzzy_prefix_length":2}}]}},"filter":{"terms":{"namespace":[0,100]}}}},
"highlight":{"pre_tags":[""],"post_tags":[""],"fields":{"title":{
"number_of_fragments":0,"type":"fvh","order":"score","matched_fields":[
"title","title.plain"]},"text":{"number_of_fragments":1,"fragment_size":100,
"type":"fvh","order":"score","no_match_size":100,"matched_fields":["text",
"text.plain"]},"file_text":{"number_of_fragments":1,"fragment_size":100,
"type":"fvh","order":"score","matched_fields":["file_text","file_text.plain"
]},"redirect.title":{"number_of_fragments":1,"fragment_size":10000,"type":
"fvh","order":"score","matched_fields":["redirect.title",
"redirect.title.plain"]},"heading":{"number_of_fragments":1,"fragment_size":
10000,"type":"fvh","order":"score","matched_fields":["heading",
"heading.plain"]}}},"size":50,"rescore":[{"window_size":8192,"query":{
"rescore_query":{"function_score":{"functions":[{"script_score":{"script":"log10((doc['incoming_links'].isEmpty()
? 0 : doc['incoming_links'].value) + 2)"}},{"boost_factor":"0.2","filter":{
"terms":{"namespace":[100]}}}]}},"query_weight":1,"rescore_query_weight":1,
"score_mode":"multiply"}}],"stats":["full_text"]}]]]; nested:
QueryParsingException[[wikidb_content_first] script_score the script could
not be loaded]; nested: ScriptException[dynamic scripting for [mvel]
disabled];
)

[1] => Array
(
[index] => wikidb_content_first
[shard] => 1
[status] => 400
[reason] => SearchParseException[[wikidb_content_first][1]: query[filtered
(((title.plain:wiki^20.0 | heading.plain:wiki^5.0 | text.plain:wiki |
file_text.plain:wiki^0.8 | redirect.title.plain:wiki^15.0 | title:wiki^10.0
| heading:wiki^2.5 | text:wiki^0.5 | file_text:wiki^0.4 | redirect.title:
wiki^7.5) (title.near_match:wiki^40.0 | redirect.title.near_match:wiki^30.0
))~1)->cache(namespace: namespace: d)],from[-1],size[50]: Parse Failure [
Failed to parse source [{"_source":["id","title","namespace","redirect.*",
"timestamp","text_bytes"],"fields":"text.word_count","query":{"filtered":{
"query":{"bool":{"minimum_number_should_match":1,"should":[{"query_string":{
"query":"wiki","fields":["title.plain^20","heading.plain^5","text.plain^1",
"file_text.plain^0.8","redirect.title.plain^15","title^10","heading^2.5",
"text^0.5","file_text^0.4","redirect.title^7.5"],
"auto_generate_phrase_queries":true,"phrase_slop":1,"default_operator":"AND"
,"allow_leading_wildcard":false,"fuzzy_prefix_length":2}},{"query_string":{
"query":"wiki","fields":["title.near_match^40",
"redirect.title.near_match^30"],"auto_generate_phrase_queries":true,
"phrase_slop":1,"default_operator":"AND","allow_leading_wildcard":false,
"fuzzy_prefix_length":2}}]}},"filter":{"terms":{"namespace":[0,100]}}}},
"highlight":{"pre_tags":[""],"post_tags":[""],"fields":{"title":{
"number_of_fragments":0,"type":"fvh","order":"score","matched_fields":[
"title","title.plain"]},"text":{"number_of_fragments":1,"fragment_size":100,
"type":"fvh","order":"score","no_match_size":100,"matched_fields":["text",
"text.plain"]},"file_text":{"number_of_fragments":1,"fragment_size":100,
"type":"fvh","order":"score","matched_fields":["file_text","file_text.plain"
]},"redirect.title":{"number_of_fragments":1,"fragment_size":10000,"type":
"fvh","order":"score","matched_fields":["redirect.title",
"redirect.title.plain"]},"heading":{"number_of_fragments":1,"fragment_size":
10000,"type":"fvh","order":"score","matched_fields":["heading",
"heading.plain"]}}},"size":50,"rescore":[{"window_size":8192,"query":{
"rescore_query":{"function_score":{"functions":[{"script_score":{"script":"log10((doc['incoming_links'].isEmpty()
? 0 : doc['incoming_links'].value) + 2)"}},{"boost_factor":"0.2","filter":{
"terms":{"namespace":[100]}}}]}},"query_weight":1,"rescore_query_weight":1,
"score_mode":"multiply"}}],"stats":["full_text"]}]]]; nested:
QueryParsingException[[wikidb_content_first] script_score the script could
not be loaded]; nested: ScriptException[dynamic scripting for [mvel]
disabled];
)

...
....
etc

When I checked the health of the ES,it seems to be good

curl -XGET 'http://127.0.0.1:9200/_cluster/health?pretty=true' { "cluster_name" : "elasticsearch", "status" : "green", "timed_out" : false, "number_of_nodes" : 5, "number_of_data_nodes" : 5, "active_primary_shards" : 9, "active_shards" : 9, "relocating_shards" : 0, "initializing_shards" : 0, "unassigned_shards" : 0 }

When I do a search from console, I get results,

curl -XGET 'http://127.0.0.1:9200/wikidb/page/_search?q=wiki'
{"took":157,"timed_out":false,"_shards":{"total":8,"successful":8,"failed":0
},"hits":{"total":9699,"max_score":2.014001,"hits":[{"_index":
"wikidb_general_first","_type":"page","_id":"115792","_score":2.014001,
"_source":{"namespace":6,"namespace_text":"File","title":"I need help
ani.gif","timestamp":"2009-05-20T21:41:07Z","category":[],"external_link"
:[],"heading":[],"outgoing_link":[],"template":[],"text":"how to find help
in wiki","text_bytes":24}},..............

What could be the problem? Did I made any configuration issues? How to debug and fix it?

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/9fa1f72f-d195-490b-bb9c-c57eedc79d93%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

This looks like a configuration issue. The clue is in the following line:

"QueryParsingException[[wikidb_content_first] script_score the script could
not be loaded]; nested: ScriptException[dynamic scripting for[mvel] disabled
];"

According to

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/modules-scripting.html

scripting was disabled by default starting version 1.2.0.
Isabel

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAFSgB-BSB4HJSwgku_6Hco%3DdpzVxgpz77SVWerrEitSQdvY6SQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Hi,

I even tried to add script.disable_dynamic: false in the
config/elasticsearch.yml and also tried to remove that line.

There is no change in the exception on both cases. FYI, I restarted the
elasticsearch after the every change.

How can I confirm that the elasticsearch is running considering the
elasticsearch.yml ?? or will there be any other issues?

Thanks

On Tuesday, October 28, 2014 1:42:15 PM UTC+5:30, Isabel Drost-Fromm wrote:

This looks like a configuration issue. The clue is in the following line:

"QueryParsingException[[wikidb_content_first] script_score the script
could not be loaded]; nested: ScriptException[dynamic scripting for[mvel]
disabled];"

According to

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/modules-scripting.html

scripting was disabled by default starting version 1.2.0.
Isabel

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/215a857d-9b75-4c50-b999-2649cff1c5cb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

As the dynamic scripting is disabled, Even I tried to create a script under
/config/scripts and still I'm getting the same exception. I restarted the
elasticsearch as well,
As mentioned in,
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/modules-scripting.html#_automatic_script_reloading/
the scripts should be automatically loaded. But nothing seems to be working.

any ideas why things are not working?

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/7f8cc00f-7f14-4ce3-a9f1-ff5463e2dcec%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

I'll hop on irc and help from there. Depending on the version of cirrus you
use it requires groovy or MVEL support.
On Oct 28, 2014 4:12 AM, "Isabel Drost-Fromm" <
isabel.drostfromm@elasticsearch.com> wrote:

This looks like a configuration issue. The clue is in the following line:

"QueryParsingException[[wikidb_content_first] script_score the script
could not be loaded]; nested: ScriptException[dynamic scripting for[mvel]
disabled];"

According to

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/modules-scripting.html

scripting was disabled by default starting version 1.2.0.
Isabel

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAFSgB-BSB4HJSwgku_6Hco%3DdpzVxgpz77SVWerrEitSQdvY6SQ%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAFSgB-BSB4HJSwgku_6Hco%3DdpzVxgpz77SVWerrEitSQdvY6SQ%40mail.gmail.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAPmjWd2Y%2B78p6cMcyPGK8OTnJ_U4K7HKW4KmEd5-Hq1-_yi4JQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

I'm already on the irc at http://webchat.freenode.net/ in the channel
#elasticsearh

On Tuesday, October 28, 2014 5:48:44 PM UTC+5:30, Nikolas Everett wrote:

I'll hop on irc and help from there. Depending on the version of cirrus
you use it requires groovy or MVEL support.
On Oct 28, 2014 4:12 AM, "Isabel Drost-Fromm" <
isabel.d...@elasticsearch.com <javascript:>> wrote:

This looks like a configuration issue. The clue is in the following line:

"QueryParsingException[[wikidb_content_first] script_score the script
could not be loaded]; nested: ScriptException[dynamic scripting for[mvel]
disabled];"

According to

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/modules-scripting.html

scripting was disabled by default starting version 1.2.0.
Isabel

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearc...@googlegroups.com <javascript:>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAFSgB-BSB4HJSwgku_6Hco%3DdpzVxgpz77SVWerrEitSQdvY6SQ%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAFSgB-BSB4HJSwgku_6Hco%3DdpzVxgpz77SVWerrEitSQdvY6SQ%40mail.gmail.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/a3fc6248-87cc-4b84-b28f-edcb813a674a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

You aren't on IRC so I'll just explain here. There isn't a mailing list
for Cirrus or I'd have us take it there. The elasticsearch mailing list is
just as good as the Mediawiki mailing list.

Cirrus doesn't use stored scripts on the server because we at WMF update
Cirrus constantly and we don't want to have to think about whether or not a
release needs a script change. And we do rolling releases so we'd have to
keep two copies of the script there all the time. Just not worth it.

The other problem is that Cirrus releases are tagged on MediaWiki's twice
yearly release schedule for external use. Thats honestly not frequent
enough given how quickly the project is moving and how quickly
Elasticsearch is moving. WMF releases weekly and that works well but we
can't expect other users to do that. Its just too much work.

Long story short - the fastest way for you to resolve this is to reenable
dynamic scripting setting

script.disable_dynamic: false

in elasticsearch.yml and restart Elasticsearch.

Another solution would be for me to backport the latest release of cirrus
to mediawiki 1.23. That'd take some time but wouldn't require
non-sandboxed dynamic scripting.

On Tue, Oct 28, 2014 at 8:18 AM, Nikolas Everett nik9000@gmail.com wrote:

I'll hop on irc and help from there. Depending on the version of cirrus
you use it requires groovy or MVEL support.
On Oct 28, 2014 4:12 AM, "Isabel Drost-Fromm" <
isabel.drostfromm@elasticsearch.com> wrote:

This looks like a configuration issue. The clue is in the following line:

"QueryParsingException[[wikidb_content_first] script_score the script
could not be loaded]; nested: ScriptException[dynamic scripting for[mvel]
disabled];"

According to

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/modules-scripting.html

scripting was disabled by default starting version 1.2.0.
Isabel

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAFSgB-BSB4HJSwgku_6Hco%3DdpzVxgpz77SVWerrEitSQdvY6SQ%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAFSgB-BSB4HJSwgku_6Hco%3DdpzVxgpz77SVWerrEitSQdvY6SQ%40mail.gmail.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAPmjWd2n8S4dPvscAVCYUJEM6_fSRdWOprhRcJCehOsDBzvznA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.