Support Questions

Find answers, ask questions, and share your expertise

CDP connection with Python/Thrift failing

New Contributor

We are migrating from Hortonworks (HDP) to Cloudera (CDP) and having difficulties connecting to the hbase.

The following code works when using a HDP host:




from thrift.transport import TSocket, TTransport, THttpClient
from thrift.transport.TSSLSocket import TSSLSocket
from thrift.protocol import TBinaryProtocol, TCompactProtocol
import app.hbased.Hbase as Hbase

host = ""
port = 9090

sock = TSocket.TSocket(host, port)
saslServiceName = "hbase"
transport = TTransport.TSaslClientTransport(sock, host, saslServiceName, mechanism="GSSAPI")
protocol = TBinaryProtocol.TBinaryProtocol(transport)
client = Hbase.Client(protocol)

table_names = client.getTableNames()
print table_names




However, when changing the host to a CDP server:

host = ""
we get the following error:


Traceback (most recent call last):
File "C:\Users\myuser\apps\app\test\", line 20, in <module>
table_names = client.getTableNames()
File "C:\Users\myuser\apps\app\hbased\", line 787, in getTableNames
File "C:\Users\myuser\apps\app\hbased\", line 795, in send_getTableNames
File "C:\ProgramData\Anaconda3\envs\ts27\lib\site-packages\thrift\transport\", line 418, in flush
encoded = self.sasl.wrap(data)
File "C:\ProgramData\Anaconda3\envs\ts27\lib\site-packages\puresasl\", line 16, in wrapped
return f(self, *args, **kwargs)
File "C:\ProgramData\Anaconda3\envs\ts27\lib\site-packages\puresasl\", line 157, in wrap
return self._chosen_mech.wrap(outgoing)
File "C:\ProgramData\Anaconda3\envs\ts27\lib\site-packages\puresasl\", line 532, in wrap
kerberos.authGSSClientWrap(self.context, outgoing, None, protect)
winkerberos.GSSError: SSPI: EncryptMessage: The function requested is not supported 


Environment info:


python 2.7
thrift 0.11.0
pure-sasl 0.5.1


Any ideas on how to fix this?


Thank you


New Contributor

I fixed the issue by using gssflags in the authGSSClientInit method in my pure_sasl

View solution in original post


New Contributor

I fixed the issue by using gssflags in the authGSSClientInit method in my pure_sasl

Rising Star

Hello @Clua ,

Looks like you solved it, if possible could you please share the code snippets how you added gssflags in the authGSSClientInit and which Transport function are you using.