N
N
Nikolay Baranenko2018-02-01 21:15:47
Python
Nikolay Baranenko, 2018-02-01 21:15:47

How to solve Could not start SASL: b'Error in sasl_client_start (-12) SASL library is not initialized'?

Hello.
I have OS
windows Server 2008 R2
and
python
C:\Windows\system32>C:\Software\Python36\python --version
Python 3.6.4
libs installed

future (0.16.0)
pip (9.0.1)
pure-sasl (0.4.0)
PyHive (0.5.0)
sasl (0.2.1)
setuptools (28.8.0)
six (1.11.0)
thrift (0.11.0)
thrift-sasl (0.3.0)

Tried to write a client for Hive DB
import pyhs2 as hive
import getpass
DEFAULT_DB = 'default'
DEFAULT_SERVER = 'hive_server'
DEFAULT_PORT = 10010
DEFAULT_DOMAIN = 'mydomain'

# u = raw_input('Enter PAM username: ')
# s = getpass.getpass()
u="tech_user"
s="tech_passwd"
connection = hive.connect(host=DEFAULT_SERVER, port= DEFAULT_PORT, authMechanism='LDAP', user=u + '@' + DEFAULT_DOMAIN, password=s)

when trying to execute, an error is returned:
File "C:\Software\Python36\lib\site-packages\pyhive\hive.py", line 159, in __init__
    self._transport.open()
  File "C:\Software\Python36\lib\site-packages\thrift_sasl\__init__.py", line 79, in open
    message=("Could not start SASL: %s" % self.sasl.getError()))
thrift.transport.TTransport.TTransportException: Could not start SASL: b'Error in sasl_client_start (-12) SASL library is not initialized'

How to solve this problem?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question