Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Sqoop fail to import sqlserver tables. Possible to list databases but not tables

Sqoop fail to import sqlserver tables. Possible to list databases but not tables

New Contributor

Hello,

 

I experience troubles again this time with sqoop.

I tried sqoop2, uninstalled it and installed sqoop1 with my cdh5.2

With the following command i succeed to get the list of the databases

sqoop list-databases --connect jdbc:sqlserver://172.XX.XX.XX  --username User -P --verbose

 

But i can't access to tables with "list-tables" or "import-all-tables" commands..

 

sqoop import-all-tables --connect jdbc:sqlserver://172.XX.XX.XX/dbName --username User --password Password --driver com.microsoft.sqlserver.jdbc.SQLServerDriver --verbose

Give me this :


Warning: /usr/lib/sqoop/../hbase does not exist! HBase imports will fail.
Please set $HBASE_HOME to the root of your HBase installation.
Warning: /usr/lib/sqoop/../hcatalog does not exist! HCatalog jobs will fail.
Please set $HCAT_HOME to the root of your HCatalog installation.
Warning: /usr/lib/sqoop/../accumulo does not exist! Accumulo imports will fail.
Please set $ACCUMULO_HOME to the root of your Accumulo installation.
14/12/08 16:11:36 INFO sqoop.Sqoop: Running Sqoop version: 1.4.5-cdh5.2.1
14/12/08 16:11:36 WARN tool.BaseSqoopTool: Setting your password on the command-line is insecure. Consider using -P instead.
14/12/08 16:11:37 WARN sqoop.ConnFactory: Parameter --driver is set to an explicit driver however appropriate connection manager is not being set (via --connection-manager). Sqoop is going to fall back to org.apache.sqoop.manager.GenericJdbcManager. Please specify explicitly which connection manager should be used next time.
14/12/08 16:11:37 INFO manager.SqlManager: Using default fetchSize of 1000
14/12/08 16:11:51 ERROR manager.SqlManager: Error reading database metadata: com.microsoft.sqlserver.jdbc.SQLServerException: Échec de la connexion TCP/IP à l'hôte 172.XX.XX.XX/dbName, port 1433. Erreur : « null. Vérifiez les propriétés de connexion. Assurez-vous qu'une instance de SQL Server est en cours d'exécution sur l'hôte et accepte les connexions TCP/IP au port. Vérifiez que les connexions TCP au port ne sont pas bloquées par un pare-feu. ».
com.microsoft.sqlserver.jdbc.SQLServerException: Échec de la connexion TCP/IP à l'hôte 172.XX.XX.XX/dbName, port 1433. Erreur : « null. Vérifiez les propriétés de connexion. Assurez-vous qu'une instance de SQL Server est en cours d'exécution sur l'hôte et accepte les connexions TCP/IP au port. Vérifiez que les connexions TCP au port ne sont pas bloquées par un pare-feu. ».
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(SQLServerException.java:190)
at com.microsoft.sqlserver.jdbc.SQLServerException.ConvertConnectExceptionToSQLServerException(SQLServerException.java:241)
at com.microsoft.sqlserver.jdbc.SocketFinder.findSocket(IOBuffer.java:2243)
at com.microsoft.sqlserver.jdbc.TDSChannel.open(IOBuffer.java:491)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:1309)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:991)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:827)
at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:1012)
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:877)
at org.apache.sqoop.manager.GenericJdbcManager.getConnection(GenericJdbcManager.java:52)
at org.apache.sqoop.manager.SqlManager.listTables(SqlManager.java:517)
at org.apache.sqoop.tool.ImportAllTablesTool.run(ImportAllTablesTool.java:95)
at org.apache.sqoop.Sqoop.run(Sqoop.java:143)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:179)
at org.apache.sqoop.Sqoop.runTool(Sqoop.java:218)
at org.apache.sqoop.Sqoop.runTool(Sqoop.java:227)
at org.apache.sqoop.Sqoop.main(Sqoop.java:236)
Could not retrieve tables list from server
14/12/08 16:11:51 ERROR tool.ImportAllTablesTool: manager.listTables() returned null

 

 

Do you have any idea of what could be wrong? I can access through the port 1433 the list of the database present in the server at the IP adress.

But i can't access the list of tables when i try to go on a special database... IP/dbName

 

Is there more log somewhere? (i got nothing in /var/log/sqoop) and i'm already using --verbose

 

 

 

I'll be grateful for any informations!

2 REPLIES 2

Re: Sqoop fail to import sqlserver tables. Possible to list databases but not tables

New Contributor

Hi,

I have same issue.When I can run list-databases . But not List-tables. I changed the code little bit.

sqoop list-tables --connect 'jdbc:sqlserver://ipaddress:port;database=testDB' --username=sa -password=sa.

This didn't give any error. But I am not getting any results either.

Getting little frustrated. Hope fully some one will answer

Highlighted

Re: Sqoop fail to import sqlserver tables. Possible to list databases but not tables

Explorer

I too faced this issue.. 
list databases is working. List tables didnt work.

However after modifying the syntax slightly it worked !!!

 

sqoop list-tables --connect 'jdbc:sqlserver://ipaddress;database=dbName' --username=my_usrnme -password=my_pwd

 

Important to note that ' ' (single quotes) are mandatory and port number is not required (if list databases is working without port no, this will work).