Can Not Login to Hue UI for Mixed Case Usernames after CDH Upgrade

0 votes
151 views
asked Aug 25, 2017 in Hadoop by admin (4,410 points)
SummaryAfter upgrading to CDH 5.7.0 or higher, some users may not be able to login to the Hue WebUI.

 

Applies To
  • Hue
  • CDH upgrade
Symptoms
After a CDH upgrade 5.7.0 or higher,  when trying to access to the Hue web UI with a user Hue returns "Invalid username or password", even the credentials are correct. 

Attempts to perform the following actions fail.  We will use the username "Test" for example:
- Log in Hue UI with another superuser, and update the "Test" user's password
- Change the password in a programmatic way with the Hue shell.

In the Hue role log, it had below error message:
AttributeError at /about/
'User' object has no attribute 'has_hue_permission'
Request Method: GET
Request URL: http://10.3.0.10:8888/about/
Django Version: 1.6.10
Exception Type: AttributeError
Exception Value:
'User' object has no attribute 'has_hue_permission'
Exception Location: /log/cloudera/parcels/CDH-5.8.2-1.cdh5.8.2.p0.3/lib/hue/build/env/lib/python2.6/site-packages/Django-1.6.10-py2.6.egg/django/utils/functional.py in inner, line 214
Python Executable: /log/cloudera/parcels/CDH-5.8.2-1.cdh5.8.2.p0.3/lib/hue/build/env/bin/python2.6

Traceback:
File "/log/cloudera/parcels/CDH-5.8.2-1.cdh5.8.2.p0.3/lib/hue/build/env/lib/python2.6/site-packages/Django-1.6.10-py2.6.egg/django/core/handlers/base.py" in get_response
112. response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/log/cloudera/parcels/CDH-5.8.2-1.cdh5.8.2.p0.3/lib/hue/build/env/lib/python2.6/site-packages/Django-1.6.10-py2.6.egg/django/db/transaction.py" in inner
371. return func(*args, **kwargs)
File "/log/cloudera/parcels/CDH-5.8.2-1.cdh5.8.2.p0.3/lib/hue/apps/about/src/about/views.py" in admin_wizard
35. apps = appmanager.get_apps(request.user)
File "/log/cloudera/parcels/CDH-5.8.2-1.cdh5.8.2.p0.3/lib/hue/desktop/core/src/desktop/appmanager.py" in get_apps
199. return filter(lambda app: user.has_hue_permission(action="access", app=app.display_name), DESKTOP_APPS)
File "/log/cloudera/parcels/CDH-5.8.2-1.cdh5.8.2.p0.3/lib/hue/desktop/core/src/desktop/appmanager.py" in <lambda>
199. return filter(lambda app: user.has_hue_permission(action="access", app=app.display_name), DESKTOP_APPS)
File "/log/cloudera/parcels/CDH-5.8.2-1.cdh5.8.2.p0.3/lib/hue/build/env/lib/python2.6/site-packages/Django-1.6.10-py2.6.egg/django/utils/functional.py" in inner
214. return func(self._wrapped, *args)

Exception Type: AttributeError at /about/
Exception Value: 'User' object has no attribute 'has_hue_permission'

 

 

Cause

Starting from CDH 5.7.0, Hue forces all user names to lowercase when logging into UI by default. In this case, the user name is using camel case and Hue converts it to lowercase in the backend and can not find the matching user name from database hence the login fails.

Instructions
One way to fix the issue is to allow Hue not forcing all user names to lowercase. This can be achieved by using below steps:
  • From CM UI, go to Hue Configuration and add below snippet into the 'Hue Service Advanced Configuration Snippet (Safety Valve) for hue_safety_valve.ini':

[desktop]
[[auth]]
force_username_lowercase=false

  • Restart Hue service
  • Try to login as user Test

Please log in or register to answer this question.

...