IllegalAccessError when using an MVEL script filter in the query

Hi,

We have a 2-node ES cluster running 0.90.0 release in our QA environment.
When we started using a script filter in our query, we got the following
stack trace after a few queries to ES. After looking into the issue a bit,
the issue seemed to be caused by the use of MVEL in compiled or accelerated
mode. Further research seems to indicate that disabling JIT for MVEL
worked around the problem (via -Dmvel2.disable.jit=true).

Disabling MVEL JIT would also mean a performance concern for us. What's
root cause of this issue? How should we address it?

[2013-05-23 21:04:55,650][DEBUG][action.search.type ] [Omen]
[indexedbuyitem][0], node[-3mMO7JjTKKhIk92AJt_xQ], [R], s[STARTED]: Failed
to execute [org.elasticsearch.action.search.SearchRequest@1d5e469d]

java.lang.IllegalAccessError:
org/elasticsearch/index/fielddata/ScriptDocValues$Strings$1

    at ASMAccessorImpl_1471145441369339522430.getValue(Unknown Source)

    at 

org.elasticsearch.common.mvel2.optimizers.dynamic.DynamicGetAccessor.getValue(DynamicGetAccessor.java:73)

    at 

org.elasticsearch.common.mvel2.ast.ASTNode.getReducedValueAccelerated(ASTNode.java:108)

    at 

org.elasticsearch.common.mvel2.ast.BinaryOperation.getReducedValueAccelerated(BinaryOperation.java:108)

    at 

org.elasticsearch.common.mvel2.ast.Or.getReducedValueAccelerated(Or.java:34)

    at 

org.elasticsearch.common.mvel2.ast.Or.getReducedValueAccelerated(Or.java:34)

    at 

org.elasticsearch.common.mvel2.MVELRuntime.execute(MVELRuntime.java:85)

    at 

org.elasticsearch.common.mvel2.compiler.CompiledExpression.getDirectValue(CompiledExpression.java:123)

    at 

org.elasticsearch.common.mvel2.compiler.CompiledExpression.getValue(CompiledExpression.java:119)

    at 

org.elasticsearch.script.mvel.MvelScriptEngineService$MvelSearchScript.run(MvelScriptEngineService.java:192)

    at 

org.elasticsearch.index.query.ScriptFilterParser$ScriptFilter$ScriptDocSet.matchDoc(ScriptFilterParser.java:184)

    at 

org.elasticsearch.common.lucene.docset.MatchDocIdSet.get(MatchDocIdSet.java:67)

    at 

org.apache.lucene.search.FilteredDocIdSet$1.get(FilteredDocIdSet.java:65)

    at 

org.elasticsearch.common.lucene.docset.AndDocIdSet$AndBits.get(AndDocIdSet.java:106)

    at 

org.elasticsearch.common.lucene.docset.AndDocIdSet$AndBits.get(AndDocIdSet.java:106)

    at 

org.elasticsearch.common.lucene.docset.BitsDocIdSetIterator$FilteredIterator.match(BitsDocIdSetIterator.java:59)

    at 

org.apache.lucene.search.FilteredDocIdSetIterator.nextDoc(FilteredDocIdSetIterator.java:60)

    at 

org.apache.lucene.search.FilteredDocIdSetIterator.nextDoc(FilteredDocIdSetIterator.java:59)

    at 

org.apache.lucene.search.ConstantScoreQuery$ConstantScorer.nextDoc(ConstantScoreQuery.java:185)

    at 

org.elasticsearch.common.lucene.search.function.FiltersFunctionScoreQuery$CustomBoostFactorScorer.nextDoc(FiltersFunctionScoreQuery.java:283)

    at org.apache.lucene.search.Scorer.score(Scorer.java:63)

    at 

org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:605)

    at 

org.elasticsearch.search.internal.ContextIndexSearcher.search(ContextIndexSearcher.java:156)

    at 

org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:572)

    at 

org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:524)

    at 

org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:501)

    at 

org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:345)

    at 

org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:127)

    at 

org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:239)

    at 

org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteQuery(SearchServiceTransportAction.java:141)

    at 

org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction.sendExecuteFirstPhase(TransportSearchQueryThenFetchAction.java:80)

    at 

org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:205)

    at 

org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.onFirstPhaseResult(TransportSearchTypeAction.java:281)

    at 

org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction$3.onFailure(TransportSearchTypeAction.java:213)

    at 

org.elasticsearch.search.action.SearchServiceTransportAction$2.handleException(SearchServiceTransportAction.j

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

Also, if we want to use a script filter, which scripting language would you
recommended?

Thanks,
Connie

On Friday, May 24, 2013 6:58:24 PM UTC-7, Connie Yang wrote:

Hi,

We have a 2-node ES cluster running 0.90.0 release in our QA environment.
When we started using a script filter in our query, we got the following
stack trace after a few queries to ES. After looking into the issue a bit,
the issue seemed to be caused by the use of MVEL in compiled or accelerated
mode. Further research seems to indicate that disabling JIT for MVEL
worked around the problem (via -Dmvel2.disable.jit=true).

Disabling MVEL JIT would also mean a performance concern for us. What's
root cause of this issue? How should we address it?

[2013-05-23 21:04:55,650][DEBUG][action.search.type ] [Omen]
[indexedbuyitem][0], node[-3mMO7JjTKKhIk92AJt_xQ], [R], s[STARTED]: Failed
to execute [org.elasticsearch.action.search.SearchRequest@1d5e469d]

java.lang.IllegalAccessError:
org/elasticsearch/index/fielddata/ScriptDocValues$Strings$1

    at ASMAccessorImpl_1471145441369339522430.getValue(Unknown Source)

    at 

org.elasticsearch.common.mvel2.optimizers.dynamic.DynamicGetAccessor.getValue(DynamicGetAccessor.java:73)

    at 

org.elasticsearch.common.mvel2.ast.ASTNode.getReducedValueAccelerated(ASTNode.java:108)

    at 

org.elasticsearch.common.mvel2.ast.BinaryOperation.getReducedValueAccelerated(BinaryOperation.java:108)

    at 

org.elasticsearch.common.mvel2.ast.Or.getReducedValueAccelerated(Or.java:34)

    at 

org.elasticsearch.common.mvel2.ast.Or.getReducedValueAccelerated(Or.java:34)

    at 

org.elasticsearch.common.mvel2.MVELRuntime.execute(MVELRuntime.java:85)

    at 

org.elasticsearch.common.mvel2.compiler.CompiledExpression.getDirectValue(CompiledExpression.java:123)

    at 

org.elasticsearch.common.mvel2.compiler.CompiledExpression.getValue(CompiledExpression.java:119)

    at 

org.elasticsearch.script.mvel.MvelScriptEngineService$MvelSearchScript.run(MvelScriptEngineService.java:192)

    at 

org.elasticsearch.index.query.ScriptFilterParser$ScriptFilter$ScriptDocSet.matchDoc(ScriptFilterParser.java:184)

    at 

org.elasticsearch.common.lucene.docset.MatchDocIdSet.get(MatchDocIdSet.java:67)

    at 

org.apache.lucene.search.FilteredDocIdSet$1.get(FilteredDocIdSet.java:65)

    at 

org.elasticsearch.common.lucene.docset.AndDocIdSet$AndBits.get(AndDocIdSet.java:106)

    at 

org.elasticsearch.common.lucene.docset.AndDocIdSet$AndBits.get(AndDocIdSet.java:106)

    at 

org.elasticsearch.common.lucene.docset.BitsDocIdSetIterator$FilteredIterator.match(BitsDocIdSetIterator.java:59)

    at 

org.apache.lucene.search.FilteredDocIdSetIterator.nextDoc(FilteredDocIdSetIterator.java:60)

    at 

org.apache.lucene.search.FilteredDocIdSetIterator.nextDoc(FilteredDocIdSetIterator.java:59)

    at 

org.apache.lucene.search.ConstantScoreQuery$ConstantScorer.nextDoc(ConstantScoreQuery.java:185)

    at 

org.elasticsearch.common.lucene.search.function.FiltersFunctionScoreQuery$CustomBoostFactorScorer.nextDoc(FiltersFunctionScoreQuery.java:283)

    at org.apache.lucene.search.Scorer.score(Scorer.java:63)

    at 

org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:605)

    at 

org.elasticsearch.search.internal.ContextIndexSearcher.search(ContextIndexSearcher.java:156)

    at 

org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:572)

    at 

org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:524)

    at 

org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:501)

    at 

org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:345)

    at 

org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:127)

    at 

org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:239)

    at 

org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteQuery(SearchServiceTransportAction.java:141)

    at 

org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction.sendExecuteFirstPhase(TransportSearchQueryThenFetchAction.java:80)

    at 

org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:205)

    at 

org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.onFirstPhaseResult(TransportSearchTypeAction.java:281)

    at 

org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction$3.onFailure(TransportSearchTypeAction.java:213)

    at 

org.elasticsearch.search.action.SearchServiceTransportAction$2.handleException(SearchServiceTransportAction.j

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

that's not good. Can you provide more info about your system like JVM
version and vendor etc. and maybe the script you try to run?
this seems to be worth an issue too, can you open one?
simon

On Saturday, May 25, 2013 4:05:49 AM UTC+2, Connie Yang wrote:

Also, if we want to use a script filter, which scripting language would
you recommended?

Thanks,
Connie

On Friday, May 24, 2013 6:58:24 PM UTC-7, Connie Yang wrote:

Hi,

We have a 2-node ES cluster running 0.90.0 release in our QA environment.
When we started using a script filter in our query, we got the following
stack trace after a few queries to ES. After looking into the issue a bit,
the issue seemed to be caused by the use of MVEL in compiled or accelerated
mode. Further research seems to indicate that disabling JIT for MVEL
worked around the problem (via -Dmvel2.disable.jit=true).

Disabling MVEL JIT would also mean a performance concern for us. What's
root cause of this issue? How should we address it?

[2013-05-23 21:04:55,650][DEBUG][action.search.type ] [Omen]
[indexedbuyitem][0], node[-3mMO7JjTKKhIk92AJt_xQ], [R], s[STARTED]: Failed
to execute [org.elasticsearch.action.search.SearchRequest@1d5e469d]

java.lang.IllegalAccessError:
org/elasticsearch/index/fielddata/ScriptDocValues$Strings$1

    at ASMAccessorImpl_1471145441369339522430.getValue(Unknown Source)

    at 

org.elasticsearch.common.mvel2.optimizers.dynamic.DynamicGetAccessor.getValue(DynamicGetAccessor.java:73)

    at 

org.elasticsearch.common.mvel2.ast.ASTNode.getReducedValueAccelerated(ASTNode.java:108)

    at 

org.elasticsearch.common.mvel2.ast.BinaryOperation.getReducedValueAccelerated(BinaryOperation.java:108)

    at 

org.elasticsearch.common.mvel2.ast.Or.getReducedValueAccelerated(Or.java:34)

    at 

org.elasticsearch.common.mvel2.ast.Or.getReducedValueAccelerated(Or.java:34)

    at 

org.elasticsearch.common.mvel2.MVELRuntime.execute(MVELRuntime.java:85)

    at 

org.elasticsearch.common.mvel2.compiler.CompiledExpression.getDirectValue(CompiledExpression.java:123)

    at 

org.elasticsearch.common.mvel2.compiler.CompiledExpression.getValue(CompiledExpression.java:119)

    at 

org.elasticsearch.script.mvel.MvelScriptEngineService$MvelSearchScript.run(MvelScriptEngineService.java:192)

    at 

org.elasticsearch.index.query.ScriptFilterParser$ScriptFilter$ScriptDocSet.matchDoc(ScriptFilterParser.java:184)

    at 

org.elasticsearch.common.lucene.docset.MatchDocIdSet.get(MatchDocIdSet.java:67)

    at 

org.apache.lucene.search.FilteredDocIdSet$1.get(FilteredDocIdSet.java:65)

    at 

org.elasticsearch.common.lucene.docset.AndDocIdSet$AndBits.get(AndDocIdSet.java:106)

    at 

org.elasticsearch.common.lucene.docset.AndDocIdSet$AndBits.get(AndDocIdSet.java:106)

    at 

org.elasticsearch.common.lucene.docset.BitsDocIdSetIterator$FilteredIterator.match(BitsDocIdSetIterator.java:59)

    at 

org.apache.lucene.search.FilteredDocIdSetIterator.nextDoc(FilteredDocIdSetIterator.java:60)

    at 

org.apache.lucene.search.FilteredDocIdSetIterator.nextDoc(FilteredDocIdSetIterator.java:59)

    at 

org.apache.lucene.search.ConstantScoreQuery$ConstantScorer.nextDoc(ConstantScoreQuery.java:185)

    at 

org.elasticsearch.common.lucene.search.function.FiltersFunctionScoreQuery$CustomBoostFactorScorer.nextDoc(FiltersFunctionScoreQuery.java:283)

    at org.apache.lucene.search.Scorer.score(Scorer.java:63)

    at 

org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:605)

    at 

org.elasticsearch.search.internal.ContextIndexSearcher.search(ContextIndexSearcher.java:156)

    at 

org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:572)

    at 

org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:524)

    at 

org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:501)

    at 

org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:345)

    at 

org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:127)

    at 

org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:239)

    at 

org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteQuery(SearchServiceTransportAction.java:141)

    at 

org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction.sendExecuteFirstPhase(TransportSearchQueryThenFetchAction.java:80)

    at 

org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:205)

    at 

org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.onFirstPhaseResult(TransportSearchTypeAction.java:281)

    at 

org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction$3.onFailure(TransportSearchTypeAction.java:213)

    at 

org.elasticsearch.search.action.SearchServiceTransportAction$2.handleException(SearchServiceTransportAction.j

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

I will submit a JIRA for this, but here's additional information on our QA
environment.

I've also attached the elasticsearch.conf that I used in that environment.

*OS
*
Ubuntu 12.10 (GNU/Linux 3.5.0-17-generic x86_64)

Java version, vendor
java version "1.7.0_21"
OpenJDK Runtime Environment (IcedTea 2.3.9) (7u21-2.3.9-0ubuntu0.12.10.1)
OpenJDK 64-Bit Server VM (build 23.7-b01, mixed mode)

Script

if(doc['targeting.keys'] == null || doc['targeting.keys'].values.length == 0)"+
"return true;" +
"foreach (kv : doc['targeting.keys'].values) {" +
"var found = 0;" +
"foreach (qkey : qkeys){" +
"if (kv == qkey) {" +
"found = 1;" +
"}" +
"}" +
"if(found == 0){" +
"return false;" +
"}" +
"}" +
"return true;

On Fri, May 24, 2013 at 11:29 PM, simonw-2 [via Elasticsearch Users] <
ml-node+s115913n4035498h21@n3.nabble.com> wrote:

that's not good. Can you provide more info about your system like JVM
version and vendor etc. and maybe the script you try to run?
this seems to be worth an issue too, can you open one?
simon

On Saturday, May 25, 2013 4:05:49 AM UTC+2, Connie Yang wrote:

Also, if we want to use a script filter, which scripting language would
you recommended?

Thanks,
Connie

On Friday, May 24, 2013 6:58:24 PM UTC-7, Connie Yang wrote:

Hi,

We have a 2-node ES cluster running 0.90.0 release in our QA
environment. When we started using a script filter in our query, we got
the following stack trace after a few queries to ES. After looking into
the issue a bit, the issue seemed to be caused by the use of MVEL in
compiled or accelerated mode. Further research seems to indicate that
disabling JIT for MVEL worked around the problem (via
-Dmvel2.disable.jit=true).

Disabling MVEL JIT would also mean a performance concern for us. What's
root cause of this issue? How should we address it?

[2013-05-23 21:04:55,650][DEBUG][action.**search.type ] [Omen]
[indexedbuyitem][0], node[-3mMO7JjTKKhIk92AJt_xQ], [R], s[STARTED]: Failed
to execute [org.elasticsearch.action.**search.SearchRequest@1d5e469d]

java.lang.IllegalAccessError: org/elasticsearch/index/**
fielddata/ScriptDocValues$**Strings$1

    at ASMAccessorImpl_**1471145441369339522430.**getValue(Unknown

Source)

    at org.elasticsearch.common.**mvel2.optimizers.dynamic.**

DynamicGetAccessor.getValue(**DynamicGetAccessor.java:73)

    at org.elasticsearch.common.**mvel2.ast.ASTNode.**

getReducedValueAccelerated(**ASTNode.java:108)

    at org.elasticsearch.common.**mvel2.ast.BinaryOperation.**

getReducedValueAccelerated(**BinaryOperation.java:108)

    at org.elasticsearch.common.**mvel2.ast.Or.**

getReducedValueAccelerated(Or.**java:34)

    at org.elasticsearch.common.**mvel2.ast.Or.**

getReducedValueAccelerated(Or.**java:34)

    at org.elasticsearch.common.**mvel2.MVELRuntime.execute(**

MVELRuntime.java:85)

    at org.elasticsearch.common.**mvel2.compiler.**

CompiledExpression.**getDirectValue(**CompiledExpression.java:123)

    at org.elasticsearch.common.**mvel2.compiler.**

CompiledExpression.getValue(**CompiledExpression.java:119)

    at org.elasticsearch.script.mvel.**MvelScriptEngineService$**

MvelSearchScript.run(**MvelScriptEngineService.java:**192)

    at org.elasticsearch.index.query.**ScriptFilterParser$**

ScriptFilter$ScriptDocSet.**matchDoc(ScriptFilterParser.**java:184)

    at org.elasticsearch.common.**lucene.docset.MatchDocIdSet.**

get(MatchDocIdSet.java:67)

    at org.apache.lucene.search.**FilteredDocIdSet$1.get(**

FilteredDocIdSet.java:65)

    at org.elasticsearch.common.**lucene.docset.AndDocIdSet$**

AndBits.get(AndDocIdSet.java:**106)

    at org.elasticsearch.common.**lucene.docset.AndDocIdSet$**

AndBits.get(AndDocIdSet.java:**106)

    at org.elasticsearch.common.**lucene.docset.**

BitsDocIdSetIterator$FilteredIterator.match(
BitsDocIdSetIterator.java:59)

    at org.apache.lucene.search.**FilteredDocIdSetIterator.**

nextDoc(**FilteredDocIdSetIterator.java:**60)

    at org.apache.lucene.search.**FilteredDocIdSetIterator.**

nextDoc(**FilteredDocIdSetIterator.java:**59)

    at org.apache.lucene.search.**ConstantScoreQuery$**

ConstantScorer.nextDoc(**ConstantScoreQuery.java:185)

    at org.elasticsearch.common.**lucene.search.function.**

FiltersFunctionScoreQuery$**CustomBoostFactorScorer.nextDoc(
FiltersFunctionScoreQuery.**java:283)

    at org.apache.lucene.search.**Scorer.score(Scorer.java:63)

    at org.apache.lucene.search.**IndexSearcher.search(**

IndexSearcher.java:605)

    at org.elasticsearch.search.**internal.ContextIndexSearcher.**

search(ContextIndexSearcher.**java:156)

    at org.apache.lucene.search.**IndexSearcher.search(**

IndexSearcher.java:572)

    at org.apache.lucene.search.**IndexSearcher.search(**

IndexSearcher.java:524)

    at org.apache.lucene.search.**IndexSearcher.search(**

IndexSearcher.java:501)

    at org.apache.lucene.search.**IndexSearcher.search(**

IndexSearcher.java:345)

    at org.elasticsearch.search.**query.QueryPhase.execute(**

QueryPhase.java:127)

    at org.elasticsearch.search.**SearchService.**executeQueryPhase(

**SearchService.java:239)

    at org.elasticsearch.search.**action.**

SearchServiceTransportAction.sendExecuteQuery(
SearchServiceTransportAction.**java:141)

    at org.elasticsearch.action.**search.type.**

TransportSearchQueryThenFetchAction$AsyncAction.
sendExecuteFirstPhase(TransportSearchQueryThenFetchAction.java:80)

    at org.elasticsearch.action.**search.type.**

TransportSearchTypeAction$**BaseAsyncAction.performFirstPhase(
TransportSearchTypeAction.**java:205)

    at org.elasticsearch.action.**search.type.**

TransportSearchTypeAction$**BaseAsyncAction.onFirstPhaseResult(
TransportSearchTypeAction.**java:281)

    at org.elasticsearch.action.**search.type.**

TransportSearchTypeAction$BaseAsyncAction$3.onFailure(
TransportSearchTypeAction.**java:213)

    at org.elasticsearch.search.**action.**

SearchServiceTransportAction$2.handleException(
SearchServiceTransportAction.j

--
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 [hidden email]http://user/SendEmail.jtp?type=node&node=4035498&i=0
.
For more options, visit https://groups.google.com/groups/opt_out.


If you reply to this email, your message will be added to the discussion
below:

http://elasticsearch-users.115913.n3.nabble.com/IllegalAccessError-when-using-an-MVEL-script-filter-in-the-query-tp4035494p4035498.html
To start a new topic under Elasticsearch Users, email
ml-node+s115913n115913h86@n3.nabble.com
To unsubscribe from Elasticsearch Users, click herehttp://elasticsearch-users.115913.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=115913&code=Y3liZXJjb25uaWVAZ21haWwuY29tfDExNTkxM3wtMjEyOTg4OTgxNA==
.
NAMLhttp://elasticsearch-users.115913.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html!nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers!nabble%3Aemail.naml-instant_emails!nabble%3Aemail.naml-send_instant_email!nabble%3Aemail.naml

IllegalAccessError when using an MVEL script filter in the query · Issue #3094 · elastic/elasticsearch · GitHub submitted.

On Sat, May 25, 2013 at 9:55 PM, Connie Yang cyberconnie@gmail.com wrote:

I will submit a JIRA for this, but here's additional information on our QA
environment.

I've also attached the elasticsearch.conf that I used in that environment.

*OS
*
Ubuntu 12.10 (GNU/Linux 3.5.0-17-generic x86_64)

Java version, vendor
java version "1.7.0_21"
OpenJDK Runtime Environment (IcedTea 2.3.9) (7u21-2.3.9-0ubuntu0.12.10.1)
OpenJDK 64-Bit Server VM (build 23.7-b01, mixed mode)

Script

if(doc['targeting.keys'] == null || doc['targeting.keys'].values.length == 0)"+
"return true;" +
"foreach (kv : doc['targeting.keys'].values) {" +
"var found = 0;" +
"foreach (qkey : qkeys){" +
"if (kv == qkey) {" +
"found = 1;" +
"}" +
"}" +
"if(found == 0){" +
"return false;" +
"}" +
"}" +
"return true;

On Fri, May 24, 2013 at 11:29 PM, simonw-2 [via Elasticsearch Users] <
ml-node+s115913n4035498h21@n3.nabble.com> wrote:

that's not good. Can you provide more info about your system like JVM
version and vendor etc. and maybe the script you try to run?
this seems to be worth an issue too, can you open one?
simon

On Saturday, May 25, 2013 4:05:49 AM UTC+2, Connie Yang wrote:

Also, if we want to use a script filter, which scripting language would
you recommended?

Thanks,
Connie

On Friday, May 24, 2013 6:58:24 PM UTC-7, Connie Yang wrote:

Hi,

We have a 2-node ES cluster running 0.90.0 release in our QA
environment. When we started using a script filter in our query, we got
the following stack trace after a few queries to ES. After looking into
the issue a bit, the issue seemed to be caused by the use of MVEL in
compiled or accelerated mode. Further research seems to indicate that
disabling JIT for MVEL worked around the problem (via
-Dmvel2.disable.jit=true).

Disabling MVEL JIT would also mean a performance concern for us. What's
root cause of this issue? How should we address it?

[2013-05-23 21:04:55,650][DEBUG][action.**search.type ] [Omen]
[indexedbuyitem][0], node[-3mMO7JjTKKhIk92AJt_xQ], [R], s[STARTED]: Failed
to execute [org.elasticsearch.action.**search.SearchRequest@1d5e469d]

java.lang.IllegalAccessError: org/elasticsearch/index/**
fielddata/ScriptDocValues$**Strings$1

    at ASMAccessorImpl_**1471145441369339522430.**getValue(Unknown

Source)

    at org.elasticsearch.common.**mvel2.optimizers.dynamic.**

DynamicGetAccessor.getValue(**DynamicGetAccessor.java:73)

    at org.elasticsearch.common.**mvel2.ast.ASTNode.**

getReducedValueAccelerated(**ASTNode.java:108)

    at org.elasticsearch.common.**mvel2.ast.BinaryOperation.**

getReducedValueAccelerated(**BinaryOperation.java:108)

    at org.elasticsearch.common.**mvel2.ast.Or.**

getReducedValueAccelerated(Or.**java:34)

    at org.elasticsearch.common.**mvel2.ast.Or.**

getReducedValueAccelerated(Or.**java:34)

    at org.elasticsearch.common.**mvel2.MVELRuntime.execute(**

MVELRuntime.java:85)

    at org.elasticsearch.common.**mvel2.compiler.**

CompiledExpression.**getDirectValue(**CompiledExpression.java:123)

    at org.elasticsearch.common.**mvel2.compiler.**

CompiledExpression.getValue(**CompiledExpression.java:119)

    at org.elasticsearch.script.mvel.**MvelScriptEngineService$**

MvelSearchScript.run(**MvelScriptEngineService.java:**192)

    at org.elasticsearch.index.query.**ScriptFilterParser$**

ScriptFilter$ScriptDocSet.**matchDoc(ScriptFilterParser.**java:184)

    at org.elasticsearch.common.**lucene.docset.MatchDocIdSet.**

get(MatchDocIdSet.java:67)

    at org.apache.lucene.search.**FilteredDocIdSet$1.get(**

FilteredDocIdSet.java:65)

    at org.elasticsearch.common.**lucene.docset.AndDocIdSet$**

AndBits.get(AndDocIdSet.java:**106)

    at org.elasticsearch.common.**lucene.docset.AndDocIdSet$**

AndBits.get(AndDocIdSet.java:**106)

    at org.elasticsearch.common.**lucene.docset.**

BitsDocIdSetIterator$FilteredIterator.match(
BitsDocIdSetIterator.java:59)

    at org.apache.lucene.search.**FilteredDocIdSetIterator.**

nextDoc(**FilteredDocIdSetIterator.java:**60)

    at org.apache.lucene.search.**FilteredDocIdSetIterator.**

nextDoc(**FilteredDocIdSetIterator.java:**59)

    at org.apache.lucene.search.**ConstantScoreQuery$**

ConstantScorer.nextDoc(**ConstantScoreQuery.java:185)

    at org.elasticsearch.common.**lucene.search.function.**

FiltersFunctionScoreQuery$**CustomBoostFactorScorer.nextDoc(
FiltersFunctionScoreQuery.**java:283)

    at org.apache.lucene.search.**Scorer.score(Scorer.java:63)

    at org.apache.lucene.search.**IndexSearcher.search(**

IndexSearcher.java:605)

    at org.elasticsearch.search.**internal.ContextIndexSearcher.**

search(ContextIndexSearcher.**java:156)

    at org.apache.lucene.search.**IndexSearcher.search(**

IndexSearcher.java:572)

    at org.apache.lucene.search.**IndexSearcher.search(**

IndexSearcher.java:524)

    at org.apache.lucene.search.**IndexSearcher.search(**

IndexSearcher.java:501)

    at org.apache.lucene.search.**IndexSearcher.search(**

IndexSearcher.java:345)

    at org.elasticsearch.search.**query.QueryPhase.execute(**

QueryPhase.java:127)

    at org.elasticsearch.search.**SearchService.**

executeQueryPhase(**SearchService.java:239)

    at org.elasticsearch.search.**action.**

SearchServiceTransportAction.sendExecuteQuery(
SearchServiceTransportAction.**java:141)

    at org.elasticsearch.action.**search.type.**

TransportSearchQueryThenFetchAction$AsyncAction.
sendExecuteFirstPhase(TransportSearchQueryThenFetchAction.java:80)

    at org.elasticsearch.action.**search.type.**

TransportSearchTypeAction$**BaseAsyncAction.performFirstPhase(
TransportSearchTypeAction.**java:205)

    at org.elasticsearch.action.**search.type.**

TransportSearchTypeAction$**BaseAsyncAction.onFirstPhaseResult(
TransportSearchTypeAction.**java:281)

    at org.elasticsearch.action.**search.type.**

TransportSearchTypeAction$BaseAsyncAction$3.onFailure(
TransportSearchTypeAction.**java:213)

    at org.elasticsearch.search.**action.**

SearchServiceTransportAction$2.handleException(
SearchServiceTransportAction.j

--
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 [hidden email]http://user/SendEmail.jtp?type=node&node=4035498&i=0
.
For more options, visit https://groups.google.com/groups/opt_out.


If you reply to this email, your message will be added to the
discussion below:

http://elasticsearch-users.115913.n3.nabble.com/IllegalAccessError-when-using-an-MVEL-script-filter-in-the-query-tp4035494p4035498.html
To start a new topic under Elasticsearch Users, email
ml-node+s115913n115913h86@n3.nabble.com
To unsubscribe from Elasticsearch Users, click herehttp://elasticsearch-users.115913.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=115913&code=Y3liZXJjb25uaWVAZ21haWwuY29tfDExNTkxM3wtMjEyOTg4OTgxNA==
.
NAMLhttp://elasticsearch-users.115913.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html!nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers!nabble%3Aemail.naml-instant_emails!nabble%3Aemail.naml-send_instant_email!nabble%3Aemail.naml