> On Sept. 13, 2014, 4:44 p.m., Prasad Mujumdar wrote: > > sentry-binding/sentry-binding-hive/src/main/java/org/apache/hadoop/hive/ql/exec/SentryGrantRevokeTask.java, > > line 173 > > <https://reviews.apache.org/r/25078/diff/2/?file=672541#file672541line173> > > > > Looks like all exceptions other that SentryUserException will not > > return error status. I guess we should have another catch block to handle > > that.
SentryUserException is the parent exception of all the checked exceptions which can be thrown in this try block. So unless we want to catch the errors, another catch block should not be required? - Sravya ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/25078/#review53267 ----------------------------------------------------------- On Aug. 29, 2014, 10:39 p.m., Sravya Tirukkovalur wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/25078/ > ----------------------------------------------------------- > > (Updated Aug. 29, 2014, 10:39 p.m.) > > > Review request for sentry and Prasad Mujumdar. > > > Repository: sentry > > > Description > ------- > > Here is how the exceptions look like in Hive for various Sentry Exceptions: > > *SemanticExceptions:* > java.sql.SQLException: Error while compiling statement: FAILED: > SemanticException No valid privileges > > *SentryUserExceptions*: > > java.sql.SQLException: Error while processing statement: FAILED: Execution > Error, return code 1 from > org.apache.hadoop.hive.ql.exec.SentryGrantRevokeTask. Access denied to > user1_1. Server Stacktrace: > org.apache.sentry.provider.db.SentryAccessDeniedException: Access denied to > user1_1 > at > org.apache.sentry.provider.db.service.thrift.SentryPolicyStoreProcessor.authorize(SentryPolicyStoreProcessor.java:136) > at > org.apache.sentry.provider.db.service.thrift.SentryPolicyStoreProcessor.create_sentry_role(SentryPolicyStoreProcessor.java:145) > at > org.apache.sentry.provider.db.service.thrift.SentryPolicyService$Processor$create_sentry_role.getResult(SentryPolicyService.java:773) > at > org.apache.sentry.provider.db.service.thrift.SentryPolicyService$Processor$create_sentry_role.getResult(SentryPolicyService.java:758) > at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:39) > at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:39) > at > org.apache.sentry.provider.db.service.thrift.SentryProcessorWrapper.process(SentryProcessorWrapper.java:46) > at > org.apache.thrift.TMultiplexedProcessor.process(TMultiplexedProcessor.java:123) > at > org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:244) > at > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) > at java.lang.Thread.run(Thread.java:724) > > java.sql.SQLException: Error while processing statement: FAILED: Execution > Error, return code 1 from > org.apache.hadoop.hive.ql.exec.SentryGrantRevokeTask. Role: > TListSentryRolesRequest(protocol_version:1, requestorUserName:admin1, > groupName:Admin) couldn't be retrieved.. Server Stacktrace: > org.apache.sentry.provider.db.SentryNoSuchObjectException: Group Admin > at > org.apache.sentry.provider.db.service.persistent.SentryStore.getMSentryRolesByGroupName(SentryStore.java:823) > at > org.apache.sentry.provider.db.service.persistent.SentryStore.getTSentryRolesByGroupName(SentryStore.java:853) > at > org.apache.sentry.provider.db.service.thrift.SentryPolicyStoreProcessor.list_sentry_roles_by_group(SentryPolicyStoreProcessor.java:347) > at > org.apache.sentry.provider.db.service.thrift.SentryPolicyService$Processor$list_sentry_roles_by_group.getResult(SentryPolicyService.java:893) > at > org.apache.sentry.provider.db.service.thrift.SentryPolicyService$Processor$list_sentry_roles_by_group.getResult(SentryPolicyService.java:878) > at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:39) > at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:39) > at > org.apache.sentry.provider.db.service.thrift.SentryProcessorWrapper.process(SentryProcessorWrapper.java:46) > at > org.apache.thrift.TMultiplexedProcessor.process(TMultiplexedProcessor.java:123) > at > org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:244) > at > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) > at java.lang.Thread.run(Thread.java:724) > > > Diffs > ----- > > > sentry-binding/sentry-binding-hive/src/main/java/org/apache/hadoop/hive/ql/exec/SentryGrantRevokeTask.java > 0b268068b71b3602b95ddde9c87b21f4bfdc5754 > > sentry-binding/sentry-binding-hive/src/main/java/org/apache/sentry/binding/hive/authz/HiveAuthzBinding.java > 6c101adc686d028c09ebe70e01e03976cd57a921 > > sentry-core/sentry-core-common/src/main/java/org/apache/sentry/SentryUserException.java > 2b2470344e558e0eaa4442771be99e971a6aae76 > > sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/SentryAccessDeniedException.java > 8f1fa2bb5b2a9e4fa132c8096c390e9c322fe017 > > sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/SentryAlreadyExistsException.java > d878cc659e639d3567ece194213b27835f09d465 > > sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/SentryInvalidInputException.java > a05970eb2fcdff6f0210512482437276a687d0db > > sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/SentryNoSuchObjectException.java > fa9ee2277f6aad7bd5e3c879ef60054d81eeb6ac > > sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/Status.java > c1678378746a0d2baf9a76e569d06b5198631d08 > > Diff: https://reviews.apache.org/r/25078/diff/ > > > Testing > ------- > > Ran the tests and made sure stack traces are not part of the exception > message. > > SentryUserExceptions: > java.sql.SQLException: Error while processing statement: FAILED: Execution > Error, return code 1 from > org.apache.hadoop.hive.ql.exec.SentryGrantRevokeTask. > SentryAccessDeniedException: Access denied to user1_1 > > java.sql.SQLException: Error while processing statement: FAILED: Execution > Error, return code 1 from > org.apache.hadoop.hive.ql.exec.SentryGrantRevokeTask. > SentryNoSuchObjectException: Role: > TListSentryRolesRequest(protocol_version:1, requestorUserName:admin1, > groupName:Admin) couldn't be retrieved. > > > Thanks, > > Sravya Tirukkovalur > >
