[ 
https://issues.apache.org/jira/browse/DRILL-6351?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16450472#comment-16450472
 ] 

Kunal Khatua commented on DRILL-6351:
-------------------------------------

[~vvysotskyi]/[~arina]

I'm not getting the exact trace with the Apache build, but I do get the 
required exception of the webport being in use (during starting up of the 
WebServer for embedded Drill). I only see the NPE within the SQLLine session, 
which also shows that there is no active connection. Let me probe a little more.

Here is what I got:
{code:java}
2018-04-24 13:27:47,087 kk127.qa.lab [main] WARN  
o.e.j.u.component.AbstractLifeCycle - FAILED 
ServerConnector@26eb6e87{HTTP/1.1}{0.0.0.0:8047}: java.net.BindException: 
Address already in use
java.net.BindException: Address already in use
        at sun.nio.ch.Net.$$YJP$$bind0(Native Method) ~[na:1.8.0_112]
        at sun.nio.ch.Net.bind0(Net.java) ~[na:1.8.0_112]
        at sun.nio.ch.Net.bind(Net.java:433) ~[na:1.8.0_112]
        at sun.nio.ch.Net.bind(Net.java:425) ~[na:1.8.0_112]
        at 
sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223) 
~[na:1.8.0_112]
        at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74) 
~[na:1.8.0_112]
        at 
org.eclipse.jetty.server.ServerConnector.open(ServerConnector.java:279) 
~[jetty-server-9.1.5.v20140505.jar:9.1.5.v20140505]
        at 
org.eclipse.jetty.server.AbstractNetworkConnector.doStart(AbstractNetworkConnector.java:80)
 ~[jetty-server-9.1.5.v20140505.jar:9.1.5.v20140505]
        at 
org.eclipse.jetty.server.ServerConnector.doStart(ServerConnector.java:218) 
~[jetty-server-9.1.5.v20140505.jar:9.1.5.v20140505]
        at 
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
 [jetty-util-9.1.5.v20140505.jar:9.1.5.v20140505]
        at org.eclipse.jetty.server.Server.doStart(Server.java:337) 
[jetty-server-9.1.5.v20140505.jar:9.1.5.v20140505]
        at 
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
 [jetty-util-9.1.5.v20140505.jar:9.1.5.v20140505]
        at 
org.apache.drill.exec.server.rest.WebServer.start(WebServer.java:175) 
[drill-java-exec-1.14.0-SNAPSHOT.jar:1.14.0-SNAPSHOT]
        at org.apache.drill.exec.server.Drillbit.run(Drillbit.java:192) 
[drill-java-exec-1.14.0-SNAPSHOT.jar:1.14.0-SNAPSHOT]
        at 
org.apache.drill.jdbc.impl.DrillConnectionImpl.<init>(DrillConnectionImpl.java:135)
 [drill-jdbc-1.14.0-SNAPSHOT.jar:1.14.0-SNAPSHOT]
        at 
org.apache.drill.jdbc.impl.DrillJdbc41Factory.newDrillConnection(DrillJdbc41Factory.java:72)
 [drill-jdbc-1.14.0-SNAPSHOT.jar:1.14.0-SNAPSHOT]
        at 
org.apache.drill.jdbc.impl.DrillFactory.newConnection(DrillFactory.java:68) 
[drill-jdbc-1.14.0-SNAPSHOT.jar:1.14.0-SNAPSHOT]
        at 
org.apache.calcite.avatica.UnregisteredDriver.connect(UnregisteredDriver.java:138)
 [avatica-1.11.0.jar:1.11.0]
        at org.apache.drill.jdbc.Driver.connect(Driver.java:72) 
[drill-jdbc-1.14.0-SNAPSHOT.jar:1.14.0-SNAPSHOT]
        at sqlline.DatabaseConnection.connect(DatabaseConnection.java:167) 
[sqlline-1.1.9-drill-r7.jar:na]
        at 
sqlline.DatabaseConnection.getConnection(DatabaseConnection.java:213) 
[sqlline-1.1.9-drill-r7.jar:na]
        at sqlline.Commands.connect(Commands.java:1083) 
[sqlline-1.1.9-drill-r7.jar:na]
        at sqlline.Commands.connect(Commands.java:1015) 
[sqlline-1.1.9-drill-r7.jar:na]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
~[na:1.8.0_112]
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
~[na:1.8.0_112]
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 ~[na:1.8.0_112]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_112]
        at 
sqlline.ReflectiveCommandHandler.execute(ReflectiveCommandHandler.java:36) 
[sqlline-1.1.9-drill-r7.jar:na]
        at sqlline.SqlLine.dispatch(SqlLine.java:742) 
[sqlline-1.1.9-drill-r7.jar:na]
        at sqlline.SqlLine.initArgs(SqlLine.java:528) 
[sqlline-1.1.9-drill-r7.jar:na]
        at sqlline.SqlLine.begin(SqlLine.java:596) 
[sqlline-1.1.9-drill-r7.jar:na]
        at sqlline.SqlLine.start(SqlLine.java:375) 
[sqlline-1.1.9-drill-r7.jar:na]
        at sqlline.SqlLine.main(SqlLine.java:268) 
[sqlline-1.1.9-drill-r7.jar:na]
2018-04-24 13:27:47,089 kk127.qa.lab [main] WARN  
o.e.j.u.component.AbstractLifeCycle - FAILED 
org.eclipse.jetty.server.Server@59096877: java.net.BindException: Address 
already in use
java.net.BindException: Address already in use
        at sun.nio.ch.Net.$$YJP$$bind0(Native Method) ~[na:1.8.0_112]
        at sun.nio.ch.Net.bind0(Net.java) ~[na:1.8.0_112]
        at sun.nio.ch.Net.bind(Net.java:433) ~[na:1.8.0_112]
        at sun.nio.ch.Net.bind(Net.java:425) ~[na:1.8.0_112]
        at 
sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223) 
~[na:1.8.0_112]
        at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74) 
~[na:1.8.0_112]
        at 
org.eclipse.jetty.server.ServerConnector.open(ServerConnector.java:279) 
~[jetty-server-9.1.5.v20140505.jar:9.1.5.v20140505]
        at 
org.eclipse.jetty.server.AbstractNetworkConnector.doStart(AbstractNetworkConnector.java:80)
 ~[jetty-server-9.1.5.v20140505.jar:9.1.5.v20140505]
        at 
org.eclipse.jetty.server.ServerConnector.doStart(ServerConnector.java:218) 
~[jetty-server-9.1.5.v20140505.jar:9.1.5.v20140505]
        at 
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
 ~[jetty-util-9.1.5.v20140505.jar:9.1.5.v20140505]
        at org.eclipse.jetty.server.Server.doStart(Server.java:337) 
~[jetty-server-9.1.5.v20140505.jar:9.1.5.v20140505]
        at 
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
 ~[jetty-util-9.1.5.v20140505.jar:9.1.5.v20140505]
        at 
org.apache.drill.exec.server.rest.WebServer.start(WebServer.java:175) 
[drill-java-exec-1.14.0-SNAPSHOT.jar:1.14.0-SNAPSHOT]
        at org.apache.drill.exec.server.Drillbit.run(Drillbit.java:192) 
[drill-java-exec-1.14.0-SNAPSHOT.jar:1.14.0-SNAPSHOT]
        at 
org.apache.drill.jdbc.impl.DrillConnectionImpl.<init>(DrillConnectionImpl.java:135)
 [drill-jdbc-1.14.0-SNAPSHOT.jar:1.14.0-SNAPSHOT]
        at 
org.apache.drill.jdbc.impl.DrillJdbc41Factory.newDrillConnection(DrillJdbc41Factory.java:72)
 [drill-jdbc-1.14.0-SNAPSHOT.jar:1.14.0-SNAPSHOT]
        at 
org.apache.drill.jdbc.impl.DrillFactory.newConnection(DrillFactory.java:68) 
[drill-jdbc-1.14.0-SNAPSHOT.jar:1.14.0-SNAPSHOT]
        at 
org.apache.calcite.avatica.UnregisteredDriver.connect(UnregisteredDriver.java:138)
 [avatica-1.11.0.jar:1.11.0]
        at org.apache.drill.jdbc.Driver.connect(Driver.java:72) 
[drill-jdbc-1.14.0-SNAPSHOT.jar:1.14.0-SNAPSHOT]
        at sqlline.DatabaseConnection.connect(DatabaseConnection.java:167) 
[sqlline-1.1.9-drill-r7.jar:na]
        at 
sqlline.DatabaseConnection.getConnection(DatabaseConnection.java:213) 
[sqlline-1.1.9-drill-r7.jar:na]
        at sqlline.Commands.connect(Commands.java:1083) 
[sqlline-1.1.9-drill-r7.jar:na]
        at sqlline.Commands.connect(Commands.java:1015) 
[sqlline-1.1.9-drill-r7.jar:na]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
~[na:1.8.0_112]
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
~[na:1.8.0_112]
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 ~[na:1.8.0_112]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_112]
        at 
sqlline.ReflectiveCommandHandler.execute(ReflectiveCommandHandler.java:36) 
[sqlline-1.1.9-drill-r7.jar:na]
        at sqlline.SqlLine.dispatch(SqlLine.java:742) 
[sqlline-1.1.9-drill-r7.jar:na]
        at sqlline.SqlLine.initArgs(SqlLine.java:528) 
[sqlline-1.1.9-drill-r7.jar:na]
        at sqlline.SqlLine.begin(SqlLine.java:596) 
[sqlline-1.1.9-drill-r7.jar:na]
        at sqlline.SqlLine.start(SqlLine.java:375) 
[sqlline-1.1.9-drill-r7.jar:na]
        at sqlline.SqlLine.main(SqlLine.java:268) 
[sqlline-1.1.9-drill-r7.jar:na]
{code}

> Drill fails with NullPointerException when starting in embedded mode
> --------------------------------------------------------------------
>
>                 Key: DRILL-6351
>                 URL: https://issues.apache.org/jira/browse/DRILL-6351
>             Project: Apache Drill
>          Issue Type: Bug
>            Reporter: Volodymyr Vysotskyi
>            Assignee: Kunal Khatua
>            Priority: Blocker
>             Fix For: 1.14.0
>
>
> When starting Drill in embedded mode and another Drill instance is already 
> running, it fails with NPE:
> {noformat}
> 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)
> {noformat}
> Before the exception was:
> {noformat}
> 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
> {noformat}
> This is a regression caused by changes introduced in DRILL-6289



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to