MySQL Communications link failure

One Star

MySQL Communications link failure

Hi,
I've a job with multiple database connexion to big mysql tables. When I run my job on talend run interface, my job completes without any problem. But when I try to run it after exporting it with the script and the *.jar, I get this exception:
Exception in component tMysqlInput_7
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
Last packet sent to the server was 456424 ms ago.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:353)
at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1074)
at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2583)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2871)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:855)
at com.mysql.jdbc.MysqlIO.nextRow(MysqlIO.java:1330)
at com.mysql.jdbc.MysqlIO.readSingleRowSet(MysqlIO.java:2330)
at com.mysql.jdbc.MysqlIO.getResultSet(MysqlIO.java:427)
at com.mysql.jdbc.MysqlIO.readResultsForQueryOrUpdate(MysqlIO.java:2035)
at com.mysql.jdbc.MysqlIO.readAllResults(MysqlIO.java:1421)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1772)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2430)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2359)
at com.mysql.jdbc.Statement.executeQuery(Statement.java:1227)
...
Any idea of the difference between the JDBC used in the run interface of talend and the one extracted wih the jobs ? or maybe this is a known issue that is caused by something else ?
Regards,
PS: I'm using v2.3.3 with java
One Star

Re: MySQL Communications link failure

Hi,
I am sorry, I will not answer to your question but ask another one (I just started using Talend).
In fact, when I execute my job tMysqlInput > tMysqlOutput in order to make a replication between two Mysql databases, I get an error message that tells me "communications link failure".
Could you help me solve this problem?
Thank you very much!
Best regards,
Nizar.
One Star

Re: MySQL Communications link failure

@mlamrani I have the same problem :
connected
Exception in component tMysqlRow_1
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
Last packet sent to the server was 19 ms ago.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:353)
at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1074)
at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2583)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2871)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1601)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1710)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2430)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2359)
at com.mysql.jdbc.Statement.execute(Statement.java:719)
at etudes_production.tle_fin001_0_8.TLE_FIN001.tMysqlRow_1Process(TLE_FIN001.java:10847)
at etudes_production.tle_fin001_0_8.TLE_FIN001.tWarn_13Process(TLE_FIN001.java:10644)
at etudes_production.tle_fin001_0_8.TLE_FIN001.tWarn_14Process(TLE_FIN001.java:10541)
at etudes_production.tle_fin001_0_8.TLE_FIN001.tFileInputDelimited_1Process(TLE_FIN001.java:10219)
at etudes_production.tle_fin001_0_8.TLE_FIN001.tMysqlInput_1Process(TLE_FIN001.java:6238)
at etudes_production.tle_fin001_0_8.TLE_FIN001.tMysqlConnection_1Process(TLE_FIN001.java:5719)
at etudes_production.tle_fin001_0_8.TLE_FIN001.hOracleClose_1Process(TLE_FIN001.java:5485)
at etudes_production.tle_fin001_0_8.TLE_FIN001.tWarn_12Process(TLE_FIN001.java:5350)
at etudes_production.tle_fin001_0_8.TLE_FIN001.tWarn_11Process(TLE_FIN001.java:5256)
at etudes_production.tle_fin001_0_8.TLE_FIN001.hOracleInput_1Process(TLE_FIN001.java:5045)
at etudes_production.tle_fin001_0_8.TLE_FIN001.hOracleConnection_1Process(TLE_FIN001.java:17695)
at etudes_production.tle_fin001_0_8.TLE_FIN001.runJobInTOS(TLE_FIN001.java:18088)
at etudes_production.tle_fin001_0_8.TLE_FIN001.main(TLE_FIN001.java:17750)
Caused by: java.io.EOFException
at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1958)
at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2372)
... 19 more
disconnected

I don't understand where it comes from.
One Star

Re: MySQL Communications link failure

Hello,
if the error happens only when dealing with big queries (big number of records in the dataset) try to play with the "enable stream" advanced setting of the mysqlinput.
It did the trick for me. Reason is that apparently when it is off (or on, cannot remember) all tghe result is cache in memory before being passed to the next component... and if it does nto fit in memory you get some connection errors if I recall correctly
One Star

Re: MySQL Communications link failure

Hello,
if the error happens only when dealing with big queries (big number of records in the dataset) try to play with the "enable stream" advanced setting of the mysqlinput.
It did the trick for me. Reason is that apparently when it is off (or on, cannot remember) all tghe result is cache in memory before being passed to the next component... and if it does nto fit in memory you get some connection errors if I recall correctly

Thank you saburo for your answer.
Actually I use a "tMysqlOutput" that loads more than 3 million lines, then I use a "tMysqlRow" for an update on another table. Obviously the insertion of the 3 million lines goes well, but the error appears in the update.
Six Stars

Re: MySQL Communications link failure

This error is passed up to Talend directly from the JDBC driver. This indicates that a TCP/IP connection could not be established to the target host. Check all host,ports, firewall settings. This is a communication/network issue. Test with a mysql-client via command line.