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

Admin UI SQL page should be hidden if plugin is not enabled

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • Admin UI
    • None

    Description

      SQL page is available even if plugin is not enabled (it is disabled by default).
      Also, page errors out if you run any sql, but will not properly display some error message, the js will break on parsing the exception coming in the response.

      Slack discussion https://the-asf.slack.com/archives/CEKUCUNE9/p1674843671145009

      Error response from backend if plugin is not enabled

      {
        "error":{
          "metadata":[
            "error-class","org.apache.solr.common.SolrException",
            "root-error-class","java.lang.ClassNotFoundException"],
          "msg":" Error loading class 'solr.SQLHandler'",
          "trace":"org.apache.solr.common.SolrException:  Error loading class 'solr.SQLHandler'\n\tat org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:548)\n\tat org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:469)\n\tat org.apache.solr.core.SolrCore.createInstance(SolrCore.java:933)\n\tat org.apache.solr.core.PluginBag$LazyPluginHolder.createInst(PluginBag.java:502)\n\tat org.apache.solr.core.PluginBag$LazyPluginHolder.get(PluginBag.java:484)\n\tat org.apache.solr.core.PluginBag.get(PluginBag.java:185)\n\tat org.apache.solr.handler.RequestHandlerBase.getRequestHandler(RequestHandlerBase.java:312)\n\tat org.apache.solr.core.SolrCore.getRequestHandler(SolrCore.java:1955)\n\tat org.apache.solr.servlet.HttpSolrCall.extractHandlerFromURLPath(HttpSolrCall.java:430)\n\tat org.apache.solr.servlet.HttpSolrCall.init(HttpSolrCall.java:326)\n\tat org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:510)\n\tat org.apache.solr.servlet.SolrDispatchFilter.dispatch(SolrDispatchFilter.java:252)\n\tat org.apache.solr.servlet.SolrDispatchFilter.lambda$doFilter$0(SolrDispatchFilter.java:220)\n\tat org.apache.solr.servlet.ServletUtils.traceHttpRequestExecution2(ServletUtils.java:257)\n\tat org.apache.solr.servlet.ServletUtils.rateLimitRequest(ServletUtils.java:227)\n\tat org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:215)\n\tat org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:197)\n ... Caused by: java.lang.ClassNotFoundException: solr.SQLHandler\n\tat java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:445)\n\tat java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:587)\n\tat java.base/java.net.FactoryURLClassLoader.loadClass(URLClassLoader.java:872)\n\tat java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)\n\tat java.base/java.lang.Class.forName0(Native Method)\n\tat java.base/java.lang.Class.forName(Class.java:467)\n\tat org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:532)\n\t... 56 more\n",
          "code":500}}
      

      Js breaking due to error response instead of regular response

      angular.min.js?_=9.1.0:146 TypeError: Cannot read properties of undefined (reading 'docs')
          at sqlquery.js?_=9.1.0:63:49
          at I (angular-resource.min.js?_=9.1.0:31:74)
          at angular.min.js?_=9.1.0:159:235
          at m.$digest (angular.min.js?_=9.1.0:170:385)
          at m.$apply (angular.min.js?_=9.1.0:174:259)
          at k (angular.min.js?_=9.1.0:125:309)
          at v (angular.min.js?_=9.1.0:130:422)
          at y.onload (angular.min.js?_=9.1.0:131:335) 'Possibly unhandled rejection: {}'
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              stillalex Alex Deparvu
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated: