Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Ranger Create Policy API returns 404

avatar
Contributor

I'm having trouble using the endpoint `service/public/v2/api/policy` to create policies (Returns 404) but I can get policy by id. Is there some special permission for that endpoint?

1 ACCEPTED SOLUTION

avatar
Rising Star

I was able to create a policy successfully with the command-line in your post. There should be some log in one of these files: xa_portal.log, catalina.out, most recent access_log*.log. Can you check again?

This error could be due to incorrect JSON as well - if this is the cause, error details should be in catalina.out.

View solution in original post

7 REPLIES 7

avatar
Rising Star

Can you take look at xa_portal.log to troubleshoot further? If you can send details of the REST API call made and the response, it can help find the root cause.

avatar
Contributor

No new logs from the request seem to appear in xa_portal.log. I'm doing: curl -iv -u admin:admin -H "Content-Type: application/json" -X POST http://localhost:6080/service/public/v2/api/policy -d @test.json

avatar
New Contributor

Can you post the contents of test.json? A malformed json file will result in a 404 error, as you described.

avatar
Rising Star

any clues from catalina.out and access_log.*.log files?

avatar
Contributor

No new logs seem to show up when I send the request.

avatar
Rising Star

I was able to create a policy successfully with the command-line in your post. There should be some log in one of these files: xa_portal.log, catalina.out, most recent access_log*.log. Can you check again?

This error could be due to incorrect JSON as well - if this is the cause, error details should be in catalina.out.

avatar
Contributor

I was able to get it working after removing an extra bracket in my json. Thanks.