Support Questions
Find answers, ask questions, and share your expertise

Ranger policy creation failing

Solved Go to solution

Ranger policy creation failing

Explorer

We are building our own plugin but we are getting this error when saving.

10635-screen-shot-2016-12-21-at-114133-am.png

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Ranger policy creation failing

Contributor

Which version of Ranger do you use? This looks like the issue fixed in https://issues.apache.org/jira/browse/RANGER-1175.

@mehul.parikh

View solution in original post

10 REPLIES 10

Re: Ranger policy creation failing

@Leslie Chang

Can you provide more information on the nature of the plugin? Are you able to share the code or snippet of relevant code? It looks like Ranger is trying to retrieve the resourceType property value, but it isn't defined.

Have you seen this: http://bryanbende.com/development/2016/04/25/building-a-plugin-for-apache-ranger

Re: Ranger policy creation failing

Explorer

@Michael Young

We have a resource hierarchy like this where database/tablespace/protocol are top level resources. But when only tablespace is selected, that error appears.

  • database
    • schema
      • table
      • sequence
      • function
    • language
  • tablespace
  • protocol

10637-screen-shot-2016-12-21-at-13349-pm.png

Re: Ranger policy creation failing

Expert Contributor
@Leslie Chang

you need to check the service definition you created for your service

Here is the sample one check for HIVE. check it out https://github.com/apache/incubator-ranger/blob/master/agents-common/src/test/resources/admin/servic...

Re: Ranger policy creation failing

Explorer

@Ramesh Mani

I checked the service definition but nothing looks off:

{ "itemId": 6,"name": "language","type": "string","level": 20,"parent": "database","mandatory": true,"lookupSupported": true,"recursiveSupported": false,"excludesSupported": true,"Matcher": "org.apache.ranger.plugin.resourcematcher.RangerDefaultResourceMatcher","matcherOptions": {"wildCard":true, "ignoreCase":true},"validationRegEx": "","validationMessage": "","uiHint": "","label": "Language","description": "desc"}

Re: Ranger policy creation failing

@Leslie Chang

This service definition appears be "language" under the database element based on the "parent' value. What does the service definition for the tablespace component look like?

Re: Ranger policy creation failing

Explorer

@Michael Young

{"itemId": 7,"name": "tablespace","type": "string","level": 10,"parent": "","mandatory": true,"lookupSupported": true,"recursiveSupported": false,"excludesSupported": true,"Matcher": "org.apache.ranger.plugin.resourcematcher.RangerDefaultResourceMatcher","matcherOptions": {"wildCard":true, "ignoreCase":true},"validationRegEx": "","validationMessage": "","uiHint": "","label": "Tablespace","description": "desc"}

Re: Ranger policy creation failing

Contributor

Which version of Ranger do you use? This looks like the issue fixed in https://issues.apache.org/jira/browse/RANGER-1175.

@mehul.parikh

View solution in original post

Re: Ranger policy creation failing

Explorer

I'm using HDP 2.5 on Hortonworks sandbox.

Re: Ranger policy creation failing

Contributor

Fix in RANGER-1175 may not be present in the sandbox. Can you try the following workaround, to get the fix in the sandbox?

1. cd /usr/hdp/current/ranger-admin/ews

2. mv webapp/scripts/views/policies/RangerPolicyForm.js webapp/scripts/views/policies/RangerPolicyForm.js.saved

3. curl https://raw.githubusercontent.com/apache/incubator-ranger/ranger-0.6/security-admin/src/main/webapp/... > webapp/scripts/views/policies/RangerPolicyForm.js

After this, please clear your browser cache and try.

Hope this helps.