Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-15387

NPE in HiveServer2 webUI Historical SQL Operations section

Log workAgile BoardRank to TopRank to BottomBulk Copy AttachmentsBulk Move AttachmentsVotersWatch issueWatchersCreate sub-taskConvert to sub-taskMoveLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 2.3.0
    • None
    • None

    Description

      The runtime value on a SQLOperationDisplay may be null, which may lead to NPEs on the web UI.

      Stack trace:

      java.lang.NullPointerException
      	at org.apache.hive.generated.hiveserver2.hiveserver2_jsp._jspService(hiveserver2_jsp.java:145)
      	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
      	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:565)
      	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:479)
      	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
      	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:521)
      	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:227)
      	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1031)
      	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:406)
      	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:186)
      	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:965)
      	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
      	at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250)
      	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111)
      	at org.eclipse.jetty.server.Server.handle(Server.java:349)
      	at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:449)
      	at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:910)
      	at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:634)
      	at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:230)
      	at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:76)
      	at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:609)
      	at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:45)
      	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:599)
      	at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:534)
      	at java.lang.Thread.run(Thread.java:745)
      

      Compiled jsp segment:

       124        out.print( conf.get(ConfVars.HIVE_SERVER2_WEBUI_MAX_HISTORIC_QUERIES.varname) );
         125        out.write(" Closed Queries</h2>\n<table id=\"attributes_table\" class=\"table table-striped\">\n    <tr>\n        <th>User Name</th>\n        <th>Query</th>\n        <th>Execution Engine</th>\n        <th>State</th>\n        <th>Opened (s)</th>\n        <th>Closed Timestamp</th>\n        <th>Latency (s)</th>\n        <th>Drilldown Link</th>\n    </tr>\n    ");
         126  
         127        queries = 0;
         128        operations = sessionManager.getOperationManager().getHistoricalSQLOperations();
         129        for (SQLOperationDisplay operation : operations) {
         130            queries++;
         131      
         132        out.write("\n    <tr>\n        <td>");
         133        out.print( operation.getUserName() );
         134        out.write("</td>\n        <td>");
         135        out.print( operation.getQueryDisplay() == null ? "Unknown" : operation.getQueryDisplay().getQueryString() );
         136        out.write("</td>\n        <td>");
         137        out.print( operation.getExecutionEngine() );
         138        out.write("\n        <td>");
         139        out.print( operation.getState() );
         140        out.write("</td>\n        <td>");
         141        out.print( operation.getElapsedTime()/1000 );
         142        out.write("</td>\n        <td>");
         143        out.print( operation.getEndTime() == null ? "In Progress" : new Date(operation.getEndTime()) );
         144        out.write("</td>\n        <td>");
         145        out.print( operation.getRuntime()/1000 );
         146        out.write("</td>\n        ");
      

      Still trying to find a way to easily reproduce the issue.

      Attachments

        1. HIVE-15387.1.patch
          0.9 kB
          Barna Zsombor Klara

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            zsombor.klara Barna Zsombor Klara Assign to me
            zsombor.klara Barna Zsombor Klara
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment