07-09-2019 09:31 AM
Hello,
We recently upgraded to version 8.1.2 and I'm getting started trying to use the REST API. I have been successful in logging in and getting a list of policies, so i know my credentials are working. However, in trying to get individual policy details I'm getting an HTTP error 500. The documentation describes this as "An unexpected system error," but doesn't give additional detail. The strange part is that many policies work with this call, but many do not. I can't seem to find commonality between working policies and non-working policies.
I'm using Python 3.6 and the requests module.
headers = {'content-type': 'application/vnd.netbackup+json;version=1.0', 'Accept': 'application/vnd.netbackup+json;version=2.0', 'Authorization': <token>, 'X-NetBackup-Policy-Use-Generic-Schema': 'true'}
GET /config/policies/<policy name>
{'errorCode': 130, 'errorMessage': 'system error occurred', 'details': {}}
07-09-2019 09:37 AM
Hi,
I think it's probably just a bug as 500 means unexpected error occurred. The API is still new....
I've been using the 8.2 version but I don't have many policies. Are you querying individual ones manually or programitically. Try doing a curl / postman request instead of python on some of the problems ones to see if it's code or the API.
07-09-2019 10:01 AM
I have tried manually and programmatically using curl, Python, and Postman. I receive the same result. Here are Postman screenshots, the first one with the error and the second returning just fine. The only difference in these two requests is the policy name.
07-10-2019 04:59 AM
Alright, so it seems the problem comes about when the policy has a "volumePool" attribute set to something other than the built-in NetBackup and DataStore pools. On our policies this attribute is greyed out and can't even be set since we're using SLPs.
It's unworkable to go through every policy in the Console and try to change this value, especially where Accelerator is used. First, you have to change the storage to an MM Storage Unit to be able to set the volume pool, but this then forces you to remove the accelerator attributes and change acclerator schedules. I'm assuming other policy attributes will provide similar problems changing from disk to MM.
It's possible to edit the policy files on the master at /usr/openv/netbackup/db/class/<policy name>/info on a *nix master, however this adds a lot risk of human error and trying to edit these files programmatically is a complex task.
Finally, there are likely scenarios where it's perfectly valid to have a policy with an MM storage unit using a custom volume pool.
In short, please resolve this to make the API more usable.
07-10-2019 05:50 AM
Maybe it's resolved in 8.2.
07-16-2019 04:02 AM
Hi,
Thought I'd let you know, I'm getting a similiar problem but it's not the volume pool. It's set to NetBackup but still fails.
07-19-2019 09:27 AM
Try the below format and let me know how that goes. If I recall correctly this should workd for most of the types of policy types such as Oracle, VMWare, SQL..
------------------------------------
GET
https://<master>:1556/netbackup/config/policies/<policy_name>
Header
Content-Type":"application/json"
Authorization
<token>
------------------------------------
For MS-WIndows/Standard you need to add one more header as below
X-NetBackup-Policy-Use-Generic-Schema = True
07-22-2019 04:03 AM
Hi Amol,
The issue does not lie there. The problem is that if the volume pool on the policy is not set to NetBackup, you get a policy error.
09-04-2019 10:25 AM
I am getting the same exact error with all policies that do not have the policy volume pool as the default NetBackup.
05-26-2020 03:13 AM
06-01-2020 06:32 AM
Request eeb 3987478, This is a eeb bundle that resolve this and other issues in 8.1.2