Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Not able to access Hue UI

avatar
Rising Star

Hi all,

 

I installed Hue on my CDP 7.1.8 cluster recently but not able to access the UI.

 

Here are the screencap when trying to access the UI:

1.

Cannot find site.PNG

2.

Internal error.PNG

 

I have tried a solution found in the Cloudera Community and checked the Bind Hue Server to Wildcard Address option. However, the problem doesn't solved.

wildcard.PNG

 

Please help me out with this issue. Thanks in advanced.

7 REPLIES 7

avatar
Rising Star

Here is more information, from the rungunicornserver.log

 

[22/Mar/2023 19:39:50 -0700] middleware INFO Processing exception: syntax error at or near "ON"
LINE 1: ...oups" ("user_id", "group_id") VALUES (1100713, 1) ON CONFLIC...
^
: Traceback (most recent call last):
File "/opt/cloudera/parcels/CDH-7.1.8-1.cdh7.1.8.p0.30990532/lib/hue/build/env/lib/python3.8/site-packages/django/db/backend s/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
psycopg2.errors.SyntaxError: syntax error at or near "ON"
LINE 1: ...oups" ("user_id", "group_id") VALUES (1100713, 1) ON CONFLIC...
^


The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/opt/cloudera/parcels/CDH-7.1.8-1.cdh7.1.8.p0.30990532/lib/hue/build/env/lib/python3.8/site-packages/django/core/handl ers/base.py", line 181, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/usr/local/lib/python3.8/contextlib.py", line 75, in inner
return func(*args, **kwds)
File "/opt/cloudera/parcels/CDH-7.1.8-1.cdh7.1.8.p0.30990532/lib/hue/desktop/core/ext-py3/django-axes-5.13.0/axes/decorators .py", line 11, in inner
return func(request, *args, **kwargs)
File "/opt/cloudera/parcels/CDH-7.1.8-1.cdh7.1.8.p0.30990532/lib/hue/desktop/core/src/desktop/auth/views.py", line 110, in d t_login
is_first_login_ever = first_login_ever()
File "/opt/cloudera/parcels/CDH-7.1.8-1.cdh7.1.8.p0.30990532/lib/hue/desktop/core/src/desktop/auth/views.py", line 91, in fi rst_login_ever
if hasattr(backend, 'is_first_login_ever') and backend.is_first_login_ever():
File "/opt/cloudera/parcels/CDH-7.1.8-1.cdh7.1.8.p0.30990532/lib/hue/desktop/core/src/desktop/auth/backend.py", line 322, in is_first_login_ever
return User.objects.exclude(id=install_sample_user().id).count() == 0
File "/opt/cloudera/parcels/CDH-7.1.8-1.cdh7.1.8.p0.30990532/lib/hue/apps/useradmin/src/useradmin/models.py", line 371, in i nstall_sample_user
user.groups.add(default_group)
File "/opt/cloudera/parcels/CDH-7.1.8-1.cdh7.1.8.p0.30990532/lib/hue/build/env/lib/python3.8/site-packages/django/db/models/ fields/related_descriptors.py", line 950, in add
self._add_items(
File "/opt/cloudera/parcels/CDH-7.1.8-1.cdh7.1.8.p0.30990532/lib/hue/build/env/lib/python3.8/site-packages/django/db/models/ fields/related_descriptors.py", line 1130, in _add_items
self.through._default_manager.using(db).bulk_create([
File "/opt/cloudera/parcels/CDH-7.1.8-1.cdh7.1.8.p0.30990532/lib/hue/build/env/lib/python3.8/site-packages/django/db/models/ query.py", line 514, in bulk_create
returned_columns = self._batched_insert(
File "/opt/cloudera/parcels/CDH-7.1.8-1.cdh7.1.8.p0.30990532/lib/hue/build/env/lib/python3.8/site-packages/django/db/models/ query.py", line 1293, in _batched_insert
self._insert(item, fields=fields, using=self.db, ignore_conflicts=ignore_conflicts)
File "/opt/cloudera/parcels/CDH-7.1.8-1.cdh7.1.8.p0.30990532/lib/hue/build/env/lib/python3.8/site-packages/django/db/models/ query.py", line 1270, in _insert
return query.get_compiler(using=using).execute_sql(returning_fields)
File "/opt/cloudera/parcels/CDH-7.1.8-1.cdh7.1.8.p0.30990532/lib/hue/build/env/lib/python3.8/site-packages/django/db/models/ sql/compiler.py", line 1416, in execute_sql
cursor.execute(sql, params)
File "/opt/cloudera/parcels/CDH-7.1.8-1.cdh7.1.8.p0.30990532/lib/hue/build/env/lib/python3.8/site-packages/django/db/backend s/utils.py", line 66, in execute
return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
File "/opt/cloudera/parcels/CDH-7.1.8-1.cdh7.1.8.p0.30990532/lib/hue/build/env/lib/python3.8/site-packages/django/db/backend s/utils.py", line 75, in _execute_with_wrappers
return executor(sql, params, many, context)
File "/opt/cloudera/parcels/CDH-7.1.8-1.cdh7.1.8.p0.30990532/lib/hue/build/env/lib/python3.8/site-packages/django/db/backend s/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
File "/opt/cloudera/parcels/CDH-7.1.8-1.cdh7.1.8.p0.30990532/lib/hue/build/env/lib/python3.8/site-packages/django/db/utils.p y", line 90, in __exit__
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/opt/cloudera/parcels/CDH-7.1.8-1.cdh7.1.8.p0.30990532/lib/hue/build/env/lib/python3.8/site-packages/django/db/backend s/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
django.db.utils.ProgrammingError: syntax error at or near "ON"
LINE 1: ...oups" ("user_id", "group_id") VALUES (1100713, 1) ON CONFLIC...

avatar
Rising Star

Here is more information from rungunicornserver.log

hue log1.PNG

hue log2.PNG

Please help me out. Thanks a lot.

avatar
Master Mentor

@BrianChan 

HUE uses a back end database and it would be interesting if you shared the creation steps
The DB configuration is in the hue.ini check the [database] section for the path to the DB (or look at /dump_config/, desktop, database).

 

If MySQL/MariaDB please check the config in /etc/my.cnf

 

 

Spoiler

[mysqld]
...
bind-address=0.0.0.0
default-storage-engine=innodb
sql_mode=STRICT_ALL_TABLES

 


Verify the DB connectivity

Spoiler
mysql -u hue -p
Enter password: <password>
quit

The HUE database file seems gone or not readable

avatar
Rising Star

@Shelton Thank you for your support.

 

I am using PostgreSQL as the back end database. Here is my database server configuration file.

pg_hba.conf.PNG

Anyone from anywhere should able to connect to the database. And I confirm that the database user can access hue database as below.

using hue to access psql.PNG

 

After I turn on the debug mode for Hue, I get the following error message

debug mode message1.PNG

debug mode message2.PNG

 

 

The error is about failure in inserting records to the hue database table. Therefore I tried manually insert the record and I can successfully do the insert.

hue insert to table.PNG

After refresh the tab in browser, no error pops out but I still can't access to the page.

blank.PNG

 

Here is the rungunicornserver.log message

 

 

gunicorn logs.PNG

gunicorn logs2.PNG

 

Include some configuration settings about database on Cloudera console

hue database config.PNG

 

Besides, I have turned on Kerberos and the host that I tried to access the Hue UI is not under the Kerberos realm. But the host and my cluster are in the same network, they can ping each others.

 

Please let me know if I need to provide any additional information. Thank you very much.

avatar
Rising Star

Did somebody come across similar issue?

avatar
New Contributor

Hello, I stumbled upon the same issue, anyone had any solution for this?
Or Do you have the solution already @BrianChan ?

avatar
Expert Contributor

@BrianChan What is the postgres version being used here.  Postgres versions below 9.5 doesn't support ON statement. It is only supported from Postgres 9.5 onwards. Refer https://stackoverflow.com/questions/61774741/psycopg2-errors-syntaxerror-syntax-error-at-or-near-on/...

Also we only support Postgres 10.x or higher versions from CDP 7.1.8.x onwards.
Please check out the support matrix https://supportmatrix.cloudera.com/