Environment:
Knox 1.3.0
Hue 4.5
In my setup, Knox intercepts all the requests to Hue and after successful auth redirects the calls with signed cookie to Hue.
As part of this, I updated following in hue.ini:
[[knox]]
knox_principal=knox@EC2.INTERNAL
knox_ports=8442
knox_proxyhosts={hostname}:{port}
[[auth]]
backend=desktop.auth.backend.KnoxSpnegoDjangoBackend
I’m able to load the Hue UI with logged in user as “myuser” but it is unable to load any databases (this works normally with other auth backends so permission is not an issue).
Stacktrace in hue logs:
[16/Dec/2019 17:02:14 -0800] middleware INFO Processing exception: <WSGIRequest: POST ‘/jobbrowser/jobs?doAs=myuser’> is not JSON serializable: Traceback (most recent call last):
File “/usr/lib/hue/build/env/lib/python2.7/site-packages/Django-1.11.22-py2.7.egg/django/core/handlers/base.py”, line 185, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File “/usr/lib/hue/build/env/lib/python2.7/site-packages/Django-1.11.22-py2.7.egg/django/utils/decorators.py”, line 185, in inner
return func(*args, **kwargs)
File “/usr/lib/hue/apps/jobbrowser/src/jobbrowser/views.py”, line 178, in jobs
‘hiveserver2_impersonation_enabled’: hiveserver2_impersonation_enabled()
File “/usr/lib/hue/desktop/core/src/desktop/lib/django_util.py”, line 227, in render
return render_json(data, request.GET.get(“callback”), status=status)
File “/usr/lib/hue/desktop/core/src/desktop/lib/django_util.py”, line 303, in render_json
json = encode_json(data, indent)
File “/usr/lib/hue/desktop/core/src/desktop/lib/django_util.py”, line 275, in encode_json
return json.dumps(data, indent=indent, cls=Encoder)
File “/usr/lib64/python2.7/json/init.py”, line 251, in dumps
sort_keys=sort_keys, **kw).encode(obj)
File “/usr/lib64/python2.7/json/encoder.py”, line 209, in encode
chunks = list(chunks)
File “/usr/lib64/python2.7/json/encoder.py”, line 434, in _iterencode
for chunk in _iterencode_dict(o, _current_indent_level):
File “/usr/lib64/python2.7/json/encoder.py”, line 408, in _iterencode_dict
for chunk in chunks:
File “/usr/lib64/python2.7/json/encoder.py”, line 442, in _iterencode
o = _default(o)
File “/usr/lib/hue/desktop/core/src/desktop/lib/django_util.py”, line 77, in default
return json.JSONEncoder.default(self, o)
File “/usr/lib64/python2.7/json/encoder.py”, line 184, in default
raise TypeError(repr(o) + " is not JSON serializable")
TypeError: <WSGIRequest: POST ‘/jobbrowser/jobs?doAs=myuser’> is not JSON serializable
I do not see any errors in hive server logs.