Brian Lininger created SOLR-10861: ------------------------------------- Summary: Stream query on empty core throws IOException Key: SOLR-10861 URL: https://issues.apache.org/jira/browse/SOLR-10861 Project: Solr Issue Type: Bug Security Level: Public (Default Security Level. Issues are Public) Components: search Affects Versions: 5.5.1 Reporter: Brian Lininger Priority: Minor
When attempting to perform a stream query on an empty (no documents) Solr core, an IOException is thrown instead of returning an empty result set. For example, only a newly created Solr core (core_1), I can curl: {preformat} curl --data-urlencode 'stream=search(instance_1000019_ARCHIVE,q="*:*",qt="/export",fl="DocumentVersionIdDocValue",sort="DocumentVersionIdDocValue asc",fq="SolrDocumentType:Document")' http://localhost:8085/solr/instance_1000019_ARCHIVE/stream {preformat} and the result is: {preformat} <?xml version="1.0" encoding="UTF-8"?> <response> <lst name="error"><str name="msg">java.util.concurrent.ExecutionException: java.io.IOException: JSONTupleStream: expected OBJECT_START but got STRING</str><str name="trace">java.io.IOException: java.util.concurrent.ExecutionException: java.io.IOException: JSONTupleStream: expected OBJECT_START but got STRING at org.apache.solr.client.solrj.io.stream.CloudSolrStream.openStreams(CloudSolrStream.java:332) at org.apache.solr.client.solrj.io.stream.CloudSolrStream.open(CloudSolrStream.java:231) at org.apache.solr.response.TextResponseWriter.writeTupleStream(TextResponseWriter.java:300) at org.apache.solr.response.TextResponseWriter.writeVal(TextResponseWriter.java:169) at org.apache.solr.response.XMLWriter.writeResponse(XMLWriter.java:113) at org.apache.solr.response.XMLResponseWriter.write(XMLResponseWriter.java:39) at org.apache.solr.response.QueryResponseWriterUtil.writeQueryResponse(QueryResponseWriterUtil.java:52) at org.apache.solr.servlet.HttpSolrCall.writeResponse(HttpSolrCall.java:728) at org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:469) at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:257) at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:208) at veeva.ecm.common.interfaces.web.SolrDispatchOverride.doFilter(SolrDispatchOverride.java:43) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:94) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:620) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:502) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1104) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:684) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1519) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1475) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745) Caused by: java.util.concurrent.ExecutionException: java.io.IOException: JSONTupleStream: expected OBJECT_START but got STRING at java.util.concurrent.FutureTask.report(FutureTask.java:122) at java.util.concurrent.FutureTask.get(FutureTask.java:192) at org.apache.solr.client.solrj.io.stream.CloudSolrStream.openStreams(CloudSolrStream.java:326) ... 28 more Caused by: java.io.IOException: JSONTupleStream: expected OBJECT_START but got STRING at org.apache.solr.client.solrj.io.stream.JSONTupleStream.expect(JSONTupleStream.java:98) at org.apache.solr.client.solrj.io.stream.JSONTupleStream.advanceToDocs(JSONTupleStream.java:156) at org.apache.solr.client.solrj.io.stream.JSONTupleStream.next(JSONTupleStream.java:76) at org.apache.solr.client.solrj.io.stream.SolrStream.read(SolrStream.java:147) at org.apache.solr.client.solrj.io.stream.CloudSolrStream$TupleWrapper.next(CloudSolrStream.java:413) at org.apache.solr.client.solrj.io.stream.CloudSolrStream$StreamOpener.call(CloudSolrStream.java:436) at org.apache.solr.client.solrj.io.stream.CloudSolrStream$StreamOpener.call(CloudSolrStream.java:423) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at org.apache.solr.common.util.ExecutorUtil$MDCAwareThreadPoolExecutor$1.run(ExecutorUtil.java:231) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) ... 1 more </str><int name="code">500</int></lst> </response> {preformat} And the Solr log contains: {preformat} ERROR org.apache.solr.servlet.HttpSolrCall - null:java.io.IOException: org.apache.solr.search.SyntaxError: xport RankQuery is required for xsort: rq={!xport} at org.apache.solr.response.SortingResponseWriter.write(SortingResponseWriter.java:101) at org.apache.solr.response.QueryResponseWriterUtil.writeQueryResponse(QueryResponseWriterUtil.java:52) at org.apache.solr.servlet.HttpSolrCall.writeResponse(HttpSolrCall.java:728) at org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:469) at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:257) at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:208) at veeva.ecm.common.interfaces.web.SolrDispatchOverride.doFilter(SolrDispatchOverride.java:43) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:94) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:620) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:502) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1104) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:684) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1519) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1475) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745) Caused by: org.apache.solr.search.SyntaxError: xport RankQuery is required for xsort: rq={!xport} ... 24 more {preformat} Indexing a single document and running the same curl command above returns the expected response: {preformat} <?xml version="1.0" encoding="UTF-8"?> <response> <lst name="responseHeader"><int name="status">0</int><int name="QTime">0</int></lst><result name="response" numFound="-1" start="-1"><lst><bool name="EOF">true</bool></lst></result> </response> {preformat} -- This message was sent by Atlassian JIRA (v6.3.15#6346) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org