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.

SASL Error: no mechanism available: No worthy mechs found

See original GitHub issue

When trying to connect to an Impala Server, the following error happens:

>>> from impala.dbapi import connect
>>> conn = connect(host='xxxxxxxxxx', port=21050, user='xxxxxx', password='xxxxxx', auth_mechanism='LDAP')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.6/site-packages/impala/dbapi.py", line 82, in connect
    auth_mechanism=auth_mechanism)
  File "/usr/local/lib/python2.6/site-packages/impala/hiveserver2.py", line 586, in connect
    transport.open()
  File "/usr/local/lib/python2.6/site-packages/thrift_sasl/__init__.py", line 72, in open
    message=("Could not start SASL: %s" % self.sasl.getError()))
thrift.transport.TTransport.TTransportException: Could not start SASL: Error in sasl_client_start (-4) SASL(-4): no mechanism available: No worthy mechs found

Even with all LDAP dependencies installed.

Issue Analytics

  • State:open
  • Created 8 years ago
  • Comments:46 (14 by maintainers)

github_iconTop GitHub Comments

43reactions
charlietsaicommented, Jun 19, 2018

for what it’s worth, this solved it for me

apt-get install libsasl2-dev libsasl2-2 libsasl2-modules-gssapi-mit

running python in Docker

12reactions
pyite1commented, Jun 21, 2016

I have this working now on a CentOS install of Anaconda. I think that the critical aspect in getting this functioning was installing several sasl related packages on CentOS itself.

cyrus-sasl.x86_64        
cyrus-sasl-devel.x86_64  
cyrus-sasl-gs2.x86_64    
cyrus-sasl-gssapi.x86_64 
cyrus-sasl-ldap.x86_64   
cyrus-sasl-lib.x86_64    
cyrus-sasl-md5.x86_64    
cyrus-sasl-ntlm.x86_64   
cyrus-sasl-plain.x86_64  
cyrus-sasl-scram.x86_64  
cyrus-sasl-sql.x86_64    
python-saslwrapper.x86_64
ruby-saslwrapper.x86_64  
saslwrapper.x86_64       
saslwrapper-devel.x86_64 
$conda list 
impyla                    0.13.8                    <pip>
thrift                    0.9.3                     <pip>
thrift-sasl               0.2.0                     <pip>
thriftpy                  0.3.8                     <pip>
sasl                      0.2.1                     <pip>

I was unable to compile SASL on Windows (or any of the CentOS) packages, so leveraged the CentOS VM to connect to the Kerberos cluster.

After successfully running a kinit, I am able to connect with the following string:

con = impala.connect(host='xxxxxxxxxxxxx', port=21050, auth_mechanism='GSSAPI',
               kerberos_service_name='impala')

LDAP conection works as well:

con = impala.connect(host='xxxxxx', 
                             port=21050,
                             database='xxxxxx',
                             timeout=20,
                             use_ssl=True,
                             ca_cert='/home/user/cert.pem',
                             user='xxxxx', password=pwd,
                             auth_mechanism='PLAIN')
Read more comments on GitHub >

github_iconTop Results From Across the Web

SASL(-4): no mechanism available: No worthy mechs found ...
The following error is encountered when trying to connect to the CDH cluster using the MicroStrategy DB query tool or the command line...
Read more >
SASL authentication failure: No worthy mechs found
I'm running it in a Hyper-V VM if that's a factor (likely not). ... failure: No worthy mechs found," or "SASL authentication failed; ......
Read more >
"No worthy mechs found" when trying to relay email to Gmail ...
Just installing postfix doesn't pull in the cyrus-sasl-plain package ... (this changed from Fedora 26). – maxschlepzig. Apr 3, 2018 at 8:51.
Read more >
python cannot connect hiveserver2 - Stack Overflow
You are missing some dependencies, make sure you install cyrus-sasl-devel and cyrus-sasl-gssapi : On an RHEL-based distro: sudo yum install cyrus-sasl-devel ...
Read more >
Error in sasl_client_start (-4) SASL(-4): no mechanism available
pyhs2.connect(host='localhost',port=10000,authMechanism="PLAIN" ... Error in sasl_client_start (-4) SASL(-4): no mechanism available: No worthy mechs found
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