Reply
Explorer
Posts: 6
Registered: ‎06-16-2017

User: root is not allowed to impersonate <username>

[ Edited ]

Hi,

I have installed Hue 3.12. and beside that I have installed amabri on HDP2.6.
I'm trying to connect my Hue with Ambari and this is the last error I'm getting for HBASE:

RestException: <html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
<title>Error 500 User: root is not allowed to impersonate imajnaric</title>
</head>
<body><h2>HTTP ERROR 500</h2>
<p>Problem accessing /. Reason:
<pre> User: root is not allowed to impersonate imajnaric</pre></p><h3>Caused by:</h3><pre>javax.servlet.ServletException: User: root is not allowed to impersonate imajnaric
at org.apache.hadoop.hbase.thrift.ThriftHttpServlet.doPost(ThriftHttpServlet.java:117)

I don't know what I'm missing because I added all of this in my core-site.xml: lel.jpg

 

 

Also in HBASE have this: 

hbase.regionserver.thrift.http:true
 
hbase.thrift.support.proxyuser:true

Any ideas?

 

UPDATE 1: 

 

Also I have

[hbase]
use_doas=true

In hue.ini.  If I remove the same, I'm getting this kind of error: 

 

 ERROR    Failed to authenticate to HBase Thrift Server, check authentication configurations.
Traceback (most recent call last):
  File "/usr/local/hue/apps/hbase/src/hbase/conf.py", line 81, in config_validator
    api.getTableList(cluster_name)
  File "/usr/local/hue/apps/hbase/src/hbase/api.py", line 140, in getTableList
    return [{'name': name, 'enabled': client.isTableEnabled(name, doas=self.user.username)} for name in client.getTableNames(doas=self.user.username)]
  File "/usr/local/hue/desktop/core/src/desktop/lib/thrift_util.py", line 389, in wrapper
    raise StructuredThriftTransportException(e, error_code=502)
StructuredThriftTransportException: TSocket read 0 bytes (code THRIFTTRANSPORT): TTransportException('TSocket read 0 bytes',)
[17/Jun/2017 13:22:26 +0200] thrift_util  INFO     Thrift saw a transport exception: TSocket read 0 bytes
[17/Jun/2017 13:22:26 +0200] thrift_util  WARNING  Out of retries for thrift call: getTableNames
[17/Jun/2017 13:22:26 +0200] thrift_util  DEBUG    Thrift call: hbased.Hbase.Client.getTableNames(args=(), kwargs={'doas': u'imajnaric'})
[17/Jun/2017 13:22:26 +0200] thrift_util  INFO     Thrift exception; retrying: TSocket read 0 bytes
[17/Jun/2017 13:22:26 +0200] thrift_util  DEBUG    Thrift call: hbased.Hbase.Client.getTableNames(args=(), kwargs={'doas': u'imajnaric'})
[17/Jun/2017 13:22:26 +0200] thrift_util  INFO     Thrift exception; retrying: TSocket read 0 bytes
[17/Jun/2017 13:22:26 +0200] thrift_util  DEBUG    Thrift call: hbased.Hbase.Client.getTableNames(args=(), kwargs={'doas': u'imajnaric'})
[17/Jun/2017 13:22:26 +0200] api          ERROR    failed to load the HBase clusters
Traceback (most recent call last):
  File "/usr/local/hue/apps/hbase/src/hbase/api.py", line 64, in getClusters
    full_config = json.loads(conf.HBASE_CLUSTERS.get().replace("'", "\""))
  File "/usr/lib64/python2.7/json/__init__.py", line 338, in loads
    return _default_decoder.decode(s)
  File "/usr/lib64/python2.7/json/decoder.py", line 366, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib64/python2.7/json/decoder.py", line 384, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
[17/Jun/2017 13:22:26 +0200] api          ERROR    failed to load the HBase clusters
Traceback (most recent call last):
  File "/usr/local/hue/apps/hbase/src/hbase/api.py", line 64, in getClusters
    full_config = json.loads(conf.HBASE_CLUSTERS.get().replace("'", "\""))
  File "/usr/lib64/python2.7/json/__init__.py", line 338, in loads
    return _default_decoder.decode(s)
  File "/usr/lib64/python2.7/json/decoder.py", line 366, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib64/python2.7/json/decoder.py", line 384, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
Posts: 566
Topics: 3
Kudos: 79
Solutions: 52
Registered: ‎08-16-2016

Re: User: root is not allowed to impersonate <username>

The issue is that the processes are running as root but the hadoop.proxy.*.[groups|hosts] is for hue. Either have the HUE process run under the user hue (preferred) or add the setting hadoop.proxy.root.[users|groups] to allow root to impersonate users.
Explorer
Posts: 6
Registered: ‎06-16-2017

Re: User: root is not allowed to impersonate <username>

[ Edited ]

I did it. Added as you said hadoop.proxy.root.users and hadoo.proxy.root.groups and now there is no authentication error, but for some reason he can't get Hbase Cluster.

 

This is my setting (Cluster | my_hbase_master_ip:9090)

And in Hue I'm getting this:

ERROR failed to load the HBase clusters
Traceback (most recent call last):
File "/usr/local/hue/apps/hbase/src/hbase/api.py", line 64, in getClusters
full_config = json.loads(conf.HBASE_CLUSTERS.get().replace("'", "\""))
File "/usr/lib64/python2.7/json/__init__.py", line 338, in loads
return _default_decoder.decode(s)
File "/usr/lib64/python2.7/json/decoder.py", line 366, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib64/python2.7/json/decoder.py", line 384, in raw_decode
raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
Posts: 566
Topics: 3
Kudos: 79
Solutions: 52
Registered: ‎08-16-2016

Re: User: root is not allowed to impersonate <username>

I'd have to dig into the HUE code to figure this out. On the surface it seems to be using the HBase API to get the configuration of the HBase cluster.

Confirm that the HBase cluster is on and accessible.
Ensure that the HUE configuration has the HBase cluster selected. In HUE configuration search for "HBase Service". You should see the simple name given to the HBase service in CM. Make sure it is selected and not set to None.
Explorer
Posts: 6
Registered: ‎06-16-2017

Re: User: root is not allowed to impersonate <username>

[ Edited ]

Can you confirm this is good setup I made in Hadoop

 hadoop.proxy.root.users=*
 hadoo.proxy.root.groups=*

 

I'm using Ambari HDP2.6

hbase.png

 

So, Hbase Maser is accessible, even tried to ping it.

 

Via terminal I turned on Hbase Thrift and set it on port 9090 as you can see here:

hbase2.png

 

Afterwards in my hue.ini, my configuration for HBase cluster is next:

hbase3.png

 

The only thing I'm not sure of is "cluster" in hbase_clusters but I read that what ever you set will be alright cuz I can't find any name in my Hbase confs.

 

Does this make easier for you?

 

UPDATE 1:

i'm sure that servers (and thrift) are up because of this log which Hue is providing:

[19/Jun/2017 13:42:32 +0200] thrift_util  DEBUG    Thrift call hbased.Hbase.Client.getTableNames returned in 34ms: []

[19/Jun/2017 13:42:32 +0200] resource     DEBUG    POST Got response: �
getTableNames

[19/Jun/2017 13:42:32 +0200] connectionpool DEBUG    "bigdataxxxx:9090 POST / HTTP/1.1" 200 None

[19/Jun/2017 13:42:32 +0200] connectionpool INFO     Starting new HTTP connection (1): bigdataxxxx:9090

[19/Jun/2017 13:42:32 +0200] thrift_util  DEBUG    Thrift call: hbased.Hbase.Client.getTableNames(args=(), kwargs={'doas': u'imajnaric'})

[19/Jun/2017 13:42:32 +0200] api          ERROR    failed to load the HBase clusters
Traceback (most recent call last):
  File "/usr/local/hue/apps/hbase/src/hbase/api.py", line 64, in getClusters
    full_config = json.loads(conf.HBASE_CLUSTERS.get().replace("'", "\""))
  File "/usr/lib64/python2.7/json/__init__.py", line 338, in loads
    return _default_decoder.decode(s)
  File "/usr/lib64/python2.7/json/decoder.py", line 366, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib64/python2.7/json/decoder.py", line 384, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded

 

 

UPDATE 2:

 

This is really wierd. I'm still getting the same error, but if I try to create table via Hue in HBase i works "just fine". With "just fine" I think that I sucessfully created table in HBase but this is log which is produced afterwards:

[19/Jun/2017 14:00:39 +0200] thrift_util  DEBUG    Thrift call: hbased.Hbase.Client.scannerOpenWithScan(args=(u'testTable', TScan(stopRow=None, filterString='(ColumnPaginationFilter(500,0) AND PageFilter(500))', timestamp=None, batchSize=None, startRow='', caching=None, columns=[]), None), kwargs={'doas': u'imajnaric'})

[19/Jun/2017 14:00:39 +0200] api          ERROR    failed to load the HBase clusters
Traceback (most recent call last):
  File "/usr/local/hue/apps/hbase/src/hbase/api.py", line 64, in getClusters
    full_config = json.loads(conf.HBASE_CLUSTERS.get().replace("'", "\""))
  File "/usr/lib64/python2.7/json/__init__.py", line 338, in loads
    return _default_decoder.decode(s)
  File "/usr/lib64/python2.7/json/decoder.py", line 366, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib64/python2.7/json/decoder.py", line 384, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded

[19/Jun/2017 14:00:39 +0200] views        ERROR    failed to parse input as json
Traceback (most recent call last):
  File "/usr/local/hue/apps/hbase/src/hbase/views.py", line 55, in safe_json_load
    return json.loads(re.sub(r'(?:\")([0-9]+)(?:\")', r'\1', str(raw)))
  File "/usr/lib64/python2.7/json/__init__.py", line 338, in loads
    return _default_decoder.decode(s)
  File "/usr/lib64/python2.7/json/decoder.py", line 366, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib64/python2.7/json/decoder.py", line 384, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded

[19/Jun/2017 14:00:39 +0200] views        ERROR    failed to parse input as json
Traceback (most recent call last):
  File "/usr/local/hue/apps/hbase/src/hbase/views.py", line 55, in safe_json_load
    return json.loads(re.sub(r'(?:\")([0-9]+)(?:\")', r'\1', str(raw)))
  File "/usr/lib64/python2.7/json/__init__.py", line 338, in loads
    return _default_decoder.decode(s)
  File "/usr/lib64/python2.7/json/decoder.py", line 366, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib64/python2.7/json/decoder.py", line 384, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded

[19/Jun/2017 14:00:39 +0200] views        ERROR    failed to parse input as json
Traceback (most recent call last):
  File "/usr/local/hue/apps/hbase/src/hbase/views.py", line 55, in safe_json_load
    return json.loads(re.sub(r'(?:\")([0-9]+)(?:\")', r'\1', str(raw)))
  File "/usr/lib64/python2.7/json/__init__.py", line 338, in loads
    return _default_decoder.decode(s)
  File "/usr/lib64/python2.7/json/decoder.py", line 366, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib64/python2.7/json/decoder.py", line 384, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
Highlighted
Explorer
Posts: 6
Registered: ‎06-16-2017

Re: User: root is not allowed to impersonate <username>

**BUMP**

Announcements