Could not send query when reading from MySQL

DATA_READ ERROR: The JDBC storage plugin failed while trying setup the SQL query. sql SELECT * FROM posloan.trm_edw_app_salman_sdsm_mer_dev_w LIMIT 2000 OFFSET 0 plugin posloanrw_10-16-30-154 SqlOperatorImpl JDBC_SUB_SCAN Location 0:0:6 SqlOperatorImpl JDBC_SUB_SCAN Location 0:0:6 Fragment 0:0 [Error Id: 36fe26a4-8548-4bc0-a64b-cb70c35fa387 on gz-public-test-app92-140-228.msfinance.host:31010] (java.sql.SQLNonTransientConnectionException) (conn:82203) Could not send query: Broken pipe (Write failed) org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper.get():156 org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper.getException():118 org.mariadb.jdbc.MariaDbStatement.executeExceptionEpilogue():247 org.mariadb.jdbc.MariaDbStatement.executeInternal():322 org.mariadb.jdbc.MariaDbStatement.executeQuery():492 com.dremio.exec.store.jdbc.JdbcRecordReader.setup():171 com.dremio.exec.store.CoercionReader.setup():109 com.dremio.sabot.op.scan.ScanOperator$1.run():178 com.dremio.sabot.op.scan.ScanOperator$1.run():174 java.security.AccessController.doPrivileged():-2 javax.security.auth.Subject.doAs():422 org.apache.hadoop.security.UserGroupInformation.doAs():1807 com.dremio.sabot.op.scan.ScanOperator.setupReaderAsCorrectUser():174 com.dremio.sabot.op.scan.ScanOperator.setupReader():166 com.dremio.sabot.op.scan.ScanOperator.setup():147 com.dremio.sabot.driver.SmartOp$SmartProducer.setup():552 com.dremio.sabot.driver.Pipe$SetupVisitor.visitProducer():79 com.dremio.sabot.driver.Pipe$SetupVisitor.visitProducer():63 com.dremio.sabot.driver.SmartOp$SmartProducer.accept():522 com.dremio.sabot.driver.StraightPipe.setup():102 com.dremio.sabot.driver.StraightPipe.setup():102 com.dremio.sabot.driver.StraightPipe.setup():102 com.dremio.sabot.driver.StraightPipe.setup():102 com.dremio.sabot.driver.StraightPipe.setup():102 com.dremio.sabot.driver.StraightPipe.setup():102 com.dremio.sabot.driver.Pipeline.setup():58 com.dremio.sabot.exec.fragment.FragmentExecutor.setupExecution():331 com.dremio.sabot.exec.fragment.FragmentExecutor.run():227 com.dremio.sabot.exec.fragment.FragmentExecutor.access$800():83 com.dremio.sabot.exec.fragment.FragmentExecutor$AsyncTaskImpl.run():577 com.dremio.sabot.task.AsyncTaskWrapper.run():92 com.dremio.sabot.task.slicing.SlicingThread.run():71 Caused By (java.sql.SQLException) Could not send query: Broken pipe (Write failed) org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.handleIoException():1472 org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.executeQuery():169 org.mariadb.jdbc.MariaDbStatement.executeInternal():316 org.mariadb.jdbc.MariaDbStatement.executeQuery():492 com.dremio.exec.store.jdbc.JdbcRecordReader.setup():171 com.dremio.exec.store.CoercionReader.setup():109 com.dremio.sabot.op.scan.ScanOperator$1.run():178 com.dremio.sabot.op.scan.ScanOperator$1.run():174 java.security.AccessController.doPrivileged():-2 javax.security.auth.Subject.doAs():422 org.apache.hadoop.security.UserGroupInformation.doAs():1807 com.dremio.sabot.op.scan.ScanOperator.setupReaderAsCorrectUser():174 com.dremio.sabot.op.scan.ScanOperator.setupReader():166 com.dremio.sabot.op.scan.ScanOperator.setup():147 com.dremio.sabot.driver.SmartOp$SmartProducer.setup():552 com.dremio.sabot.driver.Pipe$SetupVisitor.visitProducer():79 com.dremio.sabot.driver.Pipe$SetupVisitor.visitProducer():63 com.dremio.sabot.driver.SmartOp$SmartProducer.accept():522 com.dremio.sabot.driver.StraightPipe.setup():102 com.dremio.sabot.driver.StraightPipe.setup():102 com.dremio.sabot.driver.StraightPipe.setup():102 com.dremio.sabot.driver.StraightPipe.setup():102 com.dremio.sabot.driver.StraightPipe.setup():102 com.dremio.sabot.driver.StraightPipe.setup():102 com.dremio.sabot.driver.Pipeline.setup():58 com.dremio.sabot.exec.fragment.FragmentExecutor.setupExecution():331 com.dremio.sabot.exec.fragment.FragmentExecutor.run():227 com.dremio.sabot.exec.fragment.FragmentExecutor.access$800():83 com.dremio.sabot.exec.fragment.FragmentExecutor$AsyncTaskImpl.run():577 com.dremio.sabot.task.AsyncTaskWrapper.run():92 com.dremio.sabot.task.slicing.SlicingThread.run():71 Caused By (java.net.SocketException) Broken pipe (Write failed) java.net.SocketOutputStream.socketWrite0():-2 java.net.SocketOutputStream.socketWrite():109 java.net.SocketOutputStream.write():153 org.mariadb.jdbc.internal.io.output.StandardPacketOutputStream.flushBuffer():103 org.mariadb.jdbc.internal.io.output.AbstractPacketOutputStream.flush():157 org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.executeQuery():163 org.mariadb.jdbc.MariaDbStatement.executeInternal():316 org.mariadb.jdbc.MariaDbStatement.executeQuery():492 com.dremio.exec.store.jdbc.JdbcRecordReader.setup():171 com.dremio.exec.store.CoercionReader.setup():109 com.dremio.sabot.op.scan.ScanOperator$1.run():178 com.dremio.sabot.op.scan.ScanOperator$1.run():174 java.security.AccessController.doPrivileged():-2 javax.security.auth.Subject.doAs():422 org.apache.hadoop.security.UserGroupInformation.doAs():1807 com.dremio.sabot.op.scan.ScanOperator.setupReaderAsCorrectUser():174 com.dremio.sabot.op.scan.ScanOperator.setupReader():166 com.dremio.sabot.op.scan.ScanOperator.setup():147 com.dremio.sabot.driver.SmartOp$SmartProducer.setup():552 com.dremio.sabot.driver.Pipe$SetupVisitor.visitProducer():79 com.dremio.sabot.driver.Pipe$SetupVisitor.visitProducer():63 com.dremio.sabot.driver.SmartOp$SmartProducer.accept():522 com.dremio.sabot.driver.StraightPipe.setup():102 com.dremio.sabot.driver.StraightPipe.setup():102 com.dremio.sabot.driver.StraightPipe.setup():102 com.dremio.sabot.driver.StraightPipe.setup():102 com.dremio.sabot.driver.StraightPipe.setup():102 com.dremio.sabot.driver.StraightPipe.setup():102 com.dremio.sabot.driver.Pipeline.setup():58 com.dremio.sabot.exec.fragment.FragmentExecutor.setupExecution():331 com.dremio.sabot.exec.fragment.FragmentExecutor.run():227 com.dremio.sabot.exec.fragment.FragmentExecutor.access$800():83 com.dremio.sabot.exec.fragment.FragmentExecutor$AsyncTaskImpl.run():577 com.dremio.sabot.task.AsyncTaskWrapper.run():92 com.dremio.sabot.task.slicing.SlicingThread.run():71

Hi @JoyJava,

 Is this exception consistent, even if you try to reconnect to MySQL? Meanwhile you please attach the server log, server.out and the profile of the failed job 

share-query-profile

Dremio log files

Thanks,
@dbrody


i found it in server.out

We use the dremio community version, which we how to upload profile document?

thx

Hi @JoyJava,

The error is coming from the MariaDB JDBC driver that Dremio is using to connect to MySQL. A broken pipe error usually means the backend terminated the connection.

Are you able to run this query with with a standalone JDBC tool such as SQuirreL or DBVisualizer? Does it work with both the MariaDB JDBC driver and the MySQL driver?

In dremio the second execution of this sql able to get the correct results

Other tools are able to execute correctly

Hi @JoyJava,

You can find how to upload SQL profiles using this link:

Like @jduong said, most likely the error is pertaining to DB has terminated the DBsession.

Thanks,
@dbrody

Any solution on this error? I have similar errors

Hi @HLNA, Your stack seems to be slightly different from @JoyJava’s error stack. As we had replied in your other thread your stack is a known issue and will keep you updated in the fix.

@JoyJava

If the error is still happening, can you please share the query profile?

How To Share A Query Profile

Thanks,
@balaji.ramaswamy

Hi @balaji.ramaswamy … Sure,thanks. will wait. Meanwhile, is it possible to replace mariadb with mysql jar? or when will that support be available?