Skip to main content
drewski7
Gold ⭐️⭐️
Apr 20, 2023 6:24 PM UTC
Solved

Ranger API - Import Policies from File Occasional Error

I have a NiFi flow that is exporting Ranger Policies from one Cloudera Cluster and another NiFi flow that is importing them into another NiFi cluster. The API call to export them is ${ranger.local.baseurl}/service/plugins/policies/exportJson? and the API call to import them is ${ranger.local.baseurl}/service/plugins/policies/importPoliciesFromFile?

Everything works great but once in a blue moon when trying to import the Policies I get - {"statusCode":1,"msgDesc":"XXPolicy not found","messageList":[{"name":"DATA_NOT_FOUND","rbKey":"xa.error.data_not_found","message":"Data not found","objectId":295}]}

The best solution I have right now is to restart Ranger Admin and after it works. Does anyone know why this happens or how it gets into this state?

anonymousAnswer
Gold ⭐️⭐️
Apr 21, 2023 10:42 AM UTC

Hello @drewski7 

The error you're seeing suggests that Ranger Admin can't find the "XXPolicy" during the import process. This can happen due to a corrupted policy file or an issue with Ranger Admin. Restarting Ranger Admin temporarily fixes the issue, but it's not a permanent solution. To troubleshoot the issue, you can check the policy file for errors, look at the Ranger Admin logs for any warnings, verify that the policy exists in the Ranger database, and ensure that Ranger Admin is configured correctly. If you can't identify the root cause, you can contact Cloudera support for assistance.

 
I hope this will help you.

1 reply

anonymousAnswer
Gold ⭐️⭐️
Apr 21, 2023 10:42 AM UTC

Hello @drewski7 

The error you're seeing suggests that Ranger Admin can't find the "XXPolicy" during the import process. This can happen due to a corrupted policy file or an issue with Ranger Admin. Restarting Ranger Admin temporarily fixes the issue, but it's not a permanent solution. To troubleshoot the issue, you can check the policy file for errors, look at the Ranger Admin logs for any warnings, verify that the policy exists in the Ranger database, and ensure that Ranger Admin is configured correctly. If you can't identify the root cause, you can contact Cloudera support for assistance.

 
I hope this will help you.
Translate