You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ranger.apache.org by "Mahesh Hanumant Bandal (Jira)" <ji...@apache.org> on 2020/03/19 10:34:00 UTC

[jira] [Updated] (RANGER-2764) Role API : Duplicate key value violates unique constraint "x_ranger_global_state_uk_state_name"

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

Mahesh Hanumant Bandal updated RANGER-2764:
-------------------------------------------
    Attachment: 0001-insert-statename-in-x-ranger-global-state.patch

> Role API : Duplicate key value violates unique constraint "x_ranger_global_state_uk_state_name"
> -----------------------------------------------------------------------------------------------
>
>                 Key: RANGER-2764
>                 URL: https://issues.apache.org/jira/browse/RANGER-2764
>             Project: Ranger
>          Issue Type: Improvement
>          Components: Ranger
>            Reporter: Mehul Parikh
>            Assignee: Mahesh Hanumant Bandal
>            Priority: Major
>         Attachments: 0001-insert-statename-in-x-ranger-global-state.patch
>
>
> When Role creation is tried in multiple thread, it fails with exception for duplicate key constraint : 
> {code:java}
> 2020-03-12 14:33:26,670 ERROR org.apache.ranger.rest.RoleREST: createRole({name=dummy_role1, description=dummy role1 - Cluster1, options={}, users=[], groups=[{hive, false}, {roleAdmin, false}], roles=[], createdByUser=null}) failed
> javax.persistence.PersistenceException: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.DatabaseException
> Internal Exception: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "x_ranger_global_state_uk_state_name"
>   Detail: Key (state_name)=(RangerRole) already exists.
> Error Code: 0
> Call: INSERT INTO x_ranger_global_state (id, ADDED_BY_ID, app_data, CREATE_TIME, state_name, UPDATE_TIME, UPD_BY_ID, version) VALUES (?, ?, ?, ?, ?, ?, ?, ?)
>         bind => [8 parameters bound]
>         at org.eclipse.persistence.internal.jpa.EntityManagerImpl.flush(EntityManagerImpl.java:868)
>         at sun.reflect.GeneratedMethodAccessor79.invoke(Unknown Source)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)