Teradata JDBC Exception

Connectivity

Teradata JDBC Exception

Hi all, i am new to this forum. I need your help on a issue of a Java application which we are facing into production. The app is talking with teradata db (v 12) via JDBC api; It is working fine, but recently app is unable to talk with db in few instances. I have got below exception in catalina.out file. Appreciate if anyone can put light on the issue.

Exception:

INFO | jvm 1 | 2011/02/21 14:32:21 | 2011-02-21.14:32:21.306 TERAJDBC4 ERROR [pool-3-thread-2] com.teradata.jdbc.jdbc_4.TDSession@2ea70c Read message 1: Incomplete LAN message header: read 0 bytes

INFO | jvm 1 | 2011/02/21 14:32:21 | 2011-02-21.14:32:21.306 TERAJDBC4 ERROR [pool-3-thread-2] com.teradata.jdbc.jdbc_4.TDSession@2ea70c Read message 1 failed; closing socket due to: java.io.IOException: Incomplete LAN message header: read 0 bytes

INFO | jvm 1 | 2011/02/21 14:32:21 | 2011-02-21.14:32:21.307 TERAJDBC4 ERROR [pool-3-thread-2] com.teradata.jdbc.jdbc_4.TDSession@2ea70c Packet receive Mon Feb 21 14:32:21 EST 2011 socket local=0.0.0.0/0.0.0.0:54475 remote=edwprod1cop7.homedepot.com/165.130.159.12:1025 cid=d91b7d sess=20942713 java.io.IOException: Incomplete LAN message header: read 0 bytes at com.teradata.jdbc.jdbc_4.io.TDNetworkIOIF.read(TDNetworkIOIF.java:370) at com.teradata.jdbc.jdbc_4.io.TDPacketStream.readStream(TDPacketStream.java:818) at com.teradata.jdbc.jdbc_4.statemachine.StatementReceiveState.action(StatementReceiveState.java:124) at com.teradata.jdbc.jdbc_4.statemachine.StatementController.runBody(StatementController.java:108) at com.teradata.jdbc.jdbc_4.statemachine.StatementController.run(StatementController.java:99) at com.teradata.jdbc.jdbc_4.Statement.executeStatement(Statement.java:309) at com.teradata.jdbc.jdbc_4.Statement.executeStatement(Statement.java:254) at com.teradata.jdbc.jdbc_4.Statement.executeQuery(Statement.java:240) at com.teradata.jdbc.jdbc_3.ifjdbc_4.TeraLocalStatement.executeQuery(TeraLocalStatement.java:86) at com.teradata.jdbc.jdbc_3.ifjdbc_
Tags (1)
15 REPLIES
Teradata Employee

Re: Teradata JDBC Exception

Those error messages typically indicate that the Teradata JDBC Driver has lost its connection to the Teradata Database.

Common causes of connectivity problems, in order from most likely to less likely:
- Session was forcibly logged off by Teradata Manager, PMON, or some other kind of script that checks for inactivity
- Teradata Database restart
- Transient network failure
- Faulty network hardware
Teradata Employee

Re: Teradata JDBC Exception

Any solution found for this problem?

Or maybe the reason it happens for?

Thanks

Teradata Employee

Re: Teradata JDBC Exception

I did list the common reasons.

Re: Teradata JDBC Exception

We are also seeing this. Approximately 10 transactions in 60,000. Of the reasons listed:

1 Teradata Database restart

2 Transient network failure

3 Faulty network hardware

1 Is not the case since it was a performance test in the frist place and has never not happened during such.

2 and 3 seem unlikely since the net in question is designed for performance testing

What I would like to ask is if misconfigured connection pooling could cause this issue? If a pooled connection went bad and the system then tried to re-use that bad connection for example, could something like this happen?

What we've got going on is a Container (Tomcat) managed JNDI connection pool. Problem is that MyBatis also has it's own built-in connection pool that may not be playing well with our arrangement.  When the app first went in for performance testing it was discovered that we effectively had no pooling despite having set the configuration in Tomcat's JNDI configuration settings.  I have a new configuration that works according to our profiler but still hasn't been tested by the performance team.

Teradata Employee

Re: Teradata JDBC Exception

Some connection pool managers, but not all, have a feature to automatically test a connection by executing a simple query before the connection is provided to the application.

Enabling a feature like that will impact performance, but it can hide most communication failures from the application.

Enthusiast

Re: Teradata JDBC Exception

Hi all, I posted a while back about my TD connection issues.  I am on a mac platform runninf OS/X 10.8.2.  Sonce then, I had flawless connections to TD but I had to upgrade my machine and in-so doing, I also found out that SQLA Java Edition has been replaced by TD Studio Express.  I downloaded the version from this site and installed, however, I can't get any connection.  I get an unknown host error. 

com.teradata.jdbc.jdbc_4.util.JDBCException: [Teradata JDBC Driver] [TeraJDBC 14.00.00.21] [Error 1000] [SQLState 08S01] Login failure for Connection to EDWMKTG Thu Nov 29 10:49:47 PST 2012 socket orig=EDWMKTG cid=6af86f0e sess=0 java.net.UnknownHostException: EDWMKTG  at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)  at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:849)  at java.net.InetAddress.getAddressFromNameService(InetAddress.java:1202)  at java.net.InetAddress.getAllByName0(InetAddress.java:1153)  at java.net.InetAddress.getAllByName(InetAddress.java:1083)  at java.net.InetAddress.getAllByName(InetAddress.java:1019)  at com.teradata.jdbc.jdbc_4.io.TDNetworkIOIF$Lookup.<init>(TDNetworkIOIF.java:183)  at com.teradata.jdbc.jdbc_4.io.TDNetworkIOIF.connectToHost(TDNetworkIOIF.java:282)  at com.teradata.jdbc.jdbc_4.io.TDNetworkIOIF.createSocketConnection(TDNetworkIOIF.java:131)  at com.teradata.jdbc.jdbc_4.io.TDNetworkIOIF.<init>(TDNetworkIOIF.java:117)  at com.teradata.jdbc.jdbc_4.TDSession.getIO(TDSession.java:585)  at com.teradata.jdbc.jdbc.GenericLogonController.run(GenericLogonController.java:95)  at com.teradata.jdbc.jdbc_4.TDSession.<init>(TDSession.java:214)  at com.teradata.jdbc.jdk6.JDK6_SQL_Connection.<init>(JDK6_SQL_Connection.java:34)  at com.teradata.jdbc.jdk6.JDK6ConnectionFactory.constructConnection(JDK6ConnectionFactory.java:22)  at com.teradata.jdbc.jdbc.ConnectionFactory.createConnection(ConnectionFactory.java:130)  at com.teradata.jdbc.jdbc.ConnectionFactory.createConnection(ConnectionFactory.java:120)  at com.teradata.jdbc.TeraDriver.doConnect(TeraDriver.java:232)  at com.teradata.jdbc.TeraDriver.connect(TeraDriver.java:158)  at com.teradata.datatools.dtp.connectivity.db.teradata.TeradataJDBCConnection.makeConnection(TeradataJDBCConnection.java:293)  at com.teradata.datatools.dtp.connectivity.db.teradata.TeradataJDBCConnection.createConnection(TeradataJDBCConnection.java:121)  at org.eclipse.datatools.connectivity.DriverConnectionBase.internalCreateConnection(DriverConnectionBase.java:105)  at org.eclipse.datatools.connectivity.DriverConnectionBase.open(DriverConnectionBase.java:54)  at org.eclipse.datatools.connectivity.drivers.jdbc.JDBCConnection.open(JDBCConnection.java:73)  at com.teradata.datatools.dtp.connectivity.db.teradata.TeradataPingFactory.createConnection(TeradataPingFactory.java:36)  at org.eclipse.datatools.connectivity.internal.ConnectionFactoryProvider.createConnection(ConnectionFactoryProvider.java:83)  at org.eclipse.datatools.connectivity.internal.ConnectionProfile.createConnection(ConnectionProfile.java:359)  at org.eclipse.datatools.connectivity.ui.PingJob.createTestConnection(PingJob.java:76)  at org.eclipse.datatools.connectivity.ui.PingJob.run(PingJob.java:59)  at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) 

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.createSocketConnection(TDNetworkIOIF.java:138)

at com.teradata.jdbc.jdbc_4.io.TDNetworkIOIF.<init>(TDNetworkIOIF.java:117)

at com.teradata.jdbc.jdbc_4.TDSession.getIO(TDSession.java:585)

at com.teradata.jdbc.jdbc.GenericLogonController.run(GenericLogonController.java:95)

at com.teradata.jdbc.jdbc_4.TDSession.<init>(TDSession.java:214)

at com.teradata.jdbc.jdk6.JDK6_SQL_Connection.<init>(JDK6_SQL_Connection.java:34)

at com.teradata.jdbc.jdk6.JDK6ConnectionFactory.constructConnection(JDK6ConnectionFactory.java:22)

at com.teradata.jdbc.jdbc.ConnectionFactory.createConnection(ConnectionFactory.java:130)

at com.teradata.jdbc.jdbc.ConnectionFactory.createConnection(ConnectionFactory.java:120)

at com.teradata.jdbc.TeraDriver.doConnect(TeraDriver.java:232)

at com.teradata.jdbc.TeraDriver.connect(TeraDriver.java:158)

at com.teradata.datatools.dtp.connectivity.db.teradata.TeradataJDBCConnection.makeConnection(TeradataJDBCConnection.java:293)

at com.teradata.datatools.dtp.connectivity.db.teradata.TeradataJDBCConnection.createConnection(TeradataJDBCConnection.java:121)

at org.eclipse.datatools.connectivity.DriverConnectionBase.internalCreateConnection(DriverConnectionBase.java:105)

at org.eclipse.datatools.connectivity.DriverConnectionBase.open(DriverConnectionBase.java:54)

at org.eclipse.datatools.connectivity.drivers.jdbc.JDBCConnection.open(JDBCConnection.java:73)

at com.teradata.datatools.dtp.connectivity.db.teradata.TeradataPingFactory.createConnection(TeradataPingFactory.java:36)

at org.eclipse.datatools.connectivity.internal.ConnectionFactoryProvider.createConnection(ConnectionFactoryProvider.java:83)

at org.eclipse.datatools.connectivity.internal.ConnectionProfile.createConnection(ConnectionProfile.java:359)

at org.eclipse.datatools.connectivity.ui.PingJob.createTestConnection(PingJob.java:76)

at org.eclipse.datatools.connectivity.ui.PingJob.run(PingJob.java:59)

at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

Caused by: java.net.UnknownHostException: EDWMKTG

at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)

at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:849)

at java.net.InetAddress.getAddressFromNameService(InetAddress.java:1202)

at java.net.InetAddress.getAllByName0(InetAddress.java:1153)

at java.net.InetAddress.getAllByName(InetAddress.java:1083)

at java.net.InetAddress.getAllByName(InetAddress.java:1019)

at com.teradata.jdbc.jdbc_4.io.TDNetworkIOIF$Lookup.<init>(TDNetworkIOIF.java:183)

at com.teradata.jdbc.jdbc_4.io.TDNetworkIOIF.connectToHost(TDNetworkIOIF.java:282)

at com.teradata.jdbc.jdbc_4.io.TDNetworkIOIF.createSocketConnection(TDNetworkIOIF.java:131)

... 21 more

 While searching this forum, I noted a comment to use an ip address instead of the server name.  That too did not work; following is the error I received:

ava.lang.NullPointerException

at com.teradata.tdgss.jtdgss.TdgssConfigApi.GetMechanisms(Unknown Source)

at com.teradata.tdgss.jtdgss.TdgssManager.<init>(Unknown Source)

at com.teradata.tdgss.jtdgss.TdgssManager.getInstance(Unknown Source)

at com.teradata.jdbc.jdbc.GenericTeraEncrypt.getGSSM(GenericTeraEncrypt.java:623)

at com.teradata.jdbc.jdbc.GenericTeraEncrypt.getConfig(GenericTeraEncrypt.java:641)

at com.teradata.jdbc.jdbc.GenericTeraEncrypt.getUserNameForOid(GenericTeraEncrypt.java:734)

at com.teradata.jdbc.AuthMechanism.<init>(AuthMechanism.java:50)

at com.teradata.jdbc.jdbc.GenericLogonController.run(GenericLogonController.java:122)

at com.teradata.jdbc.jdbc_4.TDSession.<init>(TDSession.java:214)

at com.teradata.jdbc.jdk6.JDK6_SQL_Connection.<init>(JDK6_SQL_Connection.java:34)

at com.teradata.jdbc.jdk6.JDK6ConnectionFactory.constructConnection(JDK6ConnectionFactory.java:22)

at com.teradata.jdbc.jdbc.ConnectionFactory.createConnection(ConnectionFactory.java:130)

at com.teradata.jdbc.jdbc.ConnectionFactory.createConnection(ConnectionFactory.java:120)

at com.teradata.jdbc.TeraDriver.doConnect(TeraDriver.java:232)

at com.teradata.jdbc.TeraDriver.connect(TeraDriver.java:158)

at com.teradata.datatools.dtp.connectivity.db.teradata.TeradataJDBCConnection.makeConnection(TeradataJDBCConnection.java:293)

at com.teradata.datatools.dtp.connectivity.db.teradata.TeradataJDBCConnection.createConnection(TeradataJDBCConnection.java:121)

at org.eclipse.datatools.connectivity.DriverConnectionBase.internalCreateConnection(DriverConnectionBase.java:105)

at org.eclipse.datatools.connectivity.DriverConnectionBase.open(DriverConnectionBase.java:54)

at org.eclipse.datatools.connectivity.drivers.jdbc.JDBCConnection.open(JDBCConnection.java:73)

at com.teradata.datatools.dtp.connectivity.db.teradata.TeradataPingFactory.createConnection(TeradataPingFactory.java:36)

at org.eclipse.datatools.connectivity.internal.ConnectionFactoryProvider.createConnection(ConnectionFactoryProvider.java:83)

at org.eclipse.datatools.connectivity.internal.ConnectionProfile.createConnection(ConnectionProfile.java:359)

at org.eclipse.datatools.connectivity.ui.PingJob.createTestConnection(PingJob.java:76)

at org.eclipse.datatools.connectivity.ui.PingJob.run(PingJob.java:59)

at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

Teradata Employee

Re: Teradata JDBC Exception

Please refer to the following troubleshooting information in the Teradata JDBC Driver User Guide:

http://developer.teradata.com/doc/connectivity/jdbc/reference/current/jdbcug_chapter_5.html#CHDIJJJH

That exception typically means that the classpath is not set, or set incorrectly, such that tdgssconfig.jar cannot be found.

Enthusiast

Re: Teradata JDBC Exception

Magnificent! Thanks for the info, Tom

Re: Teradata JDBC Exception

Hi guys,

I also hit this issue recently. But this issue only happens with redhat linux OS. I can connect to teradata database from windows.

Now the teradata version is 14.00.00.01, the jdbc driver version is 14.00.00.14.

I'm not sure if this issue can be resolved by update the jdbc driver.

The problem now is I can't create connection to it. Below is the exception log:

2013-08-19.14:58:32.136 TERAJDBC4 ERROR [main] com.teradata.jdbc.jdk6.JDK6_SQL_Connection@1fee702 Read message 1: Incomplete LAN message header: read 0 bytes
2013-08-19.14:58:32.142 TERAJDBC4 ERROR [main] com.teradata.jdbc.jdk6.JDK6_SQL_Connection@1fee702 Read message 1 failed; closing socket due to: java.io.IOException: Incomplete LAN message header: read 0 bytes
2013-08-19.14:58:32.145 TERAJDBC4 ERROR [main] com.teradata.jdbc.jdk6.JDK6_SQL_Connection@1fee702 Packet receive Mon Aug 19 14:58:32 HKT 2013 socket orig=192.168.70.64 local=0.0.0.0/0.0.0.0:48254 remote=/192.168.70.64:1025 keepalive=unavailable nodelay=unavailable receive=unavailable send=unavailable linger=unavailable traffic=unavailable concurrent=3 contimeout=10000 conwait=1000 connecttime=3 connecttotaltime=5 connectattempts=1 connectfailures=0 failurecache={} cid=461581 sess=2739 java.io.IOException: Incomplete LAN message header: read 0 bytes at com.teradata.jdbc.jdbc_4.io.TDNetworkIOIF.read(TDNetworkIOIF.java:673) at com.teradata.jdbc.jdbc_4.io.TDPacketStream.readStream(TDPacketStream.java:818) at com.teradata.jdbc.jdbc.GenericLogonController.run(GenericLogonController.java:496) at com.teradata.jdbc.jdbc_4.TDSession.<init>(TDSession.java:215) at com.teradata.jdbc.jdk6.JDK6_SQL_Connection.<init>(JDK6_SQL_Connection.java:30) at com.teradata.jdbc.jdk6.JDK6ConnectionFactory.constructConnection(JDK6ConnectionFactory.java:22) at com.teradata.jdbc.jdbc.ConnectionFactory.createConnection(ConnectionFactory.java:130) at com.teradata.jdbc.jdbc.ConnectionFactory.createConnection(ConnectionFactory.java:120) at com.teradata.jdbc.TeraDriver.doConnect(TeraDriver.java:228) at com.teradata.jdbc.TeraDriver.connect(TeraDriver.java:154) at java.sql.DriverManager.getConnection(Unknown Source) at java.sql.DriverManager.getConnection(Unknown Source)