Support Questions

Find answers, ask questions, and share your expertise

SQOOP from Oracle Connection reset error

avatar
Rising Star

Hi Team,

Iam getting below error when i try sqooping from Oracle. But when i rerun the same job without any change. its running But why it is not runnig in the first time. Please help

Error:###################

Warning: /usr/hdp/2.3.2.0-2950/accumulo does not exist! Accumulo imports will fail.

Please set $ACCUMULO_HOME to the root of your Accumulo installation.

16/09/15 01:04:11 INFO sqoop.Sqoop: Running Sqoop version: 1.4.6.2.3.2.0-2950

16/09/15 01:04:11 INFO oracle.OraOopManagerFactory: Data Connector for Oracle and Hadoop is disabled.

16/09/15 01:04:11 INFO manager.SqlManager: Using default fetchSize of 1000

16/09/15 01:04:11 INFO tool.CodeGenTool: Beginning code generation

SLF4J: Class path contains multiple SLF4J bindings.

SLF4J: Found binding in [jar:file:/opt/hadoop/hdp/2.3.2.0-2950/hadoop/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]

SLF4J: Found binding in [jar:file:/opt/hadoop/hdp/2.3.2.0-2950/zookeeper/lib/slf4j-log4j12-1.6.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]

SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.

SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]

16/09/15 01:05:13 ERROR manager.SqlManager: Error executing statement: java.sql.SQLRecoverableException: IO Error: Connection reset

java.sql.SQLRecoverableException: IO Error: Connection reset

at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:752)

at oracle.jdbc.driver.PhysicalConnection.connect(PhysicalConnection.java:662)

at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)

at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:560)

at java.sql.DriverManager.getConnection(DriverManager.java:571)

at java.sql.DriverManager.getConnection(DriverManager.java:233)

at org.apache.sqoop.manager.OracleManager.makeConnection(OracleManager.java:325)

at org.apache.sqoop.manager.GenericJdbcManager.getConnection(GenericJdbcManager.java:52)

at org.apache.sqoop.manager.SqlManager.execute(SqlManager.java:744)

at org.apache.sqoop.manager.SqlManager.execute(SqlManager.java:767)

at org.apache.sqoop.manager.SqlManager.getColumnInfoForRawQuery(SqlManager.java:270)

at org.apache.sqoop.manager.SqlManager.getColumnTypesForRawQuery(SqlManager.java:241)

at org.apache.sqoop.manager.SqlManager.getColumnTypesForQuery(SqlManager.java:234)

at org.apache.sqoop.manager.ConnManager.getColumnTypes(ConnManager.java:304)

at org.apache.sqoop.orm.ClassWriter.getColumnTypes(ClassWriter.java:1845)

at org.apache.sqoop.orm.ClassWriter.generate(ClassWriter.java:1645)

at org.apache.sqoop.tool.CodeGenTool.generateORM(CodeGenTool.java:107)

at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:478)

at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:605)

at org.apache.sqoop.Sqoop.run(Sqoop.java:148)

at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)

at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:184)

at org.apache.sqoop.Sqoop.runTool(Sqoop.java:226)

at org.apache.sqoop.Sqoop.runTool(Sqoop.java:235)

at org.apache.sqoop.Sqoop.main(Sqoop.java:244)

Caused by: java.net.SocketException: Connection reset

at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:118)

at java.net.SocketOutputStream.write(SocketOutputStream.java:159)

at oracle.net.ns.DataPacket.send(DataPacket.java:209)

at oracle.net.ns.NetOutputStream.flush(NetOutputStream.java:215)

at oracle.net.ns.NetInputStream.getNextPacket(NetInputStream.java:302)

at oracle.net.ns.NetInputStream.read(NetInputStream.java:249)

at oracle.net.ns.NetInputStream.read(NetInputStream.java:171)

at oracle.net.ns.NetInputStream.read(NetInputStream.java:89)

at oracle.jdbc.driver.T4CSocketInputStreamWrapper.readNextPacket(T4CSocketInputStreamWrapper.java:123)

at oracle.jdbc.driver.T4CSocketInputStreamWrapper.read(T4CSocketInputStreamWrapper.java:79)

at oracle.jdbc.driver.T4CMAREngineStream.unmarshalUB1(T4CMAREngineStream.java:429)

at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:397)

at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:257)

at oracle.jdbc.driver.T4CTTIoauthenticate.doOAUTH(T4CTTIoauthenticate.java:433)

at oracle.jdbc.driver.T4CTTIoauthenticate.doOAUTH(T4CTTIoauthenticate.java:950)

at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:639)

... 24 more

16/09/15 01:05:13 ERROR tool.ImportTool: Encountered IOException running import job: java.io.IOException: No columns to generate for ClassWriter

at org.apache.sqoop.orm.ClassWriter.generate(ClassWriter.java:1651)

at org.apache.sqoop.tool.CodeGenTool.generateORM(CodeGenTool.java:107)

at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:478)

at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:605)

at org.apache.sqoop.Sqoop.run(Sqoop.java:148)

at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)

at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:184)

at org.apache.sqoop.Sqoop.runTool(Sqoop.java:226)

at org.apache.sqoop.Sqoop.runTool(Sqoop.java:235)

at org.apache.sqoop.Sqoop.main(Sqoop.java:244)

3 REPLIES 3

avatar
Expert Contributor

It might be due to network connectivity issue. Please check on the network config to see any packet loss.

avatar
Contributor

This problem occurs primarily due to the lack of a fast random number generation device on the host where the map tasks execute.

Pass below argument with sqoop import command

export HADOOP_OPTS=-Djava.security.egd=file:/dev/../dev/urandom
sqoop import -D mapred.child.java.opts="-Djava.security.egd=file:/dev/../dev/urandom"

References:

http://stackoverflow.com/questions/2327220/oracle-jdbc-intermittent-connection-issue/

https://community.oracle.com/thread/943911?tstart=0&messageID=3793101

https://sqoop.apache.org/docs/1.4.6/SqoopUserGuide.html#_oracle_connection_reset_errors

avatar
Contributor

References worked for me by replacing /dev/random to /dev/../dev/urandom in java.security file !