Support Questions

Find answers, ask questions, and share your expertise

CDP connection with Python/Thrift failing

avatar
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 = "hdp.mycompany.com"
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)
transport.open()

table_names = client.getTableNames()
print table_names

 

 

 

However, when changing the host to a CDP server:

host = "cdp.mycompany.com"
we get the following error:

 

Traceback (most recent call last):
File "C:\Users\myuser\apps\app\test\test.py", line 20, in <module>
table_names = client.getTableNames()
File "C:\Users\myuser\apps\app\hbased\Hbase.py", line 787, in getTableNames
self.send_getTableNames()
File "C:\Users\myuser\apps\app\hbased\Hbase.py", line 795, in send_getTableNames
self._oprot.trans.flush()
File "C:\ProgramData\Anaconda3\envs\ts27\lib\site-packages\thrift\transport\TTransport.py", line 418, in flush
encoded = self.sasl.wrap(data)
File "C:\ProgramData\Anaconda3\envs\ts27\lib\site-packages\puresasl\client.py", line 16, in wrapped
return f(self, *args, **kwargs)
File "C:\ProgramData\Anaconda3\envs\ts27\lib\site-packages\puresasl\client.py", line 157, in wrap
return self._chosen_mech.wrap(outgoing)
File "C:\ProgramData\Anaconda3\envs\ts27\lib\site-packages\puresasl\mechanisms.py", 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

1 ACCEPTED SOLUTION

avatar
New Contributor

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

View solution in original post

2 REPLIES 2

avatar
New Contributor

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

avatar
Master Collaborator

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.

 

Thanks,
Will