Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Hue Admin Password Reset using external database

Hue Admin Password Reset using external database

Expert Contributor

It works if I use embedded DB (http://gethue.com/password-management-in-hue). However, if I am using external DB, /etc/hue/conf/hue.ini doesn't contain the credentails for the external DB.

 

I did "sudo find / -name hue.ini" to locate the latest hue.ini, but it doesn't contain the password either. It actually calls a script to get the password.

 

What should I set before calling "build/env/bin/hue  createsuperuser" to make it work?

6 REPLIES 6

Re: Hue Admin Password Reset using external database

Champion

The password called from the script is for the DB user to access the external database.  If it is connected to that DB and working you shouldn't need it to run these commands.  The first user logged into Hue is made the superuser.  This is by default Admin.  If that account doesn't exist then run the command you listed to create a new one.  Then you should be able to log into that account and set the password.

 

Are you getting an error when you try that command?

Highlighted

Re: Hue Admin Password Reset using external database

Expert Contributor

If I run the command out of box as user hue, I get the exception stating not connecting to DB. Since hue.ini in /etc/hue/conf has no info on MySQL, I tried to use the one .ini used by HUE process. However, the password in .ini was hidden. I could reset the hue user password in MySQL database, but it is a little too much. 

 

I don't have the hue admin user and password since I didn't set up it. I am taking over the cluster now and tried to create another super user to replace the existing admin user.

 

Re: Hue Admin Password Reset using external database

Champion
If you know the old admin user name you can just reset that instead of create a whole new one.

Anyway, that isn't the issue at hand. Is Hue working normally for other users?

Are you able to get into the Hue shell?

Re: Hue Admin Password Reset using external database

Expert Contributor

Hue shell is not working since MySQL crendentails are not in /etc/hue/conf/hue.ini.

Re: Hue Admin Password Reset using external database

Champion
Ok, it has been a while since I messed with Hue commands, before they change to the script. The one interaction I had after was helping another person do it and forgot they ran into this same thing.

So yes, the password is not store in the config file but access through a script. You can get that from the process hue.ini. It does not give you the password if you run it manually due; I don't recall why.

Try this:

export the Hue process directory as normal
export HUE_CONF_DIR=/var/run/cloudera-scm-agent/process/`ls -1 /var/run/cloudera-scm-agent/process | grep HUE | sort -n | tail -1 `

then tell it to ignore errors when trying to get the db password
export HUE_IGNORE_PASSWORD_SCRIPT_ERRORS=1

Then run the hue command you need.

Re: Hue Admin Password Reset using external database

Expert Contributor

thanks. I will give a try.

Don't have an account?
Coming from Hortonworks? Activate your account here