Support Questions

Find answers, ask questions, and share your expertise

PyHive : thrift.transport.TTransport.TTransportException: 'Error in sasl_decode (-1) SASL(-1): generic failure: Unable to find a callback: 32775'

avatar
Explorer

I've create a Python script for connect to Hiveserver2 to perform queries databases.

My code are working fine, it's running for a while until the error came out.

 

 

thrift.transport.TTransport.TTransportException: 'Error in sasl_decode (-1) SASL(-1): generic failure: Unable to find a callback: 32775'

 

 

From investigated, I guess it might be something about Thrift SASL library 

https://github.com/cloudera/thrift_sasl/blob/master/thrift_sasl/__init__.py

 

 

  def _read_frame(self):
    header = self._trans.read(4)
    (length,) = struct.unpack(">I", header)
    if self.encode:
      # If the frames are encoded (i.e. you're using a QOP of auth-int or
      # auth-conf), then make sure to include the header in the bytes you send to
      # sasl.decode()
      encoded = header + self._trans.read(length)
      success, decoded = self.sasl.decode(encoded)
      if not success:
        raise TTransportException(type=TTransportException.UNKNOWN,
                                  message=self.sasl.getError())

 

 

I have no idea what's cause the exception occurred. Any suggestion would be nice!

How to fix this problem ?

Thanks

6 REPLIES 6

avatar

This error usually happens if the client doesnt match the QOP on server.

 

Can you share the connection string used in your code snippet? Is your hiveserver2 kerberised? Can you please share what is the value set for this property hive.server2.thrift.sasl.qop in your hiveserver2's hive-site.xml?

 

Example connection string is in link https://github.com/dropbox/PyHive/pull/135/files/ec5270c4b6556bcd20f0f81afbced4a69ca9eff0

avatar
New Contributor

Hi @venkatsambath, I got the same problem too and I havent solved it, do you have any idea how to solve it. Yes my hiveserver2 is kerberized. I got rid of the error if I put LIMIT 300 to my query. But if it returns more than 300 rows then I got this error. 

 

avatar
Explorer

It’s waste driver. Better switch to pyodbc and install the cloudera odbc driver. Which works like charm.

avatar
New Contributor

Thanks for the quick reply and suggestion. Any documentation or article then I can go through for the setup and installation ?

avatar
Explorer

avatar
Explorer

Did you find solution for this?

I am facing the same issue. My hiveserver2 is kerberized and 

hive.server2.thrift.sasl.qop - auth-conf

hive.server2.transport.mode - binary

 

it's working If i limit rows to  less than1000 . It I set to more than 1000 rows . It's failing