Browse Source

HUE-5167 [core] Improve SASL error reporting in HUE

Prakash Ranade 9 years ago
parent
commit
a189251

+ 2 - 2
desktop/core/src/desktop/lib/thrift_util.py

@@ -34,9 +34,9 @@ from thrift.protocol.TBinaryProtocol import TBinaryProtocol
 from thrift.protocol.TMultiplexedProtocol import TMultiplexedProtocol
 
 from django.conf import settings
+from django.utils.translation import ugettext as _
 from desktop.conf import SASL_MAX_BUFFER
 
-from desktop.lib.exceptions_renderable import PopupException
 from desktop.lib.python_util import create_synchronous_io_multiplexer
 from desktop.lib.thrift_.http_client import THttpClient
 from desktop.lib.thrift_.TSSLSocketWithWildcardSAN import TSSLSocketWithWildcardSAN
@@ -385,7 +385,7 @@ class PooledClient(object):
           err_msg = str(e)
           logging.info("Thrift saw a transport exception: " + err_msg, exc_info=False)
           if err_msg and 'generic failure: Unable to find a callback: 32775' in err_msg:
-            raise PopupException(_("Increase the sasl_max_buffer value in hue.ini"))
+            raise StructuredException(_("Increase the sasl_max_buffer value in hue.ini"), err_msg, data=None, error_code=502)
           raise StructuredThriftTransportException(e, error_code=502)
         except Exception, e:
           # Stack tends to be only noisy here.

+ 4 - 1
desktop/libs/notebook/src/notebook/connectors/hiveserver2.py

@@ -356,7 +356,10 @@ class HS2Api(Api):
       LOG.exception(title)
 
       if hasattr(e, 'message') and e.message:
-        message = e.message
+        if 'generic failure: Unable to find a callback: 32775' in e.message:
+          message = e.message + " " + _("Increase the sasl_max_buffer value in hue.ini")
+        else:
+          message = e.message
       else:
         message = e
       raise PopupException(_(title), detail=message)