Error"java.io.IOException: Bad response message header with invalid message length of 6600541 bytes"

Connectivity
Tourist

Error"java.io.IOException: Bad response message header with invalid message length of 6600541 bytes"

Hi Team, 

 

I am receiving the following error when I read all the records of a teradata table using jdbc driver: 


2017-12-08.12:33:15.117 TERAJDBC4 ERROR [main] com.teradata.jdbc.jdk6.JDK6_SQL_Connection@b97c004 Read message 1 failed; closing socket due to: java.io.IOException: Bad response message header with invalid message length of 6600541 bytes 
2017-12-08.12:33:15.132 TERAJDBC4 ERROR [main] com.teradata.jdbc.jdk6.JDK6_SQL_Connection@b97c004 Packet receive Fri Dec 08 12:33:15 CET 2017 socket orig=tera16 local=0.0.0.0/0.0.0.0:57179 remote=tera16cop9:1025 keepalive=unavailable nodelay=unavailable receive=unavailable send=unavailable linger=unavailable traffic=unavailable concurrent=3 contimeout=10000 conwait=1000 connecttime=16 connecttotaltime=16 connectattempts=1 connectfailures=0 reconnectattempts=0 recoverable=false redrive=false failurecache={} cid=1d082e88 sess=246344 java.io.IOException: Bad response message header with invalid message length of 6600541 bytes at com.teradata.jdbc.jdbc_4.io.TDNetworkIOIF.read(TDNetworkIOIF.java:768) at com.teradata.jdbc.jdbc_4.io.TDPacketStream.readStream(TDPacketStream.java:768) at com.teradata.jdbc.jdbc_4.statemachine.StatementReceiveState.action(StatementReceiveState.java:141) at com.teradata.jdbc.jdbc_4.statemachine.StatementController.runBody(StatementController.java:137) at com.teradata.jdbc.jdbc_4.statemachine.StatementController.run(StatementController.java:128) at com.teradata.jdbc.jdbc_4.TDStatement.executeStatement(TDStatement.java:387) at com.teradata.jdbc.jdbc_4.TDStatement.executeStatement(TDStatement.java:329) at com.teradata.jdbc.jdbc_4.TDStatement.doNonPrepExecuteQuery(TDStatement.java:317) at com.teradata.jdbc.jdbc_4.TDStatement.executeQuery(TDStatement.java:1106) at extractsid.test_lecture_0_1.test_lecture.tTeradataInput_1Process(test_lecture.java:865) at extractsid.test_lecture_0_1.test_lecture.tTeradataConnection_1Process(test_lecture.java:474) at extractsid.test_lecture_0_1.test_lecture.runJobInTOS(test_lecture.java:1455) at extractsid.test_lecture_0_1.test_lecture.main(test_lecture.java:1289) 
Exception in component tTeradataInput_1 
java.sql.SQLException: [Teradata JDBC Driver] [TeraJDBC 15.10.00.14] [Error 804] [SQLState 08S01] Socket communication failure for Packet receive Fri Dec 08 12:33:15 CET 2017 socket orig=tera16 local=0.0.0.0/0.0.0.0:57179 remote=tera16cop9:1025 keepalive=unavailable nodelay=unavailable receive=unavailable send=unavailable linger=unavailable traffic=unavailable concurrent=3 contimeout=10000 conwait=1000 connecttime=16 connecttotaltime=16 connectattempts=1 connectfailures=0 reconnectattempts=0 recoverable=false redrive=false failurecache={} cid=1d082e88 sess=246344 java.io.IOException: Bad response message header with invalid message length of 6600541 bytes at com.teradata.jdbc.jdbc_4.io.TDNetworkIOIF.read(TDNetworkIOIF.java:768) at com.teradata.jdbc.jdbc_4.io.TDPacketStream.readStream(TDPacketStream.java:768) at com.teradata.jdbc.jdbc_4.statemachine.StatementReceiveState.action(StatementReceiveState.java:141) at com.teradata.jdbc.jdbc_4.statemachine.StatementController.runBody(StatementController.java:137) at com.teradata.jdbc.jdbc_4.statemachine.StatementController.run(StatementController.java:128) at com.teradata.jdbc.jdbc_4.TDStatement.executeStatement(TDStatement.java:387) at com.teradata.jdbc.jdbc_4.TDStatement.executeStatement(TDStatement.java:329) at com.teradata.jdbc.jdbc_4.TDStatement.doNonPrepExecuteQuery(TDStatement.java:317) at com.teradata.jdbc.jdbc_4.TDStatement.executeQuery(TDStatement.java:1106) at extractsid.test_lecture_0_1.test_lecture.tTeradataInput_1Process(test_lecture.java:865) at extractsid.test_lecture_0_1.test_lecture.tTeradataConnection_1Process(test_lecture.java:474) at extractsid.test_lecture_0_1.test_lecture.runJobInTOS(test_lecture.java:1455) at extractsid.test_lecture_0_1.test_lecture.main(test_lecture.java:1289) 
[FATAL]: extractsid.test_lecture_0_1.test_lecture - tTeradataInput_1 [Teradata JDBC Driver] [TeraJDBC 15.10.00.14] [Error 804] [SQLState 08S01] Socket communication failure for Packet receive Fri Dec 08 12:33:15 CET 2017 socket orig=tera16 local=0.0.0.0/0.0.0.0:57179 remote=tera16cop9:1025 keepalive=unavailable nodelay=unavailable receive=unavailable send=unavailable linger=unavailable traffic=unavailable concurrent=3 contimeout=10000 conwait=1000 connecttime=16 connecttotaltime=16 connectattempts=1 connectfailures=0 reconnectattempts=0 recoverable=false redrive=false failurecache={} cid=1d082e88 sess=246344 java.io.IOException: Bad response message header with invalid message length of 6600541 bytes at com.teradata.jdbc.jdbc_4.io.TDNetworkIOIF.read(TDNetworkIOIF.java:768) at com.teradata.jdbc.jdbc_4.io.TDPacketStream.readStream(TDPacketStream.java:768) at com.teradata.jdbc.jdbc_4.statemachine.StatementReceiveState.action(StatementReceiveState.java:141) at com.teradata.jdbc.jdbc_4.statemachine.StatementController.runBody(StatementController.java:137) at com.teradata.jdbc.jdbc_4.statemachine.StatementController.run(StatementController.java:128) at com.teradata.jdbc.jdbc_4.TDStatement.executeStatement(TDStatement.java:387) at com.teradata.jdbc.jdbc_4.TDStatement.executeStatement(TDStatement.java:329) at com.teradata.jdbc.jdbc_4.TDStatement.doNonPrepExecuteQuery(TDStatement.java:317) at com.teradata.jdbc.jdbc_4.TDStatement.executeQuery(TDStatement.java:1106) at extractsid.test_lecture_0_1.test_lecture.tTeradataInput_1Process(test_lecture.java:865) at extractsid.test_lecture_0_1.test_lecture.tTeradataConnection_1Process(test_lecture.java:474) at extractsid.test_lecture_0_1.test_lecture.runJobInTOS(test_lecture.java:1455) at extractsid.test_lecture_0_1.test_lecture.main(test_lecture.java:1289) 
at com.teradata.jdbc.jdbc_4.util.ErrorFactory.makeDriverJDBCException(ErrorFactory.java:94) 
at com.teradata.jdbc.jdbc_4.util.ErrorFactory.makeDriverJDBCException(ErrorFactory.java:69) 
at com.teradata.jdbc.jdbc_4.util.ErrorFactory.makeIoJDBCException(ErrorFactory.java:207) 
at com.teradata.jdbc.jdbc_4.util.ErrorAnalyzer.analyzeIoError(ErrorAnalyzer.java:59) 
at com.teradata.jdbc.jdbc_4.io.TDNetworkIOIF.read(TDNetworkIOIF.java:919) 
at com.teradata.jdbc.jdbc_4.io.TDPacketStream.readStream(TDPacketStream.java:768) 
at com.teradata.jdbc.jdbc_4.statemachine.StatementReceiveState.action(StatementReceiveState.java:141) 
at com.teradata.jdbc.jdbc_4.statemachine.StatementController.runBody(StatementController.java:137) 
at com.teradata.jdbc.jdbc_4.statemachine.StatementController.run(StatementController.java:128) 
at com.teradata.jdbc.jdbc_4.TDStatement.executeStatement(TDStatement.java:387) 
at com.teradata.jdbc.jdbc_4.TDStatement.executeStatement(TDStatement.java:329) 
at com.teradata.jdbc.jdbc_4.TDStatement.doNonPrepExecuteQuery(TDStatement.java:317) 
[statistics] disconnected 
at com.teradata.jdbc.jdbc_4.TDStatement.executeQuery(TDStatement.java:1106) 
at extractsid.test_lecture_0_1.test_lecture.tTeradataInput_1Process(test_lecture.java:865) 
at extractsid.test_lecture_0_1.test_lecture.tTeradataConnection_1Process(test_lecture.java:474) 
at extractsid.test_lecture_0_1.test_lecture.runJobInTOS(test_lecture.java:1455) 
at extractsid.test_lecture_0_1.test_lecture.main(test_lecture.java:1289) 
Caused by: java.io.IOException: Bad response message header with invalid message length of 6600541 bytes 
at com.teradata.jdbc.jdbc_4.io.TDNetworkIOIF.read(TDNetworkIOIF.java:768) 
... 12 more 

 

 

This issue is not seen if I access only a few records using a where clause. Your inputs are appriciated.  

 

Thanks in advance. 

 

Regards,

Karthick

8 REPLIES 8
Teradata Employee

Re: Error"java.io.IOException: Bad response message header with invalid message length of 66005

You are using an old version of the Teradata JDBC Driver that is not compatible with Teradata Database 16.0 or later.

 

This problem is discussed in Teradata Tech Alert NTA 4223.

 

The solution is to upgrade to a newer version of the Teradata JDBC Driver. Please upgrade to one of the Teradata JDBC Driver versions currently available for download: http://downloads.teradata.com/download/connectivity/jdbc-driver

Highlighted

Re: Error"java.io.IOException: Bad response message header with invalid message length of 66005

Hi,

 

I am facing the same error and using the latest version of the jdbc jar i.e. 16.20.00.12. I am facing this error while extracting from Teradata using spark sql

Teradata Employee

Re: Error"java.io.IOException: Bad response message header with invalid message length of 66005


@abhijeettyagi wrote:

I am facing the same error and using the latest version of the jdbc jar i.e. 16.20.00.12. I am facing this error while extracting from Teradata using spark sql


Are you sure that you are actually using Teradata JDBC Driver 16.20.00.12 ?

 

Please post the complete stack trace of the exception that you got. The stack trace includes the Teradata JDBC Driver version number in the exception message.

Re: Error"java.io.IOException: Bad response message header with invalid message length of 66005

Yes, I am positive I am using the latest jar file 16.20.00.12 with the following command:

spark-shell --master yarn --executor-memory 3G --executor-cores 3 --num-executors 10 --driver-memory 4G --queue <queue-name> --jars /path/terajdbc4.jar /path/crm.jar and this is the detailed error:

19/07/22 09:06:25 ERROR TaskSetManager: Task 0 in stage 42.0 failed 4 times; aborting job
19/07/22 09:06:25 ERROR FileFormatWriter: Aborting job null.
org.apache.spark.SparkException: Job aborted due to stage failure: Task 0 in stage 42.0 failed 4 times, most recent failure: Lost task 0.3 in stage 42.0 (TID 45, dbslp0805.uhc.com, executor 3): com.teradata.jdbc.jdbc_4.util.JDBCException: [Teradata JDBC Driver] [TeraJDBC 14.10.00.26] [Error 804] [SQLState 08S01] Socket communication failure for Packet receive Mon Jul 22 09:06:22 CDT 2019 socket orig=udwprod.uhc.com local=0.0.0.0/0.0.0.0:55610 remote=udwprodcop4.uhc.com/10.176.20.33:1025 keepalive=unavailable nodelay=unavailable receive=unavailable send=unavailable linger=unavailable traffic=unavailable concurrent=3 contimeout=10000 conwait=1000 connecttime=2 connecttotaltime=4 connectattempts=2 connectfailures=1 reconnectattempts=0 recoverable=false redrive=false failurecache={udwprodcop18.uhc.com/10.176.20.47:1025=Mon Jul 22 09:05:45 CDT 2019, udwprodcop3.uhc.com/10.176.20.32:1025=Mon Jul 22 09:06:21 CDT 2019, udwprodcop9.uhc.com/10.176.20.38:1025=Mon Jul 22 09:03:19 CDT 2019, udwprodcop12.uhc.com/10.176.20.41:1025=Mon Jul 22 09:03:46 CDT 2019, udwprodcop15.uhc.com/10.176.20.44:1025=Mon Jul 22 09:04:57 CDT 2019} cid=43fac750 sess=1295346 java.io.IOException: Bad response message header with invalid message length of 6000372 bytes at com.teradata.jdbc.jdbc_4.io.TDNetworkIOIF.read(TDNetworkIOIF.java:732) at com.teradata.jdbc.jdbc_4.io.TDPacketStream.readStream(TDPacketStream.java:774) at com.teradata.jdbc.jdbc_4.statemachine.StatementReceiveState.action(StatementReceiveState.java:145) at com.teradata.jdbc.jdbc_4.statemachine.StatementController.runBody(StatementController.java:123) at com.teradata.jdbc.jdbc_4.statemachine.PreparedStatementController.run(PreparedStatementController.java:49) at com.teradata.jdbc.jdbc_4.TDStatement.executeStatement(TDStatement.java:384) at com.teradata.jdbc.jdbc_4.TDStatement.executeStatement(TDStatement.java:326) at com.teradata.jdbc.jdbc_4.TDPreparedStatement.doPrepExecuteQuery(TDPreparedStatement.java:187) at com.teradata.jdbc.jdbc_4.TDPreparedStatement.executeQuery(TDPreparedStatement.java:2458) at org.apache.spark.sql.execution.datasources.jdbc.JDBCRDD.compute(JDBCRDD.scala:301) at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:323) at org.apache.spark.rdd.RDD.iterator(RDD.scala:287) at org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:38) at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:323) at org.apache.spark.rdd.RDD.iterator(RDD.scala:287) at org.apache.spark.scheduler.ResultTask.runTask(ResultTask.scala:87) at org.apache.spark.scheduler.Task.run(Task.scala:108) at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:338) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)
at com.teradata.jdbc.jdbc_4.util.ErrorFactory.makeDriverJDBCException(ErrorFactory.java:93)
at com.teradata.jdbc.jdbc_4.util.ErrorFactory.makeDriverJDBCException(ErrorFactory.java:68)
at com.teradata.jdbc.jdbc_4.util.ErrorFactory.makeIoJDBCException(ErrorFactory.java:206)
at com.teradata.jdbc.jdbc_4.util.ErrorAnalyzer.analyzeIoError(ErrorAnalyzer.java:61)
at com.teradata.jdbc.jdbc_4.io.TDNetworkIOIF.read(TDNetworkIOIF.java:881)
at com.teradata.jdbc.jdbc_4.io.TDPacketStream.readStream(TDPacketStream.java:774)
at com.teradata.jdbc.jdbc_4.statemachine.StatementReceiveState.action(StatementReceiveState.java:145)
at com.teradata.jdbc.jdbc_4.statemachine.StatementController.runBody(StatementController.java:123)
at com.teradata.jdbc.jdbc_4.statemachine.PreparedStatementController.run(PreparedStatementController.java:49)
at com.teradata.jdbc.jdbc_4.TDStatement.executeStatement(TDStatement.java:384)
at com.teradata.jdbc.jdbc_4.TDStatement.executeStatement(TDStatement.java:326)
at com.teradata.jdbc.jdbc_4.TDPreparedStatement.doPrepExecuteQuery(TDPreparedStatement.java:187)
at com.teradata.jdbc.jdbc_4.TDPreparedStatement.executeQuery(TDPreparedStatement.java:2458)
at org.apache.spark.sql.execution.datasources.jdbc.JDBCRDD.compute(JDBCRDD.scala:301)
at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:323)
at org.apache.spark.rdd.RDD.iterator(RDD.scala:287)
at org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:38)
at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:323)
at org.apache.spark.rdd.RDD.iterator(RDD.scala:287)
at org.apache.spark.scheduler.ResultTask.runTask(ResultTask.scala:87)
at org.apache.spark.scheduler.Task.run(Task.scala:108)
at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:338)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.io.IOException: Bad response message header with invalid message length of 6000372 bytes
at com.teradata.jdbc.jdbc_4.io.TDNetworkIOIF.read(TDNetworkIOIF.java:732)
... 20 more

Driver stacktrace:
at org.apache.spark.scheduler.DAGScheduler.org$apache$spark$scheduler$DAGScheduler$$failJobAndIndependentStages(DAGScheduler.scala:1517)
at org.apache.spark.scheduler.DAGScheduler$$anonfun$abortStage$1.apply(DAGScheduler.scala:1505)
at org.apache.spark.scheduler.DAGScheduler$$anonfun$abortStage$1.apply(DAGScheduler.scala:1504)
at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59)
at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:48)
at org.apache.spark.scheduler.DAGScheduler.abortStage(DAGScheduler.scala:1504)
at org.apache.spark.scheduler.DAGScheduler$$anonfun$handleTaskSetFailed$1.apply(DAGScheduler.scala:814)
at org.apache.spark.scheduler.DAGScheduler$$anonfun$handleTaskSetFailed$1.apply(DAGScheduler.scala:814)
at scala.Option.foreach(Option.scala:257)
at org.apache.spark.scheduler.DAGScheduler.handleTaskSetFailed(DAGScheduler.scala:814)
at org.apache.spark.scheduler.DAGSchedulerEventProcessLoop.doOnReceive(DAGScheduler.scala:1732)
at org.apache.spark.scheduler.DAGSchedulerEventProcessLoop.onReceive(DAGScheduler.scala:1687)
at org.apache.spark.scheduler.DAGSchedulerEventProcessLoop.onReceive(DAGScheduler.scala:1676)
at org.apache.spark.util.EventLoop$$anon$1.run(EventLoop.scala:48)
at org.apache.spark.scheduler.DAGScheduler.runJob(DAGScheduler.scala:630)
at org.apache.spark.SparkContext.runJob(SparkContext.scala:2029)
at org.apache.spark.sql.execution.datasources.FileFormatWriter$$anonfun$write$1.apply$mcV$sp(FileFormatWriter.scala:186)
at org.apache.spark.sql.execution.datasources.FileFormatWriter$$anonfun$write$1.apply(FileFormatWriter.scala:166)
at org.apache.spark.sql.execution.datasources.FileFormatWriter$$anonfun$write$1.apply(FileFormatWriter.scala:166)
at org.apache.spark.sql.execution.SQLExecution$.withNewExecutionId(SQLExecution.scala:65)
at org.apache.spark.sql.execution.datasources.FileFormatWriter$.write(FileFormatWriter.scala:166)
at org.apache.spark.sql.execution.datasources.InsertIntoHadoopFsRelationCommand.run(InsertIntoHadoopFsRelationCommand.scala:145)
at org.apache.spark.sql.execution.command.ExecutedCommandExec.sideEffectResult$lzycompute(commands.scala:58)
at org.apache.spark.sql.execution.command.ExecutedCommandExec.sideEffectResult(commands.scala:56)
at org.apache.spark.sql.execution.command.ExecutedCommandExec.doExecute(commands.scala:74)
at org.apache.spark.sql.execution.SparkPlan$$anonfun$execute$1.apply(SparkPlan.scala:117)
at org.apache.spark.sql.execution.SparkPlan$$anonfun$execute$1.apply(SparkPlan.scala:117)
at org.apache.spark.sql.execution.SparkPlan$$anonfun$executeQuery$1.apply(SparkPlan.scala:138)
at org.apache.spark.rdd.RDDOperationScope$.withScope(RDDOperationScope.scala:151)
at org.apache.spark.sql.execution.SparkPlan.executeQuery(SparkPlan.scala:135)
at org.apache.spark.sql.execution.SparkPlan.execute(SparkPlan.scala:116)
at org.apache.spark.sql.execution.QueryExecution.toRdd$lzycompute(QueryExecution.scala:92)
at org.apache.spark.sql.execution.QueryExecution.toRdd(QueryExecution.scala:92)
at org.apache.spark.sql.execution.datasources.DataSource.writeInFileFormat(DataSource.scala:435)
at org.apache.spark.sql.execution.datasources.DataSource.writeAndRead(DataSource.scala:451)
at org.apache.spark.sql.execution.command.CreateDataSourceTableAsSelectCommand.saveDataIntoTable(createDataSourceTables.scala:217)
at org.apache.spark.sql.execution.command.CreateDataSourceTableAsSelectCommand.run(createDataSourceTables.scala:177)
at org.apache.spark.sql.execution.command.ExecutedCommandExec.sideEffectResult$lzycompute(commands.scala:58)
at org.apache.spark.sql.execution.command.ExecutedCommandExec.sideEffectResult(commands.scala:56)
at org.apache.spark.sql.execution.command.ExecutedCommandExec.doExecute(commands.scala:74)
at org.apache.spark.sql.execution.SparkPlan$$anonfun$execute$1.apply(SparkPlan.scala:117)
at org.apache.spark.sql.execution.SparkPlan$$anonfun$execute$1.apply(SparkPlan.scala:117)
at org.apache.spark.sql.execution.SparkPlan$$anonfun$executeQuery$1.apply(SparkPlan.scala:138)
at org.apache.spark.rdd.RDDOperationScope$.withScope(RDDOperationScope.scala:151)
at org.apache.spark.sql.execution.SparkPlan.executeQuery(SparkPlan.scala:135)
at org.apache.spark.sql.execution.SparkPlan.execute(SparkPlan.scala:116)
at org.apache.spark.sql.execution.QueryExecution.toRdd$lzycompute(QueryExecution.scala:92)
at org.apache.spark.sql.execution.QueryExecution.toRdd(QueryExecution.scala:92)
at org.apache.spark.sql.DataFrameWriter.runCommand(DataFrameWriter.scala:609)
at org.apache.spark.sql.DataFrameWriter.createTable(DataFrameWriter.scala:419)
at org.apache.spark.sql.DataFrameWriter.saveAsTable(DataFrameWriter.scala:398)
at org.apache.spark.sql.DataFrameWriter.saveAsTable(DataFrameWriter.scala:354)
at com.crm.refresh$$anonfun$main$1.apply(refresh.scala:33)
at com.crm.refresh$$anonfun$main$1.apply(refresh.scala:16)
at scala.collection.immutable.List.foreach(List.scala:381)
at com.crm.refresh$.main(refresh.scala:16)
at com.crm.refresh.main(refresh.scala)
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 org.apache.spark.deploy.SparkSubmit$.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:780)
at org.apache.spark.deploy.SparkSubmit$.doRunMain$1(SparkSubmit.scala:180)
at org.apache.spark.deploy.SparkSubmit$.submit(SparkSubmit.scala:205)
at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:119)
at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)
Caused by: com.teradata.jdbc.jdbc_4.util.JDBCException: [Teradata JDBC Driver] [TeraJDBC 14.10.00.26] [Error 804] [SQLState 08S01] Socket communication failure for Packet receive Mon Jul 22 09:06:22 CDT 2019 socket orig=udwprod.uhc.com local=0.0.0.0/0.0.0.0:55610 remote=udwprodcop4.uhc.com/10.176.20.33:1025 keepalive=unavailable nodelay=unavailable receive=unavailable send=unavailable linger=unavailable traffic=unavailable concurrent=3 contimeout=10000 conwait=1000 connecttime=2 connecttotaltime=4 connectattempts=2 connectfailures=1 reconnectattempts=0 recoverable=false redrive=false failurecache={udwprodcop18.uhc.com/10.176.20.47:1025=Mon Jul 22 09:05:45 CDT 2019, udwprodcop3.uhc.com/10.176.20.32:1025=Mon Jul 22 09:06:21 CDT 2019, udwprodcop9.uhc.com/10.176.20.38:1025=Mon Jul 22 09:03:19 CDT 2019, udwprodcop12.uhc.com/10.176.20.41:1025=Mon Jul 22 09:03:46 CDT 2019, udwprodcop15.uhc.com/10.176.20.44:1025=Mon Jul 22 09:04:57 CDT 2019} cid=43fac750 sess=1295346 java.io.IOException: Bad response message header with invalid message length of 6000372 bytes at com.teradata.jdbc.jdbc_4.io.TDNetworkIOIF.read(TDNetworkIOIF.java:732) at com.teradata.jdbc.jdbc_4.io.TDPacketStream.readStream(TDPacketStream.java:774) at com.teradata.jdbc.jdbc_4.statemachine.StatementReceiveState.action(StatementReceiveState.java:145) at com.teradata.jdbc.jdbc_4.statemachine.StatementController.runBody(StatementController.java:123) at com.teradata.jdbc.jdbc_4.statemachine.PreparedStatementController.run(PreparedStatementController.java:49) at com.teradata.jdbc.jdbc_4.TDStatement.executeStatement(TDStatement.java:384) at com.teradata.jdbc.jdbc_4.TDStatement.executeStatement(TDStatement.java:326) at com.teradata.jdbc.jdbc_4.TDPreparedStatement.doPrepExecuteQuery(TDPreparedStatement.java:187) at com.teradata.jdbc.jdbc_4.TDPreparedStatement.executeQuery(TDPreparedStatement.java:2458) at org.apache.spark.sql.execution.datasources.jdbc.JDBCRDD.compute(JDBCRDD.scala:301) at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:323) at org.apache.spark.rdd.RDD.iterator(RDD.scala:287) at org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:38) at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:323) at org.apache.spark.rdd.RDD.iterator(RDD.scala:287) at org.apache.spark.scheduler.ResultTask.runTask(ResultTask.scala:87) at org.apache.spark.scheduler.Task.run(Task.scala:108) at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:338) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)
at com.teradata.jdbc.jdbc_4.util.ErrorFactory.makeDriverJDBCException(ErrorFactory.java:93)
at com.teradata.jdbc.jdbc_4.util.ErrorFactory.makeDriverJDBCException(ErrorFactory.java:68)
at com.teradata.jdbc.jdbc_4.util.ErrorFactory.makeIoJDBCException(ErrorFactory.java:206)
at com.teradata.jdbc.jdbc_4.util.ErrorAnalyzer.analyzeIoError(ErrorAnalyzer.java:61)
at com.teradata.jdbc.jdbc_4.io.TDNetworkIOIF.read(TDNetworkIOIF.java:881)
at com.teradata.jdbc.jdbc_4.io.TDPacketStream.readStream(TDPacketStream.java:774)
at com.teradata.jdbc.jdbc_4.statemachine.StatementReceiveState.action(StatementReceiveState.java:145)
at com.teradata.jdbc.jdbc_4.statemachine.StatementController.runBody(StatementController.java:123)
at com.teradata.jdbc.jdbc_4.statemachine.PreparedStatementController.run(PreparedStatementController.java:49)
at com.teradata.jdbc.jdbc_4.TDStatement.executeStatement(TDStatement.java:384)
at com.teradata.jdbc.jdbc_4.TDStatement.executeStatement(TDStatement.java:326)
at com.teradata.jdbc.jdbc_4.TDPreparedStatement.doPrepExecuteQuery(TDPreparedStatement.java:187)
at com.teradata.jdbc.jdbc_4.TDPreparedStatement.executeQuery(TDPreparedStatement.java:2458)
at org.apache.spark.sql.execution.datasources.jdbc.JDBCRDD.compute(JDBCRDD.scala:301)
at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:323)
at org.apache.spark.rdd.RDD.iterator(RDD.scala:287)
at org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:38)
at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:323)
at org.apache.spark.rdd.RDD.iterator(RDD.scala:287)
at org.apache.spark.scheduler.ResultTask.runTask(ResultTask.scala:87)
at org.apache.spark.scheduler.Task.run(Task.scala:108)
at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:338)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.io.IOException: Bad response message header with invalid message length of 6000372 bytes
at com.teradata.jdbc.jdbc_4.io.TDNetworkIOIF.read(TDNetworkIOIF.java:732)
... 20 more

Teradata Employee

Re: Error"java.io.IOException: Bad response message header with invalid message length of 66005


@abhijeettyagi wrote:

Yes, I am positive I am using the latest jar file 16.20.00.12

JDBCException: [Teradata JDBC Driver] [TeraJDBC 14.10.00.26] [Error 804] [SQLState 08S01] Socket communication failure


Sorry, No, you are not using Teradata JDBC Driver 16.20.00.12.

The exception message that you are getting clearly shows that you are using Teradata JDBC Driver 14.10.00.26.

You must have an older version of the JDBC Driver on your classpath.

Re: Error"java.io.IOException: Bad response message header with invalid message length of 66005

Thanks a lot Tom for catching this. I am new to Teradata and spark. I think I am passing the right jar file. What other options do I need to pass so that the right class is picked up?


@tomnolan wrote:

@abhijeettyagi wrote:

Yes, I am positive I am using the latest jar file 16.20.00.12

JDBCException: [Teradata JDBC Driver] [TeraJDBC 14.10.00.26] [Error 804] [SQLState 08S01] Socket communication failure


Sorry, No, you are not using Teradata JDBC Driver 16.20.00.12.

The exception message that you are getting clearly shows that you are using Teradata JDBC Driver 14.10.00.26.

You must have an older version of the JDBC Driver on your classpath.


 

Teradata Employee

Re: Error"java.io.IOException: Bad response message header with invalid message length of 66005

According to the Apache Spark documentation:

https://spark.apache.org/docs/1.3.1/sql-programming-guide.html#troubleshooting

 

> The JDBC driver class must be visible to the primordial class loader on the client session and on all executors.

> This is because Java’s DriverManager class does a security check that results in it ignoring all drivers not visible to the primordial class loader when one goes to open a connection.

> One convenient way to do this is to modify compute_classpath.sh on all worker nodes to include your driver JARs.

 

Re: Error"java.io.IOException: Bad response message header with invalid message length of 66005

Thanks a lot Tom. I will try to get the Teradata jdbc driver installed properly on the servers and then try again. Will get back if I have any questions.