You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "Chris Nauroth (JIRA)" <ji...@apache.org> on 2013/01/22 08:32:13 UTC

[jira] [Commented] (HADOOP-9232) JniBasedUnixGroupsMappingWithFallback fails on Windows with UnsatisfiedLinkError

    [ https://issues.apache.org/jira/browse/HADOOP-9232?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13559448#comment-13559448 ] 

Chris Nauroth commented on HADOOP-9232:
---------------------------------------

HADOOP-8712 will change the default hadoop.security.group.mapping to {{JniBasedUnixGroupsMappingWithFallback}}.  This will break on Windows.  A workaround would be to manually configure hadoop.security.group.mapping back to {{ShellBasedUnixGroupsMapping}}.

We can fix the problem by providing a proper implementation of the method on Windows in hadoop.dll.  There is already similar logic in the winutils.exe groups command.

To see the problem, start a NameNode and DataNode with hadoop.dll on the path and core-site.xml containing:

{code}
<property>
  <name>hadoop.security.group.mapping</name>
  <value>org.apache.hadoop.security.JniBasedUnixGroupsMappingWithFallback</value>
</property>
{code}

When the DataNode connects to the NameNode, you'll see this stack trace in the NameNode log:

{noformat}
13/01/21 23:19:26 WARN ipc.Server: IPC Server handler 0 on 19000, call org.apache.hadoop.hdfs.server.protocol.DatanodeProtocol.versionRequest from 127.0.0.1:55352: error: java.lang.UnsatisfiedLinkError: org.apache.hadoop.security.JniBasedUnixGroupsMapping.getGroupForUser(Ljava/lang/String;)[Ljava/lang/String;
java.lang.UnsatisfiedLinkError: org.apache.hadoop.security.JniBasedUnixGroupsMapping.getGroupForUser(Ljava/lang/String;)[Ljava/lang/String;
	at org.apache.hadoop.security.JniBasedUnixGroupsMapping.getGroupForUser(Native Method)
	at org.apache.hadoop.security.JniBasedUnixGroupsMapping.getGroups(JniBasedUnixGroupsMapping.java:58)
	at org.apache.hadoop.security.JniBasedUnixGroupsMappingWithFallback.getGroups(JniBasedUnixGroupsMappingWithFallback.java:50)
	at org.apache.hadoop.security.Groups.getGroups(Groups.java:89)
	at org.apache.hadoop.security.UserGroupInformation.getGroupNames(UserGroupInformation.java:1311)
	at org.apache.hadoop.hdfs.server.namenode.FSPermissionChecker.<init>(FSPermissionChecker.java:51)
	at org.apache.hadoop.hdfs.server.namenode.FSPermissionChecker.checkSuperuserPrivilege(FSPermissionChecker.java:72)
	at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.checkSuperuserPrivilege(FSNamesystem.java:4591)
	at org.apache.hadoop.hdfs.server.namenode.NameNodeRpcServer.versionRequest(NameNodeRpcServer.java:962)
	at org.apache.hadoop.hdfs.protocolPB.DatanodeProtocolServerSideTranslatorPB.versionRequest(DatanodeProtocolServerSideTranslatorPB.java:203)
	at org.apache.hadoop.hdfs.protocol.proto.DatanodeProtocolProtos$DatanodeProtocolService$2.callBlockingMethod(DatanodeProtocolProtos.java:18305)
	at org.apache.hadoop.ipc.ProtobufRpcEngine$Server$ProtoBufRpcInvoker.call(ProtobufRpcEngine.java:474)
	at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:1018)
	at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:1778)
	at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:1774)
	at java.security.AccessController.doPrivileged(Native Method)
	at javax.security.auth.Subject.doAs(Subject.java:396)
	at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1450)
	at org.apache.hadoop.ipc.Server$Handler.run(Server.java:1772)
{noformat}

                
> JniBasedUnixGroupsMappingWithFallback fails on Windows with UnsatisfiedLinkError
> --------------------------------------------------------------------------------
>
>                 Key: HADOOP-9232
>                 URL: https://issues.apache.org/jira/browse/HADOOP-9232
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: native, security
>    Affects Versions: trunk-win
>            Reporter: Chris Nauroth
>
> {{JniBasedUnixGroupsMapping}} calls native code which isn't implemented properly for Windows, causing {{UnsatisfiedLinkError}}.  The fallback logic in {{JniBasedUnixGroupsMappingWithFallback}} works by checking if the native code is loaded during startup.  In this case, hadoop.dll is present and loaded, but it doesn't contain the right code.  There will be no attempt to fallback to {{ShellBasedUnixGroupsMapping}}.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira