cloudera / impyla

Python DB API 2.0 client for Impala and Hive (HiveServer2 protocol)
Apache License 2.0
727 stars 249 forks source link

Upgrading from impyla 0.9.1 --> 0.11.1 causes crash #134

Closed natekupp closed 8 years ago

natekupp commented 8 years ago

We have a previously working installation of impyla that we tried to upgrade, and now crashes. This is on Debian 7.8 (wheezy).

We're using LDAP auth + SSL, and I believe all of the necessary SASL/LDAP dependencies are installed on the system (given that 0.9.1 worked fine). I assume this is likely related to issue #93?

We're using the following to connect:

from impala.dbapi import connect
conn = connect(host='...', port=21050, auth_mechanism="LDAP", user = '...', password = '...', use_ssl=True)

This throws the following exception:

---------------------------------------------------------------------------
TTransportException                       Traceback (most recent call last)
<ipython-input-2-0bd3476b9fbe> in <module>()
----> 1 conn = connect(host='...', port=21050, auth_mechanism="LDAP", user = '...', password = '..', use_ssl=True)

/usr/local/lib/python2.7/dist-packages/impala/dbapi.pyc in connect(host, port, protocol, database, timeout, use_ssl, ca_cert, auth_mechanism, user, password, kerberos_service_name, use_ldap, ldap_user, ldap_password, use_kerberos)
     80                               ca_cert=ca_cert, user=user, password=password,
     81                               kerberos_service_name=kerberos_service_name,
---> 82                               auth_mechanism=auth_mechanism)
     83         return hs2.HiveServer2Connection(service, default_db=database)
     84     if protocol.lower() == 'beeswax':

/usr/local/lib/python2.7/dist-packages/impala/hiveserver2.pyc in connect(host, port, timeout, use_ssl, ca_cert, user, password, kerberos_service_name, auth_mechanism)
    584     transport = get_transport(sock, host, kerberos_service_name,
    585                               auth_mechanism, user, password)
--> 586     transport.open()
    587     protocol = TBinaryProtocol(transport)
    588     if six.PY2:

/usr/local/lib/python2.7/dist-packages/thrift_sasl/__init__.pyc in open(self)
     70     if not ret:
     71       raise TTransportException(type=TTransportException.NOT_OPEN,
---> 72         message=("Could not start SASL: %s" % self.sasl.getError()))
     73
     74     # Send initial response

TTransportException: Could not start SASL: Error in sasl_client_start (-4) SASL(-4): no mechanism available: No worthy mechs found

Thoughts?

lamdrew commented 8 years ago

auth_mechanism="PLAIN" seems to work...

natekupp commented 8 years ago

Ah, got it. Thanks, closing.

laserson commented 8 years ago

Sorry about that. There should be a better error message. I'll file an issue to improve it.