Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-13810

insert overwrite select from some table fails throwing org.apache.hadoop.security.AccessControlException

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.1.0
    • None
    • None

    Description

      When running using beeline (as a non hdfs user)

       CREATE  EXTERNAL TABLE Batters_txt(
             Player STRING ,
             Team STRING ,
             League STRING ,
             Year SMALLINT,
             Games DOUBLE,
             AB DOUBLE,
             R DOUBLE,
             H DOUBLE,
             Doubles DOUBLE,
             Triples DOUBLE,
             HR DOUBLE,
             RBI DOUBLE,
             SB DOUBLE,
             CS DOUBLE,
             BB DOUBLE,
             SO DOUBLE,
             IBB DOUBLE,
             HBP DOUBLE,
             SH DOUBLE,
             SF DOUBLE,
             GIDP DOUBLE
       )
       location '/user/tableau/Batters';
       drop table if exists Batters;
       CREATE TABLE Batters (
             Player STRING ,
             Team STRING ,
             League STRING ,
             Year SMALLINT,
             Games DOUBLE,
             AB DOUBLE,
             R DOUBLE,
             H DOUBLE,
             Doubles DOUBLE,
             Triples DOUBLE,
             HR DOUBLE,
             RBI DOUBLE,
             SB DOUBLE,
             CS DOUBLE,
             BB DOUBLE,
             SO DOUBLE,
             IBB DOUBLE,
             HBP DOUBLE,
             SH DOUBLE,
             SF DOUBLE,
             GIDP DOUBLE
             )
       STORED AS orc tblproperties ("orc.compress"="SNAPPY");
       insert overwrite table Batters select * from Batters_txt;
      

      runs into the following error:

      2016-05-18T19:59:00,883 ERROR [HiveServer2-Background-Pool: Thread-306]: operation.Operation (:()) - Error running hive query:
      org.apache.hive.service.cli.HiveSQLException: Error while processing statement: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.MoveTask. org.apache.hadoop.security.AccessControlException: User does not belong to hdfs
      	at org.apache.hadoop.hdfs.server.namenode.FSDirAttrOp.setOwner(FSDirAttrOp.java:88)
      	at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.setOwner(FSNamesystem.java:1706)
      	at org.apache.hadoop.hdfs.server.namenode.NameNodeRpcServer.setOwner(NameNodeRpcServer.java:818)
      	at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolServerSideTranslatorPB.setOwner(ClientNamenodeProtocolServerSideTranslatorPB.java:472)
      	at org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos$ClientNamenodeProtocol$2.callBlockingMethod(ClientNamenodeProtocolProtos.java)
      	at org.apache.hadoop.ipc.ProtobufRpcEngine$Server$ProtoBufRpcInvoker.call(ProtobufRpcEngine.java:644)
      	at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:969)
      	at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:2273)
      	at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:2269)
      	at java.security.AccessController.doPrivileged(Native Method)
      	at javax.security.auth.Subject.doAs(Subject.java:422)
      	at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1724)
      	at org.apache.hadoop.ipc.Server$Handler.run(Server.java:2267)
      
      	at org.apache.hive.service.cli.operation.Operation.toSQLException(Operation.java:387)
      	at org.apache.hive.service.cli.operation.SQLOperation.runQuery(SQLOperation.java:237)
      	at org.apache.hive.service.cli.operation.SQLOperation.access$300(SQLOperation.java:90)
      	at org.apache.hive.service.cli.operation.SQLOperation$2$1.run(SQLOperation.java:290)
      	at java.security.AccessController.doPrivileged(Native Method)
      	at javax.security.auth.Subject.doAs(Subject.java:422)
      	at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1724)
      	at org.apache.hive.service.cli.operation.SQLOperation$2.run(SQLOperation.java:303)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at java.lang.Thread.run(Thread.java:745)
      Caused by: org.apache.hadoop.hive.ql.metadata.HiveException: org.apache.hadoop.security.AccessControlException: User does not belong to hdfs
      	at org.apache.hadoop.hdfs.server.namenode.FSDirAttrOp.setOwner(FSDirAttrOp.java:88)
      	at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.setOwner(FSNamesystem.java:1706)
      	at org.apache.hadoop.hdfs.server.namenode.NameNodeRpcServer.setOwner(NameNodeRpcServer.java:818)
      	at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolServerSideTranslatorPB.setOwner(ClientNamenodeProtocolServerSideTranslatorPB.java:472)
      	at org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos$ClientNamenodeProtocol$2.callBlockingMethod(ClientNamenodeProtocolProtos.java)
      	at org.apache.hadoop.ipc.ProtobufRpcEngine$Server$ProtoBufRpcInvoker.call(ProtobufRpcEngine.java:644)
      	at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:969)
      	at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:2273)
      	at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:2269)
      	at java.security.AccessController.doPrivileged(Native Method)
      	at javax.security.auth.Subject.doAs(Subject.java:422)
      	at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1724)
      	at org.apache.hadoop.ipc.Server$Handler.run(Server.java:2267)
      
      	at org.apache.hadoop.hive.ql.metadata.Hive.moveFile(Hive.java:2896)
      	at org.apache.hadoop.hive.ql.metadata.Hive.replaceFiles(Hive.java:3151)
      	at org.apache.hadoop.hive.ql.metadata.Hive.loadTable(Hive.java:1803)
      	at org.apache.hadoop.hive.ql.exec.MoveTask.execute(MoveTask.java:347)
      	at org.apache.hadoop.hive.ql.exec.Task.executeTask(Task.java:197)
      	at org.apache.hadoop.hive.ql.exec.TaskRunner.runSequential(TaskRunner.java:100)
      	at org.apache.hadoop.hive.ql.Driver.launchTask(Driver.java:1857)
      	at org.apache.hadoop.hive.ql.Driver.execute(Driver.java:1561)
      	at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1312)
      	at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1083)
      	at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1076)
      	at org.apache.hive.service.cli.operation.SQLOperation.runQuery(SQLOperation.java:235)
      	... 11 more
      Caused by: org.apache.hadoop.security.AccessControlException: User does not belong to hdfs
      	at org.apache.hadoop.hdfs.server.namenode.FSDirAttrOp.setOwner(FSDirAttrOp.java:88)
      	at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.setOwner(FSNamesystem.java:1706)
      	at org.apache.hadoop.hdfs.server.namenode.NameNodeRpcServer.setOwner(NameNodeRpcServer.java:818)
      	at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolServerSideTranslatorPB.setOwner(ClientNamenodeProtocolServerSideTranslatorPB.java:472)
      	at org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos$ClientNamenodeProtocol$2.callBlockingMethod(ClientNamenodeProtocolProtos.java)
      	at org.apache.hadoop.ipc.ProtobufRpcEngine$Server$ProtoBufRpcInvoker.call(ProtobufRpcEngine.java:644)
      	at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:969)
      	at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:2273)
      	at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:2269)
      	at java.security.AccessController.doPrivileged(Native Method)
      	at javax.security.auth.Subject.doAs(Subject.java:422)
      	at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1724)
      	at org.apache.hadoop.ipc.Server$Handler.run(Server.java:2267)
      
      	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
      	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
      	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.setOwner(DFSClient.java:2510)
      	at org.apache.hadoop.hdfs.DistributedFileSystem$32.doCall(DistributedFileSystem.java:1609)
      	at org.apache.hadoop.hdfs.DistributedFileSystem$32.doCall(DistributedFileSystem.java:1605)
      	at org.apache.hadoop.fs.FileSystemLinkResolver.resolve(FileSystemLinkResolver.java:81)
      	at org.apache.hadoop.hdfs.DistributedFileSystem.setOwner(DistributedFileSystem.java:1605)
      	at org.apache.hadoop.hive.io.HdfsUtils.setFullFileStatus(HdfsUtils.java:114)
      	at org.apache.hadoop.hive.ql.metadata.Hive$3.call(Hive.java:2875)
      	at org.apache.hadoop.hive.ql.metadata.Hive$3.call(Hive.java:2867)
      	... 4 more
      Caused by: org.apache.hadoop.ipc.RemoteException(org.apache.hadoop.security.AccessControlException): User does not belong to hdfs
      	at org.apache.hadoop.hdfs.server.namenode.FSDirAttrOp.setOwner(FSDirAttrOp.java:88)
      	at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.setOwner(FSNamesystem.java:1706)
      	at org.apache.hadoop.hdfs.server.namenode.NameNodeRpcServer.setOwner(NameNodeRpcServer.java:818)
      	at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolServerSideTranslatorPB.setOwner(ClientNamenodeProtocolServerSideTranslatorPB.java:472)
      	at org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos$ClientNamenodeProtocol$2.callBlockingMethod(ClientNamenodeProtocolProtos.java)
      	at org.apache.hadoop.ipc.ProtobufRpcEngine$Server$ProtoBufRpcInvoker.call(ProtobufRpcEngine.java:644)
      	at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:969)
      	at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:2273)
      	at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:2269)
      	at java.security.AccessController.doPrivileged(Native Method)
      	at javax.security.auth.Subject.doAs(Subject.java:422)
      	at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1724)
      	at org.apache.hadoop.ipc.Server$Handler.run(Server.java:2267)
      
      	at org.apache.hadoop.ipc.Client.getRpcResponse(Client.java:1531)
      	at org.apache.hadoop.ipc.Client.call(Client.java:1481)
      	at org.apache.hadoop.ipc.Client.call(Client.java:1386)
      	at org.apache.hadoop.ipc.ProtobufRpcEngine$Invoker.invoke(ProtobufRpcEngine.java:240)
      	at com.sun.proxy.$Proxy31.setOwner(Unknown Source)
      	at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolTranslatorPB.setOwner(ClientNamenodeProtocolTranslatorPB.java:417)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.apache.hadoop.io.retry.RetryInvocationHandler.invokeMethod(RetryInvocationHandler.java:256)
      	at org.apache.hadoop.io.retry.RetryInvocationHandler.invoke(RetryInvocationHandler.java:104)
      	at com.sun.proxy.$Proxy32.setOwner(Unknown Source)
      	at org.apache.hadoop.hdfs.DFSClient.setOwner(DFSClient.java:2508)
      	... 11 more
      

      Attachments

        1. HIVE-13810.2.patch
          1 kB
          Hari Sankar Sivarama Subramaniyan
        2. HIVE-13810.1.patch
          1 kB
          Hari Sankar Sivarama Subramaniyan

        Activity

          People

            hsubramaniyan Hari Sankar Sivarama Subramaniyan
            hsubramaniyan Hari Sankar Sivarama Subramaniyan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: