Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Sqoop fails with windows authentication error intermittently

avatar
Explorer
Error: java.lang.RuntimeException: java.lang.RuntimeException: java.sql.SQLException: Login failed. The login is from an untrusted domain and cannot be used with Windows authentication.
	at org.apache.sqoop.mapreduce.db.DBInputFormat.setDbConf(DBInputFormat.java:170)
	at org.apache.sqoop.mapreduce.db.DBInputFormat.setConf(DBInputFormat.java:161)
	at org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:73)
	at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:133)
	at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:749)
	at org.apache.hadoop.mapred.MapTask.run(MapTask.java:341)
	at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:164)
	at java.security.AccessController.doPrivileged(Native Method)
	at javax.security.auth.Subject.doAs(Subject.java:415)
	at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1714)
	at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:158)
Caused by: java.lang.RuntimeException: java.sql.SQLException: Login failed. The login is from an untrusted domain and cannot be used with Windows authentication.
	at org.apache.sqoop.mapreduce.db.DBInputFormat.getConnection(DBInputFormat.java:223)
	at org.apache.sqoop.mapreduce.db.DBInputFormat.setDbConf(DBInputFormat.java:168)
	... 10 more
Caused by: java.sql.SQLException: Login failed. The login is from an untrusted domain and cannot be used with Windows authentication.
	at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:372)
	at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2988)
	at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2421)
	at net.sourceforge.jtds.jdbc.TdsCore.login(TdsCore.java:649)
	at net.sourceforge.jtds.jdbc.JtdsConnection.<init>(JtdsConnection.java:371)
	at net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:184)
	at java.sql.DriverManager.getConnection(DriverManager.java:571)
	at java.sql.DriverManager.getConnection(DriverManager.java:215)
	at org.apache.sqoop.mapreduce.db.DBConfiguration.getConnection(DBConfiguration.java:302)
	at org.apache.sqoop.mapreduce.db.DBInputFormat.getConnection(DBInputFormat.java:216)
	... 11 more
1 ACCEPTED SOLUTION

avatar
Explorer

Source SQL server restart solved the issue

View solution in original post

4 REPLIES 4

avatar
Champion

looks like you are passing wrong credentials or the sql server aint accepting your windows account authentication

make the mysql server accept botht the sql server account and windows account . 

check what user being passed under the hood. 

avatar
Explorer

Thank you for the response.

 

Sqoop used to run fine until we changed service id password. New password is also reflected in the scripts. But, sqoop fails about 2 out of 10 runs with authentication error.

 

If at all I give wrong credentials it should fail all the times. I'm wondering if the job process uses the old credentials from some where in the cache on the sql server side or cluster side ??

 

Tried running the below sqoop from command line and ended up with same windows authentication error intermittently.

PS-- sqoop eval --driver net.sourceforge.jtds.jdbc.Driver --connect "jdbc:jtds:sqlserver://URL:port;DOMAIN:****;username=***;password=****" --username --password --query ""

 

avatar
Explorer

Source SQL server restart solved the issue

avatar
New Contributor

Hi All,

 

We want to pull the data from MS SQL Server into hadoop using SQOOP with windows authentication.

 

I am using the below sqoop command to pull the information -

 

Sqoop eval --connect "jdbc:jtds:sqlserver://IP:portnumber;databaseName=test;domain=Domain_Name;useNTLMv2=true" --username XXX --password XXXXXX --query 'SELECT * FROM INFORMATION_SCHEMA.COLUMNS where $CONDITIONS' --driver net.sourceforge.jtds.jdbc.Driver 

 

When executing the above sqoop cmd it is throwing an error -

 

WARN tool.EvalSqlTool: SQL exception executing statement: java.sql.SQLException: I/O Error: DB server closed connection.

        at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2388)

        at net.sourceforge.jtds.jdbc.TdsCore.login(TdsCore.java:609)

        at net.sourceforge.jtds.jdbc.JtdsConnection.<init>(JtdsConnection.java:369)

        at net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:183)

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

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

        at org.apache.sqoop.manager.SqlManager.makeConnection(SqlManager.java:904)

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

        at org.apache.sqoop.tool.EvalSqlTool.run(EvalSqlTool.java:64)

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

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

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

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

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

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

Caused by: java.io.IOException: DB server closed connection.

        at net.sourceforge.jtds.jdbc.SharedSocket.readPacket(SharedSocket.java:883)

        at net.sourceforge.jtds.jdbc.SharedSocket.getNetPacket(SharedSocket.java:762)

       at net.sourceforge.jtds.jdbc.ResponseStream.getPacket(ResponseStream.java:477)

        at net.sourceforge.jtds.jdbc.ResponseStream.read(ResponseStream.java:114)

        at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2282)

 

Please can you help me on this.

 

Thanks in advance