You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sentry.apache.org by "Lenni Kuff (JIRA)" <ji...@apache.org> on 2014/04/24 00:14:22 UTC
[jira] [Updated] (SENTRY-181) Improve error handling of duplicate
privileges on same object in Sentry Policy Service
[ https://issues.apache.org/jira/browse/SENTRY-181?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Lenni Kuff updated SENTRY-181:
------------------------------
Description:
The error I get when the same privilege is added twice to a role is not very user friendly. I feel that this case should probably not even be an error (if the privilege already exists just return with Status OK).
{code}
java.lang.RuntimeException: Unknown error for request: TAlterSentryRoleGrantPrivilegeRequest(protocol_version:1, requestorUserName:lskuff, requestorGroupNames:[lskuff], roleName:insert_functional_alltypes, privilege:TSentryPrivilege(privilegeScope:TABLE, serverName:server1, dbName:alltypes, tableName:functional, action:INSERT, createTime:1398272883261, grantorPrincipal:lskuff)), message: Insert of object "org.apache.sentry.provider.db.service.model.MSentryPrivilege@6c4fb761" using statement "INSERT INTO "SENTRY_DB_PRIVILEGE" ("DB_PRIVILEGE_ID","CREATE_TIME","URI","ACTION","TABLE_NAME","DB_NAME","GRANTOR_PRINCIPAL","PRIVILEGE_SCOPE","PRIVILEGE_NAME","SERVER_NAME") VALUES (?,?,?,?,?,?,?,?,?,?)" failed : ERROR: duplicate key value violates unique constraint "SENTRY_PRIVILEGE_NAME"
Detail: Key ("PRIVILEGE_NAME")=(server1+alltypes+functional+INSERT) already exists.. Server Stacktrace: javax.jdo.JDODataStoreException: Insert of object "org.apache.sentry.provider.db.service.model.MSentryPrivilege@6c4fb761" using statement "INSERT INTO "SENTRY_DB_PRIVILEGE" ("DB_PRIVILEGE_ID","CREATE_TIME","URI","ACTION","TABLE_NAME","DB_NAME","GRANTOR_PRINCIPAL","PRIVILEGE_SCOPE","PRIVILEGE_NAME","SERVER_NAME") VALUES (?,?,?,?,?,?,?,?,?,?)" failed : ERROR: duplicate key value violates unique constraint "SENTRY_PRIVILEGE_NAME"
Detail: Key ("PRIVILEGE_NAME")=(server1+alltypes+functional+INSERT) already exists.
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)
at
{code}
was:
The error I get when the same privilege is added twice to a role is not very user friendly. I feel that this case should probably not even though an error (if the privilege already exists just return with Status OK).
{code}
java.lang.RuntimeException: Unknown error for request: TAlterSentryRoleGrantPrivilegeRequest(protocol_version:1, requestorUserName:lskuff, requestorGroupNames:[lskuff], roleName:insert_functional_alltypes, privilege:TSentryPrivilege(privilegeScope:TABLE, serverName:server1, dbName:alltypes, tableName:functional, action:INSERT, createTime:1398272883261, grantorPrincipal:lskuff)), message: Insert of object "org.apache.sentry.provider.db.service.model.MSentryPrivilege@6c4fb761" using statement "INSERT INTO "SENTRY_DB_PRIVILEGE" ("DB_PRIVILEGE_ID","CREATE_TIME","URI","ACTION","TABLE_NAME","DB_NAME","GRANTOR_PRINCIPAL","PRIVILEGE_SCOPE","PRIVILEGE_NAME","SERVER_NAME") VALUES (?,?,?,?,?,?,?,?,?,?)" failed : ERROR: duplicate key value violates unique constraint "SENTRY_PRIVILEGE_NAME"
Detail: Key ("PRIVILEGE_NAME")=(server1+alltypes+functional+INSERT) already exists.. Server Stacktrace: javax.jdo.JDODataStoreException: Insert of object "org.apache.sentry.provider.db.service.model.MSentryPrivilege@6c4fb761" using statement "INSERT INTO "SENTRY_DB_PRIVILEGE" ("DB_PRIVILEGE_ID","CREATE_TIME","URI","ACTION","TABLE_NAME","DB_NAME","GRANTOR_PRINCIPAL","PRIVILEGE_SCOPE","PRIVILEGE_NAME","SERVER_NAME") VALUES (?,?,?,?,?,?,?,?,?,?)" failed : ERROR: duplicate key value violates unique constraint "SENTRY_PRIVILEGE_NAME"
Detail: Key ("PRIVILEGE_NAME")=(server1+alltypes+functional+INSERT) already exists.
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)
at
{code}
> Improve error handling of duplicate privileges on same object in Sentry Policy Service
> --------------------------------------------------------------------------------------
>
> Key: SENTRY-181
> URL: https://issues.apache.org/jira/browse/SENTRY-181
> Project: Sentry
> Issue Type: Bug
> Affects Versions: 1.3.0
> Reporter: Lenni Kuff
>
> The error I get when the same privilege is added twice to a role is not very user friendly. I feel that this case should probably not even be an error (if the privilege already exists just return with Status OK).
> {code}
> java.lang.RuntimeException: Unknown error for request: TAlterSentryRoleGrantPrivilegeRequest(protocol_version:1, requestorUserName:lskuff, requestorGroupNames:[lskuff], roleName:insert_functional_alltypes, privilege:TSentryPrivilege(privilegeScope:TABLE, serverName:server1, dbName:alltypes, tableName:functional, action:INSERT, createTime:1398272883261, grantorPrincipal:lskuff)), message: Insert of object "org.apache.sentry.provider.db.service.model.MSentryPrivilege@6c4fb761" using statement "INSERT INTO "SENTRY_DB_PRIVILEGE" ("DB_PRIVILEGE_ID","CREATE_TIME","URI","ACTION","TABLE_NAME","DB_NAME","GRANTOR_PRINCIPAL","PRIVILEGE_SCOPE","PRIVILEGE_NAME","SERVER_NAME") VALUES (?,?,?,?,?,?,?,?,?,?)" failed : ERROR: duplicate key value violates unique constraint "SENTRY_PRIVILEGE_NAME"
> Detail: Key ("PRIVILEGE_NAME")=(server1+alltypes+functional+INSERT) already exists.. Server Stacktrace: javax.jdo.JDODataStoreException: Insert of object "org.apache.sentry.provider.db.service.model.MSentryPrivilege@6c4fb761" using statement "INSERT INTO "SENTRY_DB_PRIVILEGE" ("DB_PRIVILEGE_ID","CREATE_TIME","URI","ACTION","TABLE_NAME","DB_NAME","GRANTOR_PRINCIPAL","PRIVILEGE_SCOPE","PRIVILEGE_NAME","SERVER_NAME") VALUES (?,?,?,?,?,?,?,?,?,?)" failed : ERROR: duplicate key value violates unique constraint "SENTRY_PRIVILEGE_NAME"
> Detail: Key ("PRIVILEGE_NAME")=(server1+alltypes+functional+INSERT) already exists.
> 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)
> at
> {code}
--
This message was sent by Atlassian JIRA
(v6.2#6252)