Q:

Hadoop MapReduce Job Permission Denied

I'm trying to run a map reduce job to get the count of users in a table using Hive.  I'm getting an AccessControlException in doing so. 
Message on the command prompt:
hive> select count(*) from bxbookratings;
Query ID = nikhilbarar_20160726214949_ddeb51ca-4833-48af-88ec-3a1129b5f741
Total jobs = 1
Launching Job 1 out of 1
Number of reduce tasks determined at compile time: 1
In order to change the average load for a reducer (in bytes):
  set hive.exec.reducers.bytes.per.reducer=<number>
In order to limit the maximum number of reducers:
  set hive.exec.reducers.max=<number>
In order to set a constant number of reducers:
  set mapreduce.job.reduces=<number>
Starting Job = job_1469549467032_0001, Tracking URL = http://nikhil3145167:8088/proxy/application_1469549467
032_0001/
Kill Command = C:\hdp\hadoop-2.4.0.2.1.3.0-1981\bin\hadoop.cmd job  -kill job_1469549467032_0001
Hadoop job information for Stage-1: number of mappers: 1; number of reducers: 1
2016-07-26 21:49:39,779 Stage-1 map = 0%,  reduce = 0%
2016-07-26 21:49:54,343 Stage-1 map = 100%,  reduce = 100%
Ended Job = job_1469549467032_0001 with errors
Error during job, obtaining debugging information...
Examining task ID: task_1469549467032_0001_m_000000 (and more) from job job_1469549467032_0001

Task with the most failures(4):
-----
Task ID:
  task_1469549467032_0001_m_000000

URL:
  http://nikhil3145167:8088/taskdetails.jsp?jobid=job_1469549467032_0001&tipid=task_1469549467032_0001_m_000
000
-----
Diagnostic Messages for this Task:
Error: org.apache.hadoop.io.nativeio. NativeIO$Windows.access0(Ljava/lang/String;I)Z

FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.mr. MapRedTask
MapReduce Jobs Launched:
Job 0: Map: 1  Reduce: 1   HDFS Read: 0 HDFS Write: 0 FAIL
Total MapReduce CPU Time Spent: 0 msec

Part of the SysLog of the Job, containing the stack trace of the exception:
2016-07-26 21:12:34,019 INFO [eventHandlingThread] org.apache.hadoop.mapreduce.jobhistory. JobHistoryEventHandler: Unable to write out JobSummaryInfo to [hdfs://NIKHIL3145167:8020/mapred/history/done_intermediate/nikhilbarar/job_1469547478230_0001.summary_tmp]
org.apache.hadoop.security. AccessControlException: Permission denied: user=nikhilbarar, access=EXECUTE, inode="/mapred":hadoop:hdfs:drwxrwx---
    at org.apache.hadoop.hdfs.server.namenode. FSPermissionChecker.checkFsPermission(FSPermissionChecker.java:265)
    at org.apache.hadoop.hdfs.server.namenode. FSPermissionChecker.check(FSPermissionChecker.java:251)
    at org.apache.hadoop.hdfs.server.namenode. FSPermissionChecker.checkTraverse(FSPermissionChecker.java:205)
    at org.apache.hadoop.hdfs.server.namenode. FSPermissionChecker.checkPermission(FSPermissionChecker.java:168)
    at org.apache.hadoop.hdfs.server.namenode. FSNamesystem.checkPermission(FSNamesystem.java:5515)
    at org.apache.hadoop.hdfs.server.namenode. FSNamesystem.checkPermission(FSNamesystem.java:5497)
    at org.apache.hadoop.hdfs.server.namenode. FSNamesystem.checkOwner(FSNamesystem.java:5453)
    at org.apache.hadoop.hdfs.server.namenode. FSNamesystem.setPermissionInt(FSNamesystem.java:1563)
    at org.apache.hadoop.hdfs.server.namenode. FSNamesystem.setPermission(FSNamesystem.java:1544)
    at org.apache.hadoop.hdfs.server.namenode. NameNodeRpcServer.setPermission(NameNodeRpcServer.java:563)
    at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolServerSideTranslatorPB.setPermission(ClientNamenodeProtocolServerSideTranslatorPB.java:401)
    at org.apache.hadoop.hdfs.protocol.proto. ClientNamenodeProtocolProtos$ClientNamenodeProtocol$2.callBlockingMethod(ClientNamenodeProtocolProtos.java)
    at org.apache.hadoop.ipc. ProtobufRpcEngine$Server$ProtoBufRpcInvoker.call(ProtobufRpcEngine.java:585)
    at org.apache.hadoop.ipc. RPC$Server.call(RPC.java:928)
    at org.apache.hadoop.ipc. Server$Handler$1.run(Server.java:2013)
    at org.apache.hadoop.ipc. Server$Handler$1.run(Server.java:2009)
    at java.security. AccessController.doPrivileged(Native Method)
    at javax.security.auth. Subject.doAs(Subject.java:415)
    at org.apache.hadoop.security. UserGroupInformation.doAs(UserGroupInformation.java:1594)
    at org.apache.hadoop.ipc. Server$Handler.run(Server.java:2007)

    at sun.reflect. NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect. NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect. DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect. Constructor.newInstance(Constructor.java:526)
    at org.apache.hadoop.ipc. RemoteException.instantiateException(RemoteException.java:106)
    at org.apache.hadoop.ipc. RemoteException.unwrapRemoteException(RemoteException.java:73)
    at org.apache.hadoop.hdfs. DFSClient.setPermission(DFSClient.java:2131)
    at org.apache.hadoop.hdfs. DistributedFileSystem$22.doCall(DistributedFileSystem.java:1266)
    at org.apache.hadoop.hdfs. DistributedFileSystem$22.doCall(DistributedFileSystem.java:1262)
    at org.apache.hadoop.fs. FileSystemLinkResolver.resolve(FileSystemLinkResolver.java:81)
    at org.apache.hadoop.hdfs. DistributedFileSystem.setPermission(DistributedFileSystem.java:1262)
    at org.apache.hadoop.mapreduce.jobhistory. JobHistoryEventHandler.processDoneFiles(JobHistoryEventHandler.java:733)
    at org.apache.hadoop.mapreduce.jobhistory. JobHistoryEventHandler.handleEvent(JobHistoryEventHandler.java:597)
    at org.apache.hadoop.mapreduce.jobhistory. JobHistoryEventHandler$1.run(JobHistoryEventHandler.java:280)
    at java.lang. Thread.run(Thread.java:745)
Caused by: org.apache.hadoop.ipc. RemoteException(org.apache.hadoop.security. AccessControlException): Permission denied: user=nikhilbarar, access=EXECUTE, inode="/mapred":hadoop:hdfs:drwxrwx---
    at org.apache.hadoop.hdfs.server.namenode. FSPermissionChecker.checkFsPermission(FSPermissionChecker.java:265)
    at org.apache.hadoop.hdfs.server.namenode. FSPermissionChecker.check(FSPermissionChecker.java:251)
    at org.apache.hadoop.hdfs.server.namenode. FSPermissionChecker.checkTraverse(FSPermissionChecker.java:205)
    at org.apache.hadoop.hdfs.server.namenode. FSPermissionChecker.checkPermission(FSPermissionChecker.java:168)
    at org.apache.hadoop.hdfs.server.namenode. FSNamesystem.checkPermission(FSNamesystem.java:5515)
    at org.apache.hadoop.hdfs.server.namenode. FSNamesystem.checkPermission(FSNamesystem.java:5497)
    at org.apache.hadoop.hdfs.server.namenode. FSNamesystem.checkOwner(FSNamesystem.java:5453)
    at org.apache.hadoop.hdfs.server.namenode. FSNamesystem.setPermissionInt(FSNamesystem.java:1563)
    at org.apache.hadoop.hdfs.server.namenode. FSNamesystem.setPermission(FSNamesystem.java:1544)
    at org.apache.hadoop.hdfs.server.namenode. NameNodeRpcServer.setPermission(NameNodeRpcServer.java:563)
    at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolServerSideTranslatorPB.setPermission(ClientNamenodeProtocolServerSideTranslatorPB.java:401)
    at org.apache.hadoop.hdfs.protocol.proto. ClientNamenodeProtocolProtos$ClientNamenodeProtocol$2.callBlockingMethod(ClientNamenodeProtocolProtos.java)
    at org.apache.hadoop.ipc. ProtobufRpcEngine$Server$ProtoBufRpcInvoker.call(ProtobufRpcEngine.java:585)
    at org.apache.hadoop.ipc. RPC$Server.call(RPC.java:928)
    at org.apache.hadoop.ipc. Server$Handler$1.run(Server.java:2013)
    at org.apache.hadoop.ipc. Server$Handler$1.run(Server.java:2009)
    at java.security. AccessController.doPrivileged(Native Method)
    at javax.security.auth. Subject.doAs(Subject.java:415)
    at org.apache.hadoop.security. UserGroupInformation.doAs(UserGroupInformation.java:1594)
    at org.apache.hadoop.ipc. Server$Handler.run(Server.java:2007)

    at org.apache.hadoop.ipc. Client.call(Client.java:1410)
    at org.apache.hadoop.ipc. Client.call(Client.java:1363)
    at org.apache.hadoop.ipc. ProtobufRpcEngine$Invoker.invoke(ProtobufRpcEngine.java:206)
    at com.sun.proxy.$Proxy14.setPermission(Unknown Source)
    at sun.reflect. NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect. NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect. DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect. Method.invoke(Method.java:606)
    at org.apache.hadoop.io.retry. RetryInvocationHandler.invokeMethod(RetryInvocationHandler.java:190)
    at org.apache.hadoop.io.retry. RetryInvocationHandler.invoke(RetryInvocationHandler.java:103)
    at com.sun.proxy.$Proxy14.setPermission(Unknown Source)
    at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolTranslatorPB.setPermission(ClientNamenodeProtocolTranslatorPB.java:308)
    at org.apache.hadoop.hdfs. DFSClient.setPermission(DFSClient.java:2129)
    ... 8 more
2016-07-26 21:12:34,021 ERROR [eventHandlingThread] org.apache.hadoop.yarn. YarnUncaughtExceptionHandler: Thread Thread[eventHandlingThread,5,main] threw an Exception. 
org.apache.hadoop.yarn.exceptions. YarnRuntimeException: org.apache.hadoop.security. AccessControlException: Permission denied: user=nikhilbarar, access=EXECUTE, inode="/mapred":hadoop:hdfs:drwxrwx---
    at org.apache.hadoop.hdfs.server.namenode. FSPermissionChecker.checkFsPermission(FSPermissionChecker.java:265)
    at org.apache.hadoop.hdfs.server.namenode. FSPermissionChecker.check(FSPermissionChecker.java:251)
    at org.apache.hadoop.hdfs.server.namenode. FSPermissionChecker.checkTraverse(FSPermissionChecker.java:205)
    at org.apache.hadoop.hdfs.server.namenode. FSPermissionChecker.checkPermission(FSPermissionChecker.java:168)
    at org.apache.hadoop.hdfs.server.namenode. FSNamesystem.checkPermission(FSNamesystem.java:5515)
    at org.apache.hadoop.hdfs.server.namenode. FSNamesystem.checkPermission(FSNamesystem.java:5497)
    at org.apache.hadoop.hdfs.server.namenode. FSNamesystem.checkOwner(FSNamesystem.java:5453)
    at org.apache.hadoop.hdfs.server.namenode. FSNamesystem.setPermissionInt(FSNamesystem.java:1563)
    at org.apache.hadoop.hdfs.server.namenode. FSNamesystem.setPermission(FSNamesystem.java:1544)
    at org.apache.hadoop.hdfs.server.namenode. NameNodeRpcServer.setPermission(NameNodeRpcServer.java:563)
    at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolServerSideTranslatorPB.setPermission(ClientNamenodeProtocolServerSideTranslatorPB.java:401)
    at org.apache.hadoop.hdfs.protocol.proto. ClientNamenodeProtocolProtos$ClientNamenodeProtocol$2.callBlockingMethod(ClientNamenodeProtocolProtos.java)
    at org.apache.hadoop.ipc. ProtobufRpcEngine$Server$ProtoBufRpcInvoker.call(ProtobufRpcEngine.java:585)
    at org.apache.hadoop.ipc. RPC$Server.call(RPC.java:928)
    at org.apache.hadoop.ipc. Server$Handler$1.run(Server.java:2013)
    at org.apache.hadoop.ipc. Server$Handler$1.run(Server.java:2009)
    at java.security. AccessController.doPrivileged(Native Method)
    at javax.security.auth. Subject.doAs(Subject.java:415)
    at org.apache.hadoop.security. UserGroupInformation.doAs(UserGroupInformation.java:1594)
    at org.apache.hadoop.ipc. Server$Handler.run(Server.java:2007)

    at org.apache.hadoop.mapreduce.jobhistory. JobHistoryEventHandler.handleEvent(JobHistoryEventHandler.java:599)
    at org.apache.hadoop.mapreduce.jobhistory. JobHistoryEventHandler$1.run(JobHistoryEventHandler.java:280)
    at java.lang. Thread.run(Thread.java:745)
Caused by: org.apache.hadoop.security. AccessControlException: Permission denied: user=nikhilbarar, access=EXECUTE, inode="/mapred":hadoop:hdfs:drwxrwx---
    at org.apache.hadoop.hdfs.server.namenode. FSPermissionChecker.checkFsPermission(FSPermissionChecker.java:265)
    at org.apache.hadoop.hdfs.server.namenode. FSPermissionChecker.check(FSPermissionChecker.java:251)
    at org.apache.hadoop.hdfs.server.namenode. FSPermissionChecker.checkTraverse(FSPermissionChecker.java:205)
    at org.apache.hadoop.hdfs.server.namenode. FSPermissionChecker.checkPermission(FSPermissionChecker.java:168)
    at org.apache.hadoop.hdfs.server.namenode. FSNamesystem.checkPermission(FSNamesystem.java:5515)
    at org.apache.hadoop.hdfs.server.namenode. FSNamesystem.checkPermission(FSNamesystem.java:5497)
    at org.apache.hadoop.hdfs.server.namenode. FSNamesystem.checkOwner(FSNamesystem.java:5453)
    at org.apache.hadoop.hdfs.server.namenode. FSNamesystem.setPermissionInt(FSNamesystem.java:1563)
    at org.apache.hadoop.hdfs.server.namenode. FSNamesystem.setPermission(FSNamesystem.java:1544)
    at org.apache.hadoop.hdfs.server.namenode. NameNodeRpcServer.setPermission(NameNodeRpcServer.java:563)
    at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolServerSideTranslatorPB.setPermission(ClientNamenodeProtocolServerSideTranslatorPB.java:401)
    at org.apache.hadoop.hdfs.protocol.proto. ClientNamenodeProtocolProtos$ClientNamenodeProtocol$2.callBlockingMethod(ClientNamenodeProtocolProtos.java)
    at org.apache.hadoop.ipc. ProtobufRpcEngine$Server$ProtoBufRpcInvoker.call(ProtobufRpcEngine.java:585)
    at org.apache.hadoop.ipc. RPC$Server.call(RPC.java:928)
    at org.apache.hadoop.ipc. Server$Handler$1.run(Server.java:2013)
    at org.apache.hadoop.ipc. Server$Handler$1.run(Server.java:2009)
    at java.security. AccessController.doPrivileged(Native Method)
    at javax.security.auth. Subject.doAs(Subject.java:415)
    at org.apache.hadoop.security. UserGroupInformation.doAs(UserGroupInformation.java:1594)
    at org.apache.hadoop.ipc. Server$Handler.run(Server.java:2007)

    at sun.reflect. NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect. NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect. DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect. Constructor.newInstance(Constructor.java:526)
    at org.apache.hadoop.ipc. RemoteException.instantiateException(RemoteException.java:106)
    at org.apache.hadoop.ipc. RemoteException.unwrapRemoteException(RemoteException.java:73)
    at org.apache.hadoop.hdfs. DFSClient.setPermission(DFSClient.java:2131)
    at org.apache.hadoop.hdfs. DistributedFileSystem$22.doCall(DistributedFileSystem.java:1266)
    at org.apache.hadoop.hdfs. DistributedFileSystem$22.doCall(DistributedFileSystem.java:1262)
    at org.apache.hadoop.fs. FileSystemLinkResolver.resolve(FileSystemLinkResolver.java:81)
    at org.apache.hadoop.hdfs. DistributedFileSystem.setPermission(DistributedFileSystem.java:1262)
    at org.apache.hadoop.mapreduce.jobhistory. JobHistoryEventHandler.processDoneFiles(JobHistoryEventHandler.java:733)
    at org.apache.hadoop.mapreduce.jobhistory. JobHistoryEventHandler.handleEvent(JobHistoryEventHandler.java:597)
    ... 2 more
Caused by: org.apache.hadoop.ipc. RemoteException(org.apache.hadoop.security. AccessControlException): Permission denied: user=nikhilbarar, access=EXECUTE, inode="/mapred":hadoop:hdfs:drwxrwx---
    at org.apache.hadoop.hdfs.server.namenode. FSPermissionChecker.checkFsPermission(FSPermissionChecker.java:265)
    at org.apache.hadoop.hdfs.server.namenode. FSPermissionChecker.check(FSPermissionChecker.java:251)
    at org.apache.hadoop.hdfs.server.namenode. FSPermissionChecker.checkTraverse(FSPermissionChecker.java:205)
    at org.apache.hadoop.hdfs.server.namenode. FSPermissionChecker.checkPermission(FSPermissionChecker.java:168)
    at org.apache.hadoop.hdfs.server.namenode. FSNamesystem.checkPermission(FSNamesystem.java:5515)
    at org.apache.hadoop.hdfs.server.namenode. FSNamesystem.checkPermission(FSNamesystem.java:5497)
    at org.apache.hadoop.hdfs.server.namenode. FSNamesystem.checkOwner(FSNamesystem.java:5453)
    at org.apache.hadoop.hdfs.server.namenode. FSNamesystem.setPermissionInt(FSNamesystem.java:1563)
    at org.apache.hadoop.hdfs.server.namenode. FSNamesystem.setPermission(FSNamesystem.java:1544)
    at org.apache.hadoop.hdfs.server.namenode. NameNodeRpcServer.setPermission(NameNodeRpcServer.java:563)
    at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolServerSideTranslatorPB.setPermission(ClientNamenodeProtocolServerSideTranslatorPB.java:401)
    at org.apache.hadoop.hdfs.protocol.proto. ClientNamenodeProtocolProtos$ClientNamenodeProtocol$2.callBlockingMethod(ClientNamenodeProtocolProtos.java)
    at org.apache.hadoop.ipc. ProtobufRpcEngine$Server$ProtoBufRpcInvoker.call(ProtobufRpcEngine.java:585)
    at org.apache.hadoop.ipc. RPC$Server.call(RPC.java:928)
    at org.apache.hadoop.ipc. Server$Handler$1.run(Server.java:2013)
    at org.apache.hadoop.ipc. Server$Handler$1.run(Server.java:2009)
    at java.security. AccessController.doPrivileged(Native Method)
    at javax.security.auth. Subject.doAs(Subject.java:415)
    at org.apache.hadoop.security. UserGroupInformation.doAs(UserGroupInformation.java:1594)
    at org.apache.hadoop.ipc. Server$Handler.run(Server.java:2007)

    at org.apache.hadoop.ipc. Client.call(Client.java:1410)
    at org.apache.hadoop.ipc. Client.call(Client.java:1363)
    at org.apache.hadoop.ipc. ProtobufRpcEngine$Invoker.invoke(ProtobufRpcEngine.java:206)
    at com.sun.proxy.$Proxy14.setPermission(Unknown Source)
    at sun.reflect. NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect. NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect. DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect. Method.invoke(Method.java:606)
    at org.apache.hadoop.io.retry. RetryInvocationHandler.invokeMethod(RetryInvocationHandler.java:190)
    at org.apache.hadoop.io.retry. RetryInvocationHandler.invoke(RetryInvocationHandler.java:103)
    at com.sun.proxy.$Proxy14.setPermission(Unknown Source)
    at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolTranslatorPB.setPermission(ClientNamenodeProtocolTranslatorPB.java:308)
    at org.apache.hadoop.hdfs. DFSClient.setPermission(DFSClient.java:2129)
    ... 8 more
2016-07-26 21:12:34,021 INFO [Thread-61] org.apache.hadoop.mapreduce.jobhistory. JobHistoryEventHandler: Stopped JobHistoryEventHandler.  super.stop()

Please help me in resolving this. 

A:

you can disable hdfs permission by setting the below property to false in hdfs-site.xml
<property>
<name>dfs.permissions.enabled</name>
<value>false</value>
</property>

after setting this property to false hdfs needs to be restarted. 
Also, This hdfs_permissions_guide page advice to use net group for windows to manage groups.  I think you can use this to add hiveuser in nikhilbarar group: see-net-group-usage.