Support Questions

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

ODBC LDAP Auth SQLConnectW: [Cloudera][ThriftExtension] (6)

avatar
New Contributor

My ODBC driver (Linux 2.6.32-431.el6.x86_64 ODBC Driver version: 2.5.29.1009) worked properly without authentication.

But after enabling the LDAP authentication for Impala I cannot connect. It gives following error. SSL not enabled in the Impala server. 

(JDBC seems work properly for some application)

 

1. When SSL=1

--------------------

Oct 23 14:48:09 TRACE 905668352 ImpalaConnection::Connect: +++++ enter +++++
Oct 23 14:48:09 DEBUG 905668352 DSConnectionUtils::LogConnectionSettings: AuthMech: 3
Oct 23 14:48:09 DEBUG 905668352 DSConnectionUtils::LogConnectionSettings: CAIssuedCertNamesMismatch: 1
Oct 23 14:48:09 DEBUG 905668352 DSConnectionUtils::LogConnectionSettings: Database: db1
Oct 23 14:48:09 DEBUG 905668352 DSConnectionUtils::LogConnectionSettings: Description: New Cloudera Cluster
Oct 23 14:48:09 DEBUG 905668352 DSConnectionUtils::LogConnectionSettings: Driver: /opt/cloudera/impalaodbc/lib/64/libclouderaimpalaodbc64.so
Oct 23 14:48:09 DEBUG 905668352 DSConnectionUtils::LogConnectionSettings: DSN: bigdata
Oct 23 14:48:09 DEBUG 905668352 DSConnectionUtils::LogConnectionSettings: HOST: impala.hostname
Oct 23 14:48:09 DEBUG 905668352 DSConnectionUtils::LogConnectionSettings: KrbFQDN:
Oct 23 14:48:09 DEBUG 905668352 DSConnectionUtils::LogConnectionSettings: KrbRealm:
Oct 23 14:48:09 DEBUG 905668352 DSConnectionUtils::LogConnectionSettings: KrbServiceName:
Oct 23 14:48:09 DEBUG 905668352 DSConnectionUtils::LogConnectionSettings: PORT: 21050
Oct 23 14:48:09 DEBUG 905668352 DSConnectionUtils::LogConnectionSettings: PWD: *****
Oct 23 14:48:09 DEBUG 905668352 DSConnectionUtils::LogConnectionSettings: RowsFetchedPerBlock: 10000
Oct 23 14:48:09 DEBUG 905668352 DSConnectionUtils::LogConnectionSettings: SocketTimeout: 0
Oct 23 14:48:09 DEBUG 905668352 DSConnectionUtils::LogConnectionSettings: SSL: 1
Oct 23 14:48:09 DEBUG 905668352 DSConnectionUtils::LogConnectionSettings: StringColumnLength: 32767
Oct 23 14:48:09 DEBUG 905668352 DSConnectionUtils::LogConnectionSettings: TrustedCerts: /opt/cloudera/impalaodbc/lib/64/cacerts.pem
Oct 23 14:48:09 DEBUG 905668352 DSConnectionUtils::LogConnectionSettings: TSaslTransportBufSize: 1000
Oct 23 14:48:09 DEBUG 905668352 DSConnectionUtils::LogConnectionSettings: UID: user1
Oct 23 14:48:09 DEBUG 905668352 DSConnectionUtils::LogConnectionSettings: UseNativeQuery: 0
Oct 23 14:48:09 DEBUG 905668352 ImpalaConnection::Connect: Enable simulated transactions: false
Oct 23 14:48:09 TRACE 905668352 ImpalaTCLIServiceThreadSafeClient::ImpalaTCLIServiceThreadSafeClient: +++++ enter +++++
Oct 23 14:48:09 TRACE 905668352 ImpalaTCLIServiceThreadSafeClient::OpenSession: +++++ enter +++++
Oct 23 14:48:09 DEBUG 905668352 ImpalaTCLIServiceThreadSafeClient::OpenSession: TOpenSessionReq
client_protocol = HIVE_CLI_SERVICE_PROTOCOL_V6
Oct 23 14:48:09 TRACE 905668352 ImpalaTCLIServiceThreadSafeClient::~ImpalaTCLIServiceThreadSafeClient: +++++ enter +++++
Oct 23 14:48:09 ERROR 905668352 Connection::SQLConnectW: [Cloudera][ThriftExtension] (6) Error occurred while contacting server: SSL_connect: error code: 0. This could be because you are trying to establish a SSL connection to a server that does not have SSL enabled.
Oct 23 14:48:09 TRACE 905668352 CInterface::SQLGetDiagRec: +++++ enter +++++
Oct 23 14:48:09 TRACE 905668352 CInterface::SQLGetDiagRec: +++++ enter +++++
Oct 23 14:48:09 TRACE 905668352 CInterface::SQLFreeHandle: +++++ enter +++++
Oct 23 14:48:09 TRACE 905668352 Environment::SQLFreeHandle: +++++ enter +++++
Oct 23 14:48:09 TRACE 905668352 Driver::UnregisterConnection: +++++ enter +++++
Oct 23 14:48:09 TRACE 905668352 CInterface::SQLFreeHandle: +++++ enter +++++
Oct 23 14:48:09 TRACE 905668352 Driver::FreeEnvironment: +++++ enter +++++
Oct 23 14:48:09 TRACE 905668352 Driver::GetEnvironment: +++++ enter +++++
Oct 23 14:48:09 TRACE 905668352 Driver::UnregisterEnvironment: +++++ enter +++++
[ISQL]ERROR: Could not SQLConnect

 

 

2. When SSL=0

-----------------

Oct 23 15:47:38 TRACE 235718400 ImpalaConnection::Connect: +++++ enter +++++
Oct 23 15:47:38 DEBUG 235718400 DSConnectionUtils::LogConnectionSettings: AuthMech: 3
Oct 23 15:47:38 DEBUG 235718400 DSConnectionUtils::LogConnectionSettings: CAIssuedCertNamesMismatch: 1
Oct 23 15:47:38 DEBUG 235718400 DSConnectionUtils::LogConnectionSettings: Database: db1
Oct 23 15:47:38 DEBUG 235718400 DSConnectionUtils::LogConnectionSettings: Description: New Cloudera Cluster
Oct 23 15:47:38 DEBUG 235718400 DSConnectionUtils::LogConnectionSettings: Driver: /opt/cloudera/impalaodbc/lib/64/libclouderaimpalaodbc64.so
Oct 23 15:47:38 DEBUG 235718400 DSConnectionUtils::LogConnectionSettings: DSN: bigdata
Oct 23 15:47:38 DEBUG 235718400 DSConnectionUtils::LogConnectionSettings: HOST: impala.hostname
Oct 23 15:47:38 DEBUG 235718400 DSConnectionUtils::LogConnectionSettings: KrbFQDN:
Oct 23 15:47:38 DEBUG 235718400 DSConnectionUtils::LogConnectionSettings: KrbRealm:
Oct 23 15:47:38 DEBUG 235718400 DSConnectionUtils::LogConnectionSettings: KrbServiceName:
Oct 23 15:47:38 DEBUG 235718400 DSConnectionUtils::LogConnectionSettings: PORT: 21050
Oct 23 15:47:38 DEBUG 235718400 DSConnectionUtils::LogConnectionSettings: PWD: *****
Oct 23 15:47:38 DEBUG 235718400 DSConnectionUtils::LogConnectionSettings: RowsFetchedPerBlock: 10000
Oct 23 15:47:38 DEBUG 235718400 DSConnectionUtils::LogConnectionSettings: SocketTimeout: 0
Oct 23 15:47:38 DEBUG 235718400 DSConnectionUtils::LogConnectionSettings: SSL: 0
Oct 23 15:47:38 DEBUG 235718400 DSConnectionUtils::LogConnectionSettings: StringColumnLength: 32767
Oct 23 15:47:38 DEBUG 235718400 DSConnectionUtils::LogConnectionSettings: TrustedCerts: /opt/cloudera/impalaodbc/lib/64/cacerts.pem
Oct 23 15:47:38 DEBUG 235718400 DSConnectionUtils::LogConnectionSettings: TSaslTransportBufSize: 1000
Oct 23 15:47:38 DEBUG 235718400 DSConnectionUtils::LogConnectionSettings: UID: user1
Oct 23 15:47:38 DEBUG 235718400 DSConnectionUtils::LogConnectionSettings: UseNativeQuery: 0
Oct 23 15:47:38 DEBUG 235718400 ImpalaConnection::Connect: Enable simulated transactions: false
Oct 23 15:47:38 TRACE 235718400 ImpalaTCLIServiceThreadSafeClient::ImpalaTCLIServiceThreadSafeClient: +++++ enter +++++
Oct 23 15:47:38 TRACE 235718400 ImpalaTCLIServiceThreadSafeClient::OpenSession: +++++ enter +++++
Oct 23 15:47:38 DEBUG 235718400 ImpalaTCLIServiceThreadSafeClient::OpenSession: TOpenSessionReq
client_protocol = HIVE_CLI_SERVICE_PROTOCOL_V6
Oct 23 15:47:38 TRACE 235718400 ImpalaTCLIServiceThreadSafeClient::~ImpalaTCLIServiceThreadSafeClient: +++++ enter +++++
Oct 23 15:47:38 ERROR 235718400 Connection::SQLConnectW: [Cloudera][ThriftExtension] (5) Error occurred while contacting server: No more data to read.. This could be because you are trying to establish a non-SSL connection to a SSL-enabled server.

 

 

1 ACCEPTED SOLUTION

avatar
New Contributor

Yes. We had to enable SSL for impala. Final ODBC config like below 

 

[bigdata]
Description=New Cloudera Cluster
Driver=/opt/cloudera/impalaodbc/lib/64/libclouderaimpalaodbc64.so
HOST=192.168.10.10
PORT=21050
Database=dbname
AuthMech=4
UID=username
PWD=password
SSL=1
CAIssuedCertNamesMismatch=1
TrustedCerts=/opt/cloudera/impalaodbc/lib/64/your_impala_ssl_cert.pem
KrbFQDN=
KrbRealm=
KrbServiceName=
TSaslTransportBufSize=1000
RowsFetchedPerBlock=10000
SocketTimeout=0
StringColumnLength=32767
UseNativeQuery=0

View solution in original post

6 REPLIES 6

avatar
Cloudera Employee

Hi Shanika – can you provide more details on your configuration? Specifically:

  • Can you confirm that Impala is properly configured to use LDAP authentication? Assuming yes, then you should be able to confirm using a valid username/password in Impala Shell or Beeline.
  • Can you clarify whether or not SSL is configured for Impala?
  • Details on the configuration in odbc.ini?

avatar
New Contributor
  • LDAP is properly configured. We can coonect from impala-shell using LDAP username and passwords.
  • SSL not enabled in Impala. I think due to overhead.
  • Without LDAP (i.e. without authentication and AuthMech=0) this works properly.
  • Configurations is as follows.

[bigdata]
Description=New Cloudera Cluster
Driver=/opt/cloudera/impalaodbc/lib/64/libclouderaimpalaodbc64.so
HOST=impala.hostname
PORT=21050
Database=db1
AuthMech=3
UID=user1
PWD=*****
SSL=0
CAIssuedCertNamesMismatch=1
KrbFQDN=
KrbRealm=
KrbServiceName=
TSaslTransportBufSize=1000
RowsFetchedPerBlock=10000
SocketTimeout=0
StringColumnLength=32767
UseNativeQuery=0

avatar
Explorer
Was this resolved? Running into the same issue, please share the resolution.

avatar
New Contributor

Yes. We had to enable SSL for impala. Final ODBC config like below 

 

[bigdata]
Description=New Cloudera Cluster
Driver=/opt/cloudera/impalaodbc/lib/64/libclouderaimpalaodbc64.so
HOST=192.168.10.10
PORT=21050
Database=dbname
AuthMech=4
UID=username
PWD=password
SSL=1
CAIssuedCertNamesMismatch=1
TrustedCerts=/opt/cloudera/impalaodbc/lib/64/your_impala_ssl_cert.pem
KrbFQDN=
KrbRealm=
KrbServiceName=
TSaslTransportBufSize=1000
RowsFetchedPerBlock=10000
SocketTimeout=0
StringColumnLength=32767
UseNativeQuery=0

avatar

HI

 

 

I am getting the following error. Can you pls advice. Thanks.

it's giving error
DBI connect('DRIVER={Cloudera Impala ODBC Driver 64-bit};Host=10.92.869.876;Port=21050','',...) failed: [unixODBC][Cloudera][ThriftExtension] (5) Error occurred while contacting server: No more data to read.. This could be because you are trying to establish a non-SSL connection to a SSL-enabled server. (SQL-HY000) at /tmp/test22.pl line 12

avatar
New Contributor

For others that maybe have the same problem.

The fix for us was to use the full username, setting the LDAP domain also:

 

user@REALM.COM

 

And for some tools the Use SASL option needs to be enabled. For example in Database Browser.

 

Hope it helps someone.