Support Questions

Find answers, ask questions, and share your expertise

Ranger policy creation failing

avatar
Contributor

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

avatar
Rising Star

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

avatar
Super Guru

@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

avatar
Contributor

@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

avatar
Super Collaborator
@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...

avatar
Contributor

@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"}

avatar
Super Guru

@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?

avatar
Contributor

@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"}

avatar
Rising Star

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

@mehul.parikh

avatar
Contributor

I'm using HDP 2.5 on Hortonworks sandbox.

avatar
Rising Star

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.