Can´t connect to unsecured Hive. SASL error: TTransportException: Could not start SASL: Error in sasl_client_start (-4) SASL(-4): no mechanism available: Unable to find a callback: 2
See original GitHub issueThis is my code:
from impala.dbapi import connect
conn = connect(host='my_host_name', port=10000, auth_mechanism='PLAIN')
cursor = conn.cursor()
cursor.execute('SHOW TABLES')
print cursor.description # prints the result set's schema
for table in cursor.fetchall():
print table
results = cursor.fetchall()
This is the error message:
TTransportException Traceback (most recent call last) <ipython-input-12-c8227c682818> in <module>() 1 from impala.dbapi import connect ----> 2 conn = connect(host=‘my_host_name’, port=10000, auth_mechanism=‘PLAIN’) 3 cursor = conn.cursor() 4 cursor.execute(‘SHOW TABLES’) 5 print cursor.description # prints the result set’s schema
C:\Users\u19m41\AppData\Local\Continuum\Anaconda2\lib\site-packages\impyla-0.14.0-py2.7.egg\impala\dbapi.pyc in connect(host, port, database, timeout, use_ssl, ca_cert, auth_mechanism, user, password, kerberos_service_name, use_ldap, ldap_user, ldap_password, use_kerberos, protocol) 145 ca_cert=ca_cert, user=user, password=password, 146 kerberos_service_name=kerberos_service_name, –> 147 auth_mechanism=auth_mechanism) 148 return hs2.HiveServer2Connection(service, default_db=database) 149
C:\Users\u19m41\AppData\Local\Continuum\Anaconda2\lib\site-packages\impyla-0.14.0-py2.7.egg\impala\hiveserver2.pyc in connect(host, port, timeout, use_ssl, ca_cert, user, password, kerberos_service_name, auth_mechanism) 756 transport = get_transport(sock, host, kerberos_service_name, 757 auth_mechanism, user, password) –> 758 transport.open() 759 protocol = TBinaryProtocol(transport) 760 if six.PY2:
C:\Users\u19m41\AppData\Local\Continuum\Anaconda2\lib\site-packages\thrift_sasl-0.2.1-py2.7.egg\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: Unable to find a callback: 2
Any idea on why this is happening? Thanks a lot!
Issue Analytics
- State:
- Created 6 years ago
- Comments:7
Top Related StackOverflow Question
I solved the issue, had to uninstall the package SASL and install PURE-SASL, when impyla can´t find the sasl package it works with pure-sasl and then everything goes well.
I change to the impala, but encount the new issue differt from yours. Here is my problem, when I run the code as following on windows with python3.6.3 and newest impyla and pure-sasl: from impala.dbapi import connect conn = connect(host=‘114.55.41.85’, port=10000, auth_mechanism=‘NOSASL’) cursor = conn.cursor() : error: No protocol version header,thriftpy.protocol.exc.TProtocolException: TProtocolException(type=4)
@SaucePan1 plz share your solution to me, I will appreciate for that.