You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sentry.apache.org by "Arun Suresh (JIRA)" <ji...@apache.org> on 2015/03/10 23:03:38 UTC

[jira] [Resolved] (SENTRY-668) Duplicate Entry error when granting privileges

     [ https://issues.apache.org/jira/browse/SENTRY-668?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Arun Suresh resolved SENTRY-668.
--------------------------------
    Resolution: Cannot Reproduce

> Duplicate Entry error when granting privileges
> ----------------------------------------------
>
>                 Key: SENTRY-668
>                 URL: https://issues.apache.org/jira/browse/SENTRY-668
>             Project: Sentry
>          Issue Type: Bug
>            Reporter: Arun Suresh
>
> Steps to reproduce : 
> {noformat}
> drop database IF EXISTS SentryHDFSBoundaryTestDB CASCADE;
> create database SentryHDFSBoundaryTestDB;
> drop table IF EXISTS boundary_test_table;
> create table boundary_test_table (s string);
> drop role boundary_test_role;
> create role boundary_test_role;
> grant select on table boundary_test_table to role boundary_test_role;
> drop table IF EXISTS boundary_test_table;
> create table boundary_test_table (s string);
> grant select on table BOUNDARY_TEST_TABLE to role boundary_test_role;
> then an exception gets threw:
> 2015-01-23 13:31:18,601 (main) [ERROR - org.apache.sentry.tests.e2e.unmanagedclustertests.SentryJdbc2Client.logExDetails(SentryJdbc2Client.java:77)] [Extra Message] java.sql.SQLException: Error while processing statement: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.SentryGrantRevokeTask. Unknown error for request: TAlterSentryRoleGrantPrivilegeRequest(protocol_version:1, requestorUserName:hive, roleName:boundary_test_role, privilege:TSentryPrivilege(privilegeScope:TABLE, serverName:server1, dbName:SentryHDFSBoundaryTestDB, tableName:boundary_test_table, URI:, action:SELECT, createTime:1422048678527, grantOption:FALSE)), message: Insert of object "org.apache.sentry.provider.db.service.model.MSentryPrivilege@387e71a6" using statement "INSERT INTO `SENTRY_DB_PRIVILEGE` (`DB_PRIVILEGE_ID`,`PRIVILEGE_SCOPE`,`WITH_GRANT_OPTION`,`CREATE_TIME`,`TABLE_NAME`,`URI`,`DB_NAME`,`SERVER_NAME`,`ACTION`) VALUES (?,?,?,?,?,?,?,?,?)" failed : Duplicate entry 'server1-sentryhdfsboundarytestdb-boundary_test_table-__NULL__-se' for key 'SENTRY_DB_PRIV_PRIV_NAME_UNIQ'. Server Stacktrace: javax.jdo.JDODataStoreException: Insert of object "org.apache.sentry.provider.db.service.model.MSentryPrivilege@387e71a6" using statement "INSERT INTO `SENTRY_DB_PRIVILEGE` (`DB_PRIVILEGE_ID`,`PRIVILEGE_SCOPE`,`WITH_GRANT_OPTION`,`CREATE_TIME`,`TABLE_NAME`,`URI`,`DB_NAME`,`SERVER_NAME`,`ACTION`) VALUES (?,?,?,?,?,?,?,?,?)" failed : Duplicate entry 'server1-sentryhdfsboundarytestdb-boundary_test_table-__NULL__-se' for key 'SENTRY_DB_PRIV_PRIV_NAME_UNIQ'
>         at org.datanucleus.api.jdo.NucleusJDOHelper.getJDOExceptionForNucleusException(NucleusJDOHelper.java:451)
>         at org.datanucleus.api.jdo.JDOPersistenceManager.jdoMakePersistent(JDOPersistenceManager.java:732)
>         at org.datanucleus.api.jdo.JDOPersistenceManager.makePersistent(JDOPersistenceManager.java:752)
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)