Uploaded image for project: 'CDAP'
  1. CDAP
  2. CDAP-10469

Better error messaging for when getSchema fails

    Details

    • Release Notes:
      Improved error messages for the 'Get Schema' functionality of Database plugins in CDAP Pipelines.
    • Rank:
      1|hzzko7:

      Description

      If for some reason getSchema fails, the UI just says: 'Error: Error while invoking plugin method' which isn't very helpful. For example, digging through the logs, i can see that i don't have permissions to access the database. We should surface those errors to the user so they can take the correct action.

      2016-08-19 17:32:34,501 - ERROR [netty-executor-0:c.c.h.p.d.b.s.DBSource@140] - Exception while performing getSchema
      java.sql.SQLException: Access denied for user 'root'@'xxxxxxxxxxxxxxxxxx' (using password: YES)
             	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:963) ~[na:na]
             	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3966) ~[na:na]
             	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3902) ~[na:na]
             	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:875) ~[na:na]
             	at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:4414) ~[na:na]
             	at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1280) ~[na:na]
             	at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2253) ~[na:na]
             	at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2284) ~[na:na]
             	at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2083) ~[na:na]
             	at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:806) ~[na:na]
             	at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47) ~[na:na]
             	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.7.0_75]
             	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) ~[na:1.7.0_75]
             	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.7.0_75]
             	at java.lang.reflect.Constructor.newInstance(Constructor.java:526) ~[na:1.7.0_75]
             	at com.mysql.jdbc.Util.handleNewInstance(Util.java:404) ~[na:na]
             	at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:410) ~[na:na]
             	at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:328) ~[na:na]
             	at co.cask.hydrator.plugin.JDBCDriverShim.connect(JDBCDriverShim.java:60) ~[na:na]
             	at java.sql.DriverManager.getConnection(DriverManager.java:571) ~[na:1.7.0_75]
             	at java.sql.DriverManager.getConnection(DriverManager.java:215) ~[na:1.7.0_75]
             	at co.cask.hydrator.plugin.db.batch.source.DBSource.getConnection(DBSource.java:165) ~[na:na]
             	at co.cask.hydrator.plugin.db.batch.source.DBSource.getSchema(DBSource.java:129) ~[na:na]
             	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_75]
             	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[na:1.7.0_75]
             	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_75]
             	at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_75]
             	at co.cask.cdap.internal.app.runtime.plugin.PluginService$2.invoke(PluginService.java:354) [co.cask.cdap.cdap-app-fabric-3.5.0-SNAPSHOT.jar:na]
             	at co.cask.cdap.gateway.handlers.ArtifactHttpHandler.callArtifactPluginMethod(ArtifactHttpHandler.java:477) [co.cask.cdap.cdap-app-fabric-3.5.0-SNAPSHOT.jar:na]
             	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_75]
             	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[na:1.7.0_75]
             	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_75]
             	at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_75]
             	at co.cask.http.HttpMethodInfo.invoke(HttpMethodInfo.java:80) [co.cask.http.netty-http-0.14.0.jar:na]
             	at co.cask.http.HttpDispatcher.messageReceived(HttpDispatcher.java:38) [co.cask.http.netty-http-0.14.0.jar:na]
             	at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70) [io.netty.netty-3.6.6.Final.jar:na]
             	at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564) [io.netty.netty-3.6.6.Final.jar:na]
             	at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791) [io.netty.netty-3.6.6.Final.jar:na]
             	at org.jboss.netty.handler.execution.ChannelUpstreamEventRunnable.doRun(ChannelUpstreamEventRunnable.java:43) [io.netty.netty-3.6.6.Final.jar:na]
             	at org.jboss.netty.handler.execution.ChannelEventRunnable.run(ChannelEventRunnable.java:67) [io.netty.netty-3.6.6.Final.jar:na]
             	at org.jboss.netty.handler.execution.OrderedMemoryAwareThreadPoolExecutor$ChildExecutor.run(OrderedMemoryAwareThreadPoolExecutor.java:314) [io.netty.netty-3.6.6.Final.jar:na]
             	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_75]
             	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_75]
             	at java.lang.Thread.run(Thread.java:745) [na:1.7.0_75]
      

        Attachments

          Activity

            People

            • Assignee:
              shankar Shankar Selvam
              Reporter:
              russellsavage Russ Savage
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: