[
https://issues.apache.org/jira/browse/HBASE-27754?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Rajeshbabu Chintaguntla resolved HBASE-27754.
-
Fix Version/s: hbase-operator-tools-1.3.0
Resolution: Fixed
> [HBCK2] generateMissingTableDescriptorFile should throw write permission
> error and fail
> ---
>
> Key: HBASE-27754
> URL: https://issues.apache.org/jira/browse/HBASE-27754
> Project: HBase
> Issue Type: Bug
> Components: hbase-operator-tools, hbck2
>Reporter: Nihal Jain
>Assignee: Nihal Jain
>Priority: Major
> Fix For: hbase-operator-tools-1.3.0
>
>
> Try running hbck2 generateMissingTableDescriptorFile with a user not having
> permissions to write to HDFS.
> *Actual*
> The tool completes with success message, while it actually does not really
> generate/write the files, as it does not even have permissions.
> *Expected*
> Tool should throw error and should not log task is success 'Table descriptor
> written successfully. Orphan table fixed.'
> *Debug dump*
> Upon enabling debug logging, we can see incorrect behaviour.
> {code:java}
> 2023-03-24T19:03:16,890 DEBUG [IPC Parameter Sending Thread #0] ipc.Client:
> IPC Client (199657303) connection to hostname/ip_address:port_num from root
> sending #31 org.apache.hadoop.hdfs.protocol.ClientProtocol.getFileInfo
> 2023-03-24T19:03:16,893 DEBUG [IPC Client (199657303) connection to
> hostname/ip_address:port_num from root] ipc.Client: IPC Client (199657303)
> connection to hostname/ip_address:port_num from root got value #31
> 2023-03-24T19:03:16,894 DEBUG [main] ipc.ProtobufRpcEngine: Call: getFileInfo
> took 4ms
> 2023-03-24T19:03:16,894 DEBUG [main] hdfs.DFSClient:
> /apps/hbase/data/data/default/ittable-2090120905/.tmp/.tableinfo.10:
> masked={ masked: rw-r--r--, unmasked: rw-rw-rw- }
> 2023-03-24T19:03:16,895 DEBUG [IPC Parameter Sending Thread #0] ipc.Client:
> IPC Client (199657303) connection to hostname/ip_address:port_num from root
> sending #32 org.apache.hadoop.hdfs.protocol.ClientProtocol.create
> 2023-03-24T19:03:16,897 DEBUG [IPC Client (199657303) connection to
> hostname/ip_address:port_num from root] ipc.Client: IPC Client (199657303)
> connection to hostname/ip_address:port_num from root got value #32
> 2023-03-24T19:03:16,898 DEBUG [main] retry.RetryInvocationHandler: Exception
> while invoking call #32 ClientNamenodeProtocolTranslatorPB.create over null.
> Not retrying because try once and fail.
> org.apache.hadoop.ipc.RemoteException: Permission denied: user=root,
> access=WRITE,
> inode="/apps/hbase/data/data/default/ittable-2090120905/.tmp":hdfs:hdfs:drwxr-xr-x
> at
> org.apache.hadoop.hdfs.server.namenode.FSPermissionChecker.check(FSPermissionChecker.java:399)
> at
> org.apache.hadoop.hdfs.server.namenode.FSPermissionChecker.checkPermission(FSPermissionChecker.java:255)
> at
> org.apache.hadoop.hdfs.server.namenode.FSPermissionChecker.checkPermission(FSPermissionChecker.java:193)
> at
> org.apache.hadoop.hdfs.server.namenode.FSDirectory.checkPermission(FSDirectory.java:1896)
> at
> org.apache.hadoop.hdfs.server.namenode.FSDirectory.checkPermission(FSDirectory.java:1880)
> at
> org.apache.hadoop.hdfs.server.namenode.FSDirectory.checkAncestorAccess(FSDirectory.java:1839)
> at
> org.apache.hadoop.hdfs.server.namenode.FSDirWriteFileOp.resolvePathForStartFile(FSDirWriteFileOp.java:323)
> at
> org.apache.hadoop.hdfs.server.namenode.FSNamesystem.startFileInt(FSNamesystem.java:2513)
> at
> org.apache.hadoop.hdfs.server.namenode.FSNamesystem.startFile(FSNamesystem.java:2457)
> at
> org.apache.hadoop.hdfs.server.namenode.NameNodeRpcServer.create(NameNodeRpcServer.java:791)
> at
> org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolServerSideTranslatorPB.create(ClientNamenodeProtocolServerSideTranslatorPB.java:478)
> at
> org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos$ClientNamenodeProtocol$2.callBlockingMethod(ClientNamenodeProtocolProtos.java)
> at
> org.apache.hadoop.ipc.ProtobufRpcEngine$Server$ProtoBufRpcInvoker.call(ProtobufRpcEngine.java:528)
> at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:1086)
> at org.apache.hadoop.ipc.Server$RpcCall.run(Server.java:1031)
> at org.apache.hadoop.ipc.Server$RpcCall.run(Server.java:959)
> 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:1762)
> at org.apache.hadoop.ipc.Server$Handler.run(Server.java:2963)
> at org.apache.hadoop.ipc.Client.getRpcResponse(Client.java:1587)