You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Ramkumar Aiyengar (JIRA)" <ji...@apache.org> on 2015/03/19 15:03:39 UTC

[jira] [Updated] (SOLR-7254) NullPointerException thrown in the QueryComponent

     [ https://issues.apache.org/jira/browse/SOLR-7254?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ramkumar Aiyengar updated SOLR-7254:
------------------------------------
    Attachment: SOLR-7254.patch

Here's a patch to start things off. I haven't tested this as yet or added tests for this as yet. [~hgadre], if you can knock up some tests for this, that would be great, else I will probably get to it some time. You can start at {{TestDistributedSearch}}.

> NullPointerException thrown in the QueryComponent
> -------------------------------------------------
>
>                 Key: SOLR-7254
>                 URL: https://issues.apache.org/jira/browse/SOLR-7254
>             Project: Solr
>          Issue Type: Bug
>    Affects Versions: 4.10.3
>            Reporter: Hrishikesh Gadre
>            Assignee: Ramkumar Aiyengar
>            Priority: Minor
>         Attachments: SOLR-7254.patch
>
>
> In case of a distributed search, if we pass invalid query parameters (e.g. negative start value), then Solr returns internal server error (HTTP 500 response) due to following NullPointerException,
> {
>   "responseHeader":{
>     "status":500,
>     "QTime":6,
>     "params":{
>       "indent":"true",
>       "start":"-1",
>       "q":"*:*",
>       "wt":"json"}},
>   "error":{
>     "trace":"java.lang.NullPointerException\n\tat org.apache.solr.handler.component.QueryComponent.mergeIds(QueryComponent.java:1031)\n\tat org.apache.solr.handler.component.QueryComponent.handleRegularResponses(QueryComponent.java:715)\n\tat org.apache.solr.handler.component.QueryComponent.handleResponses(QueryComponent.java:694)\n\tat org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:324)\n\tat org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:135)\n\tat org.apache.solr.core.SolrCore.execute(SolrCore.java:1984)\n\tat org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:818)\n\tat org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:422)\n\tat org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:211)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)\n\tat org.apache.solr.servlet.SolrHadoopAuthenticationFilter$2.doFilter(SolrHadoopAuthenticationFilter.java:272)\n\tat org.apache.hadoop.security.authentication.server.AuthenticationFilter.doFilter(AuthenticationFilter.java:592)\n\tat org.apache.hadoop.security.token.delegation.web.DelegationTokenAuthenticationFilter.doFilter(DelegationTokenAuthenticationFilter.java:277)\n\tat org.apache.hadoop.security.authentication.server.AuthenticationFilter.doFilter(AuthenticationFilter.java:555)\n\tat org.apache.solr.servlet.SolrHadoopAuthenticationFilter.doFilter(SolrHadoopAuthenticationFilter.java:277)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)\n\tat org.apache.solr.servlet.HostnameFilter.doFilter(HostnameFilter.java:86)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)\n\tat org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)\n\tat org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)\n\tat org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)\n\tat org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)\n\tat org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)\n\tat org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)\n\tat org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)\n\tat org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)\n\tat org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)\n\tat java.lang.Thread.run(Thread.java:745)\n",
>     "code":500}}
> The root cause of this error is that in case of a distributed query, input validation is missing.
> (Non distributed version)
> https://github.com/apache/lucene-solr/blob/817303840fce547a1557e330e93e5a8ac0618f34/solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java#L284
> (Distributed version)
> https://github.com/apache/lucene-solr/blob/817303840fce547a1557e330e93e5a8ac0618f34/solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java#L691



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org