Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-9302

Better error message when running SQL queries in standalone mode

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      I tried running sql queries on the techproducts example by mistake. When I ran a query I got an exception like this

      {"result-set":{"docs":[
      {"EXCEPTION":"java.net.UnknownHostException: null: unknown error","EOF":true,"RESPONSE_TIME":5}]}}
      

      Here is the stack trace from the solr logs

      ERROR - 2016-07-13 13:07:01.496; [   x:techproducts] org.apache.solr.common.SolrException; org.apache.solr.common.SolrException: java.net.UnknownHostException: null: unknown error
      	at org.apache.solr.common.cloud.SolrZkClient.<init>(SolrZkClient.java:169)
      	at org.apache.solr.common.cloud.SolrZkClient.<init>(SolrZkClient.java:115)
      	at org.apache.solr.common.cloud.SolrZkClient.<init>(SolrZkClient.java:105)
      	at org.apache.solr.common.cloud.ZkStateReader.<init>(ZkStateReader.java:227)
      	at org.apache.solr.client.solrj.impl.CloudSolrClient.connect(CloudSolrClient.java:502)
      	at org.apache.solr.client.solrj.io.SolrClientCache.getCloudSolrClient(SolrClientCache.java:50)
      	at org.apache.solr.client.solrj.io.stream.CloudSolrStream.open(CloudSolrStream.java:298)
      	at org.apache.solr.client.solrj.io.stream.SelectStream.open(SelectStream.java:184)
      	at org.apache.solr.client.solrj.io.stream.ExceptionStream.open(ExceptionStream.java:51)
      	at org.apache.solr.handler.StreamHandler$TimerStream.open(StreamHandler.java:423)
      	at org.apache.solr.response.TextResponseWriter.writeTupleStream(TextResponseWriter.java:304)
      	at org.apache.solr.response.TextResponseWriter.writeVal(TextResponseWriter.java:168)
      	at org.apache.solr.response.JSONWriter.writeNamedListAsMapWithDups(JSONResponseWriter.java:183)
      	at org.apache.solr.response.JSONWriter.writeNamedList(JSONResponseWriter.java:299)
      	at org.apache.solr.response.JSONWriter.writeResponse(JSONResponseWriter.java:95)
      	at org.apache.solr.response.JSONResponseWriter.write(JSONResponseWriter.java:60)
      	at org.apache.solr.response.QueryResponseWriterUtil.writeQueryResponse(QueryResponseWriterUtil.java:65)
      	at org.apache.solr.servlet.HttpSolrCall.writeResponse(HttpSolrCall.java:731)
      	at org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:473)
      	at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:257)
      	at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:208)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1668)
      	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:581)
      	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
      	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
      	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226)
      	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1160)
      	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511)
      	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
      	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1092)
      	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
      	at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:213)
      	at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:119)
      	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
      	at org.eclipse.jetty.server.Server.handle(Server.java:518)
      	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:308)
      	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:244)
      	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)
      	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
      	at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)
      	at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceAndRun(ExecuteProduceConsume.java:246)
      	at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:156)
      	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:654)
      	at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:572)
      	at java.lang.Thread.run(Thread.java:745)
      Caused by: java.net.UnknownHostException: null: unknown error
      	at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
      	at java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:928)
      	at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1323)
      	at java.net.InetAddress.getAllByName0(InetAddress.java:1276)
      	at java.net.InetAddress.getAllByName(InetAddress.java:1192)
      	at java.net.InetAddress.getAllByName(InetAddress.java:1126)
      	at org.apache.zookeeper.client.StaticHostProvider.<init>(StaticHostProvider.java:61)
      	at org.apache.zookeeper.ZooKeeper.<init>(ZooKeeper.java:445)
      	at org.apache.zookeeper.ZooKeeper.<init>(ZooKeeper.java:380)
      	at org.apache.solr.common.cloud.SolrZooKeeper.<init>(SolrZooKeeper.java:43)
      	at org.apache.solr.common.cloud.ZkClientConnectionStrategy.createSolrZooKeeper(ZkClientConnectionStrategy.java:103)
      	at org.apache.solr.common.cloud.DefaultConnectionStrategy.connect(DefaultConnectionStrategy.java:37)
      	at org.apache.solr.common.cloud.SolrZkClient.<init>(SolrZkClient.java:144)
      	... 44 more
      
      

      We should respond back with a more useful message to the user in case sql queries are been run in standalone mode

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                krisden Kevin Risden
                Reporter:
                varunthacker Varun Thacker
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: