question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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 issue

This 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:closed
  • Created 6 years ago
  • Comments:7

github_iconTop GitHub Comments

16reactions
SaucePan1commented, Oct 5, 2017

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.

8reactions
duniang818commented, Oct 12, 2017

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

b'Error in sasl_client_start (-4) SASL(-4): no mechanism ...
But unable to connect as it's throwing error: TTransportException: Could not start SASL: b'Error in sasl_client_start (-4) SASL(-4): no ...
Read more >
[Question] pyhive.hive.Connection, SASL and python 3.5 ...
TTransportException : TTransportException(message="Could not start SASL: b'Error in sasl_client_start (-4) SASL(-4): no mechanism available: ...
Read more >
Error in sasl_client_start (-4) SASL(-4): no mechanism available
TTransport.TTransportException: Could not start SASL: Error in sasl_client_start (-4) SASL(-4): no mechanism available: No worthy mechs found
Read more >
Impyla Connection. Cannot Start Sasl. No Mechanism Available
Can 't connect to unsecured hive. SASL error: TTransportException: Could not start SASL: Error in saslclientstart 4 SASL4: no. python hive impala pyhive...
Read more >
Hue error could not start SASL: Error in sasl_client_start (-1)
Hello team,. I don't know where to change, in the hue platform, after I enter into Query Editors->hive, the system reports this error....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found