Skip to content

RANGER-5526: Security Zone creation fails with tag service due to NonUniqueResultException#888

Open
RakeshGuptaDev wants to merge 1 commit intoapache:ranger-2.9from
RakeshGuptaDev:RANGER-5526-ranger-2.9
Open

RANGER-5526: Security Zone creation fails with tag service due to NonUniqueResultException#888
RakeshGuptaDev wants to merge 1 commit intoapache:ranger-2.9from
RakeshGuptaDev:RANGER-5526-ranger-2.9

Conversation

@RakeshGuptaDev
Copy link
Contributor

What changes were proposed in this pull request?

While creating a Security Zone with a tag service, the operation fails during postCreate execution. The stack trace shows a NonUniqueResultException from XXAccessTypeDefDao.findByNameAndServiceId(), triggered during default policy creation.

This issue is caused by duplicate entries in the access type definition tables for the associated service.

For example, the following query returns 2 records:

select * from x_access_type_def where name = 'ozone:assume_role';

How was this patch tested?

Verified that duplicate entries in x_access_type_def were removed, after which the Security Zone was created successfully and default policies were generated as expected.

Copy link
Contributor

@dineshkumar-yadav dineshkumar-yadav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mneethiraj
Copy link
Contributor

@RakeshGuptaDev - the fix looks good. Given this service-def is in DRAFT mode, it is not necessary to handle upgrade scenario.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants