Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-6351

Drill fails with NullPointerException when starting in embedded mode

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.14.0
    • Component/s: None
    • Labels:
      None

      Description

      When starting Drill in embedded mode and another Drill instance is already running, it fails with NPE:

      java.lang.NullPointerException
              at org.apache.drill.exec.coord.local.LocalClusterCoordinator.update(LocalClusterCoordinator.java:98)
              at org.apache.drill.exec.server.Drillbit.close(Drillbit.java:231)
              at org.apache.drill.jdbc.impl.DrillConnectionImpl.cleanup(DrillConnectionImpl.java:827)
              at org.apache.drill.jdbc.impl.DrillConnectionImpl.<init>(DrillConnectionImpl.java:186)
              at org.apache.drill.jdbc.impl.DrillJdbc41Factory.newDrillConnection(DrillJdbc41Factory.java:72)
              at org.apache.drill.jdbc.impl.DrillFactory.newConnection(DrillFactory.java:68)
              at org.apache.calcite.avatica.UnregisteredDriver.connect(UnregisteredDriver.java:138)
              at org.apache.drill.jdbc.Driver.connect(Driver.java:72)
              at sqlline.DatabaseConnection.connect(DatabaseConnection.java:167)
              at sqlline.DatabaseConnection.getConnection(DatabaseConnection.java:213)
              at sqlline.Commands.close(Commands.java:925)
              at sqlline.Commands.quit(Commands.java:889)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:498)
              at sqlline.ReflectiveCommandHandler.execute(ReflectiveCommandHandler.java:36)
              at sqlline.SqlLine.dispatch(SqlLine.java:742)
              at sqlline.SqlLine.begin(SqlLine.java:621)
              at sqlline.SqlLine.start(SqlLine.java:375)
              at sqlline.SqlLine.main(SqlLine.java:268)
      

      Before the exception was:

      Error: Failure in starting embedded Drillbit: java.net.BindException: Address already in use (state=,code=0)
      java.sql.SQLException: Failure in starting embedded Drillbit: java.net.BindException: Address already in use
              at org.apache.drill.jdbc.impl.DrillConnectionImpl.<init>(DrillConnectionImpl.java:144)
              at org.apache.drill.jdbc.impl.DrillJdbc41Factory.newDrillConnection(DrillJdbc41Factory.java:72)
              at org.apache.drill.jdbc.impl.DrillFactory.newConnection(DrillFactory.java:68)
              at org.apache.calcite.avatica.UnregisteredDriver.connect(UnregisteredDriver.java:138)
              at org.apache.drill.jdbc.Driver.connect(Driver.java:72)
              at sqlline.DatabaseConnection.connect(DatabaseConnection.java:167)
              at sqlline.DatabaseConnection.getConnection(DatabaseConnection.java:213)
              at sqlline.Commands.connect(Commands.java:1083)
              at sqlline.Commands.connect(Commands.java:1015)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:498)
              at sqlline.ReflectiveCommandHandler.execute(ReflectiveCommandHandler.java:36)
              at sqlline.SqlLine.dispatch(SqlLine.java:742)
              at sqlline.SqlLine.initArgs(SqlLine.java:528)
              at sqlline.SqlLine.begin(SqlLine.java:596)
              at sqlline.SqlLine.start(SqlLine.java:375)
              at sqlline.SqlLine.main(SqlLine.java:268)
      Caused by: java.net.BindException: Address already in use
              at sun.nio.ch.Net.bind0(Native Method)
              at sun.nio.ch.Net.bind(Net.java:433)
              at sun.nio.ch.Net.bind(Net.java:425)
              at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
              at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
              at org.eclipse.jetty.server.ServerConnector.open(ServerConnector.java:279)
              at org.eclipse.jetty.server.AbstractNetworkConnector.doStart(AbstractNetworkConnector.java:80)
              at org.eclipse.jetty.server.ServerConnector.doStart(ServerConnector.java:218)
              at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
              at org.eclipse.jetty.server.Server.doStart(Server.java:337)
              at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
              at org.apache.drill.exec.server.rest.WebServer.start(WebServer.java:168)
              at org.apache.drill.exec.server.Drillbit.run(Drillbit.java:193)
              at org.apache.drill.jdbc.impl.DrillConnectionImpl.<init>(DrillConnectionImpl.java:135)
              ... 18 more
      

      This is a regression caused by changes introduced in DRILL-6289

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                kkhatua Kunal Khatua
                Reporter:
                vvysotskyi Volodymyr Vysotskyi
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: