Support Questions
Find answers, ask questions, and share your expertise

Ambari view fails

Ambari view fails

Not able to open Hive view and Files View.

Service 'hdfs' check failed:
java.lang.NullPointerException
	at org.apache.hadoop.security.authentication.util.KerberosName.getShortName(KerberosName.java:383)
	at org.apache.hadoop.security.User.<init>(User.java:48)
	at org.apache.hadoop.security.User.<init>(User.java:43)
	at org.apache.hadoop.security.UserGroupInformation.createRemoteUser(UserGroupInformation.java:1270)
	at org.apache.hadoop.security.UserGroupInformation.createRemoteUser(UserGroupInformation.java:1254)
	at org.apache.ambari.view.utils.hdfs.HdfsApi.getProxyUser(HdfsApi.java:78)
	at org.apache.ambari.view.utils.hdfs.HdfsApi.<init>(HdfsApi.java:66)
	at org.apache.ambari.view.utils.hdfs.HdfsUtil.connectToHDFSApi(HdfsUtil.java:127)
	at org.apache.ambari.view.commons.hdfs.HdfsService.hdfsSmokeTest(HdfsService.java:136)
	at org.apache.ambari.view.filebrowser.HelpService.hdfsStatus(HelpService.java:86)
	at sun.reflect.GeneratedMethodAccessor726.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
	at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:205)
	at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
	at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:302)
	at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
	at com.sun.jersey.server.impl.uri.rules.SubLocatorRule.accept(SubLocatorRule.java:137)
	at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
	at com.sun.jersey.server.impl.uri.rules.SubLocatorRule.accept(SubLocatorRule.java:137)
7 REPLIES 7

Re: Ambari view fails

Mentor

@Sam Red

This is a typical issue with the proxy setting for HDFS.

As root log on to the KCD server as shown below, and run the kadmin command.

Use the listprinc ambari* to include only Ambari related principals

Make sure the user accessing the view has a home in hdfs /user/{$username$} otherwise userhome error will appear

# kadmin.local 
kadmin.local: listprincs ambari* 

eg in my case below is my output was

ambari-qa-pomit@TEST.COM 
ambari-server-pomit@TEST.COM 

The principal that has ambari-server is the one we are interested in

Ambari UI-->HDFS-->Configs-->Custom core-site (Filter hadoop.proxyuser)

Values in my cluster are

hadoop.proxyuser.ambari-server-pomit.groups=* 
hadoop.proxyuser.ambari-server-pomit.hosts=* 

If the ain't present

Go to the Manage Ambari-->Views-->Files-->Create new instance mine is version 1.0.0, Please any values but the Display name should have any white spaces

Details

Instance Name = Test 
Display Name =Test_kerberos 
Description = Test view with Kerberos 

Setting

WebHDFS Username = ${username} 
WebHDFS Authorization=auth=KERBEROS;proxyuser=ambari-server-pomit@TEST.COM 
Temporary HDFS Directory* = /user/${username}/files-view/tmp 

Once the above s done save and click Go to Instance you should be able to access the view

Re: Ambari view fails

@Geoffrey Shelton Okot

I followed same steps but still issue is same

Re: Ambari view fails

@Sam Red,

Can you please tell the value of "hadoop.security.auth_to_local" from Advanced core-site.xml (HDFS -> Config -> Advanced Config -> Advanced core-site.xml)

Thanks,

Aditya

Re: Ambari view fails

@Aditya Sirna

Advanced core site

RULE:[1:$1@$0](ambari-XZ-bigdata@RELAY.COM)s/.*/ambari-qa/
RULE:[1:$1@$0](hbase-bigdata@RELAY.COM)s/.*/hbase/
RULE:[1:$1@$0](hdfs-bigdata@RELAY.COM)s/.*/hdfs/
RULE:[1:$1@$0](spark-bigdata@RELAY.COM)s/.*/spark/
RULE:[1:$1@$0](zeppelin-bigdata@RELAY.COM)s/.*/zeppelin/
RULE:[1:$1@$0](.*@RELAY	.COM)s/@.*//
RULE:[2:$1@$0](amshbase@RELAY.COM)s/.*/ams/
RULE:[2:$1@$0](amshbase@RELAY.COM)s/.*/hbase/
RULE:[2:$1@$0](amszk@RELAY.COM)s/.*/ams/
RULE:[2:$1@$0](atlas@RELAY.COM)s/.*/atlas/
RULE:[2:$1@$0](dn@RELAY.COM)s/.*/hdfs/
RULE:[2:$1@$0](falcon@RELAY.COM)s/.*/falcon/
RULE:[2:$1@$0](hbase@RELAY.COM)s/.*/hbase/
RULE:[2:$1@$0](hive@RELAY.COM)s/.*/hive/
RULE:[2:$1@$0](jhs@RELAY.COM)s/.*/mapred/
RULE:[2:$1@$0](jn@RELAY.COM)s/.*/hdfs/
RULE:[2:$1@$0](knox@RELAY.COM)s/.*/knox/
RULE:[2:$1@$0](livy@RELAY.COM)s/.*/livy/
RULE:[2:$1@$0](nfs@RELAY.COM)s/.*/hdfs/
RULE:[2:$1@$0](nm@RELAY.COM)s/.*/yarn/
RULE:[2:$1@$0](nn@RELAY.COM)s/.*/hdfs/
RULE:[2:$1@$0](oozie@RELAY.COM)s/.*/oozie/
RULE:[2:$1@$0](rangeradmin@RELAY.COM)s/.*/ranger/
RULE:[2:$1@$0](rangertagsync@RELAY.COM)s/.*/rangertagsync/
RULE:[2:$1@$0](rangerusersync@RELAY.COM)s/.*/rangerusersync/
RULE:[2:$1@$0](rm@RELAY.COM)s/.*/yarn/
RULE:[2:$1@$0](yarn@RELAY.COM)s/.*/yarn/
DEFAULT

Re: Ambari view fails

Mentor

@Sam Red

That's bizarre what is the error this time.

Can you paste her the screen capture of the Ambari views

-Settings

And the values of

- hadoop.proxyuser.*

And also the

# kadmin.local
kadmin.local: listprincs ambari*


And also the log /var/log/ambari-server/files-view

Re: Ambari view fails

@Geoffrey Shelton Okot

No log file files-view log is empty

Service 'hdfs' check failed:
java.lang.NullPointerException
	at org.apache.hadoop.security.authentication.util.KerberosName.getShortName(KerberosName.java:383)
	at org.apache.hadoop.security.User.<init>(User.java:48)
	at org.apache.hadoop.security.User.<init>(User.java:43)
	at org.apache.hadoop.security.UserGroupInformation.createRemoteUser(UserGroupInformation.java:1270)
	at org.apache.hadoop.security.UserGroupInformation.createRemoteUser(UserGroupInformation.java:1254)
	at org.apache.ambari.view.utils.hdfs.HdfsApi.getProxyUser(HdfsApi.java:78)
	at org.apache.ambari.view.utils.hdfs.HdfsApi.<init>(HdfsApi.java:66)
	at org.apache.ambari.view.utils.hdfs.HdfsUtil.connectToHDFSApi(HdfsUtil.java:127)
	at org.apache.ambari.view.commons.hdfs.HdfsService.hdfsSmokeTest(HdfsService.java:136)
	at org.apache.ambari.view.filebrowser.HelpService.hdfsStatus(HelpService.java:86)
	at sun.reflect.GeneratedMethodAccessor726.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
	at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:205)
	at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
	at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:302)
	at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
	at com.sun.jersey.server.impl.uri.rules.SubLocatorRule.accept(SubLocatorRule.java:137)
	at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
	at com.sun.jersey.server.impl.uri.rules.SubLocatorRule.accept(SubLocatorRule.java:137)
	at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
	at com.sun.jersey.server.impl.uri.rules.SubLocatorRule.accept(SubLocatorRule.java:137)
	at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
	at com.sun.jersey.server.impl.uri.rules.SubLocatorRule.accept(SubLocatorRule.java:137)
	at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
	at com.sun.jersey.server.impl.uri.rules.SubLocatorRule.accept(SubLocatorRule.java:137)
	at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
	at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)
	at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
	at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)
	at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1542)
	at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1473)

Re: Ambari view fails

Mentor

@Sam Red

The following error indicates that the auth principle format is not correct.

java.lang.NullPointerExceptionat org.apache.hadoop.security.authentication.util.KerberosName.getShortName(KerberosName.java:383) 

# Can you create a new "FileView" instance

Ambari UI --> "admin" --> "Manage Ambari" --> "Views" --> "FILES" --> "Create Instance"

# If you are logging in to the File View using "admin" user then it need to have the "admin" userhome created in HDFS with the correct owner permissions as following:

# hdfs dfs -mkdir /user/admin 
# hdfs dfs -chown admin /user/admin 

# Can you double check if "proxyuser" in the Services > HDFS > Configs. Under the Advanced tab, navigate to the Custom core-site section. (Add property) is set correctly or not.

In the following example we are assuming that ambari is running with "root" user so the following setting as follows:

hadoop.proxyuser.root.groups=* 
hadoop.proxyuser.root.hosts=* 

# Can you also give me the values of HDFS-->Config-->Advanced-->Custom Core site-->filter "hadoop.proxyuser"

# From the file views give me the value for "WebHDFS Authorization"