cancel
Showing results for 
Search instead for 
Did you mean: 

NetBackup REST API Error 500

mrtaormina
Level 2

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': {}}

 

10 REPLIES 10

RiaanBadenhorst
Moderator
Moderator
Partner    VIP    Accredited Certified

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. 

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.

not_working.png

working.png

 

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.

RiaanBadenhorst
Moderator
Moderator
Partner    VIP    Accredited Certified

Maybe it's resolved in 8.2. 

RiaanBadenhorst
Moderator
Moderator
Partner    VIP    Accredited Certified

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.

 

 

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

RiaanBadenhorst
Moderator
Moderator
Partner    VIP    Accredited Certified

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. 

MattWiese
Level 2

I am getting the same exact error with all policies that do not have the policy volume pool as the default NetBackup.

JoSHiKo
Level 1

Hello, had sombody any solution for this? I have the same problem. I get some policies definition and others get error 500.

Request eeb 3987478, This is a eeb bundle that resolve this and other issues in 8.1.2