Harshal Chavan created RANGER-5898:
--------------------------------------
Summary: Incorrect error message during custom policy creation
with duplicate resource
Key: RANGER-5898
URL: https://issues.apache.org/jira/browse/RANGER-5898
Project: Ranger
Issue Type: Bug
Components: Ranger
Affects Versions: 2.10
Reporter: Harshal Chavan
Assignee: Dineshkumar Yadav
Incorrect error message during custom policy creation with duplicate resource
while testing RANGER-5877
Steps
1.Click on add new hive service
2.add service details and add custom policy creation details. The below json
has resources same but different policy name
{code:java}
setup.additional.default.policies = true
default.policy.1 = { "name": "testdb tables", "resources": { "database": {
"values": [ "testdb" ] } }, "policyItems": [ { "groups": [ "public" ],
"accesses": [ { "type": "select" } ] }] }
default.policy.2 = { "name": "testdb tables_new", "resources": { "database": {
"values": [ "testdb" ] } }, "policyItems": [ { "groups": [ "public" ],
"accesses": [ { "type": "select" } ] }] }
{code}
3. Click on save
Actual output - We get error in the UI
{code:java}
"msgDesc": "Exception [EclipseLink-4002] (Eclipse Persistence Services -
2.7.12.v20230209-e5c4074ef3):
org.eclipse.persistence.exceptions.DatabaseException\nInternal Exception:
org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique
constraint \"x_policy_uk_service_signature\"\n Detail parameters bound]"
{code}
Expected Output - Another policy already exists for matching resource
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)