Support Questions
Find answers, ask questions, and share your expertise

Atals (hdp 2.6.3) import-hive.sh error: java.net.SocketTimeoutException: Read timed out

Atals (hdp 2.6.3) import-hive.sh error: java.net.SocketTimeoutException: Read timed out

Expert Contributor

Having some issues getting data imported. I followed the tutorial created here. (Thanks @Ayub Khan ) I am not able to get the script to work... it times out.

Here's how I run the script:

#!/bin/bash
source /etc/hadoop/2.6.3.0-235/0/hadoop-env.sh
source /etc/hive/2.6.3.0-235/0/hive-env.sh
/usr/hdp/2.6.3.0-235/atlas/hook-bin/import-hive.sh2  -Dsun.security.jgss.debug=true -Djavax.security.auth.useSubjectCredsOnly=false -Djava.security.krb5.conf=/etc/krb5.conf -Djava.security.auth.login.config=jaas.conf

This sets up my enviroment. (I also do a kinit)

My issue is the script is failing:

[andm013@lrdccdhm04 ~]$ ./import_hive.sh
Using Hive configuration directory [/usr/hdp/current/hive-client/conf]
Log file for import is /usr/hdp/2.6.3.0-235/atlas/logs/import-hive.log
log4j:WARN No such property [maxFileSize] in org.apache.log4j.PatternLayout.
log4j:WARN No such property [maxBackupIndex] in org.apache.log4j.PatternLayout.
Exception in thread "main" org.apache.atlas.hook.AtlasHookException: HiveMetaStoreBridge.main() failed.
        at org.apache.atlas.hive.bridge.HiveMetaStoreBridge.main(HiveMetaStoreBridge.java:650)
Caused by: com.sun.jersey.api.client.ClientHandlerException: java.net.SocketTimeoutException: Read timed out
        at com.sun.jersey.client.urlconnection.URLConnectionClientHandler.handle(URLConnectionClientHandler.java:149)
        at com.sun.jersey.api.client.Client.handle(Client.java:648)
        at com.sun.jersey.api.client.WebResource.handle(WebResource.java:670)
        at com.sun.jersey.api.client.WebResource.access$200(WebResource.java:74)
        at com.sun.jersey.api.client.WebResource$Builder.method(WebResource.java:623)
        at org.apache.atlas.AtlasBaseClient.callAPIWithResource(AtlasBaseClient.java:334)
        at org.apache.atlas.AtlasBaseClient.callAPIWithResource(AtlasBaseClient.java:311)
        at org.apache.atlas.AtlasBaseClient.callAPI(AtlasBaseClient.java:199)
        at org.apache.atlas.AtlasClient.callAPIWithBodyAndParams(AtlasClient.java:952)
        at org.apache.atlas.AtlasClient.updateEntity(AtlasClient.java:505)
        at org.apache.atlas.hive.bridge.HiveMetaStoreBridge.updateInstance(HiveMetaStoreBridge.java:526)
        at org.apache.atlas.hive.bridge.HiveMetaStoreBridge.registerDatabase(HiveMetaStoreBridge.java:175)
        at org.apache.atlas.hive.bridge.HiveMetaStoreBridge.importDatabases(HiveMetaStoreBridge.java:140)
        at org.apache.atlas.hive.bridge.HiveMetaStoreBridge.importHiveMetadata(HiveMetaStoreBridge.java:134)
        at org.apache.atlas.hive.bridge.HiveMetaStoreBridge.main(HiveMetaStoreBridge.java:647)
Caused by: java.net.SocketTimeoutException: Read timed out
        at java.net.SocketInputStream.socketRead0(Native Method)
        at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
        at java.net.SocketInputStream.read(SocketInputStream.java:170)
        at java.net.SocketInputStream.read(SocketInputStream.java:141)
        at java.io.BufferedInputStream.fill(BufferedInputStream.java:246)
        at java.io.BufferedInputStream.read1(BufferedInputStream.java:286)
        at java.io.BufferedInputStream.read(BufferedInputStream.java:345)
        at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:704)
        at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:647)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1569)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1474)
        at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480)
        at com.sun.jersey.client.urlconnection.URLConnectionClientHandler._invoke(URLConnectionClientHandler.java:240)
        at com.sun.jersey.client.urlconnection.URLConnectionClientHandler.handle(URLConnectionClientHandler.java:147)
        ... 14 more
Failed to import Hive Data Model!!!


Here's a matching log snippet showing the error I get from /usr/hdp/2.6.3.0-235/atlas/logs/import-hive.log

2018-05-11 17:12:25,450 ERROR - [main:] ~ Import failed for hive_table usr_log  (HiveMetaStoreBridge:326)
org.apache.atlas.hook.AtlasHookException: HiveMetaStoreBridge.getStorageDescQFName() failed.
        at org.apache.atlas.hive.bridge.HiveMetaStoreBridge.registerTable(HiveMetaStoreBridge.java:515)
        at org.apache.atlas.hive.bridge.HiveMetaStoreBridge.importTable(HiveMetaStoreBridge.java:289)
        at org.apache.atlas.hive.bridge.HiveMetaStoreBridge.importTables(HiveMetaStoreBridge.java:272)
        at org.apache.atlas.hive.bridge.HiveMetaStoreBridge.importDatabases(HiveMetaStoreBridge.java:143)
        at org.apache.atlas.hive.bridge.HiveMetaStoreBridge.importHiveMetadata(HiveMetaStoreBridge.java:134)
        at org.apache.atlas.hive.bridge.HiveMetaStoreBridge.main(HiveMetaStoreBridge.java:647)
Caused by: com.sun.jersey.api.client.ClientHandlerException: java.net.SocketTimeoutException: Read timed out
        at com.sun.jersey.client.urlconnection.URLConnectionClientHandler.handle(URLConnectionClientHandler.java:149)
        at com.sun.jersey.api.client.Client.handle(Client.java:648)
        at com.sun.jersey.api.client.WebResource.handle(WebResource.java:670)
        at com.sun.jersey.api.client.WebResource.access$200(WebResource.java:74)
        at com.sun.jersey.api.client.WebResource$Builder.method(WebResource.java:623)
        at org.apache.atlas.AtlasBaseClient.callAPIWithResource(AtlasBaseClient.java:334)
        at org.apache.atlas.AtlasBaseClient.callAPIWithResource(AtlasBaseClient.java:311)
        at org.apache.atlas.AtlasBaseClient.callAPI(AtlasBaseClient.java:199)
        at org.apache.atlas.AtlasClient.callAPIWithBody(AtlasClient.java:942)
        at org.apache.atlas.AtlasClient.createEntity(AtlasClient.java:413)
        at org.apache.atlas.AtlasClient.createEntity(AtlasClient.java:430)
        at org.apache.atlas.hive.bridge.HiveMetaStoreBridge.registerInstance(HiveMetaStoreBridge.java:213)
        at org.apache.atlas.hive.bridge.HiveMetaStoreBridge.registerTable(HiveMetaStoreBridge.java:506)
        ... 5 more
Caused by: java.net.SocketTimeoutException: Read timed out
        at java.net.SocketInputStream.socketRead0(Native Method)
        at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
        at java.net.SocketInputStream.read(SocketInputStream.java:170)
        at java.net.SocketInputStream.read(SocketInputStream.java:141)
        at java.io.BufferedInputStream.fill(BufferedInputStream.java:246)
        at java.io.BufferedInputStream.read1(BufferedInputStream.java:286)
        at java.io.BufferedInputStream.read(BufferedInputStream.java:345)
        at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:704)
        at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:647)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1569)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1474)
        at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480)
        at com.sun.jersey.client.urlconnection.URLConnectionClientHandler._invoke(URLConnectionClientHandler.java:240)
        at com.sun.jersey.client.urlconnection.URLConnectionClientHandler.handle(URLConnectionClientHandler.java:147)
        ... 17 more
2018-05-11 17:12:25,450 ERROR - [main:] ~ Able to import 7 tables out of 23 tables from call_center. Please check logs for import errors (HiveMeoreBridge:279)

Any help would be appreciated