Skip to content

Internal server error Java NullPointerException when using callAviAPI method #172

Open
@jbourrigaud

Description

@jbourrigaud

Describe the bug

controller UI in v22.1.2
AVI plugin in v22.1.3
vra 8.11

i have created a workflow with Scriptable task to test callAviAPI method.

-- SC content --
//Declare AVI API Object
var myAviRunTimeInfo = new AviRunTimeInfo()
myAviRunTimeInfo.setHttpMethod("GET")
myAviRunTimeInfo.setUrl("cloud?vtype=CLOUD_NSXT")

//Start Try Catch on Run AVI API. THis will allow us to set a custom Error message on a failure.
try {
//Run Avi API against the controller
myAviRunTimeInfo = aviVroClient.callAviAPI(myAviRunTimeInfo)

System.debug("** REST API BODY response **")
System.debug(myAviRunTimeInfo.getResponseBody())

} catch (e) {
throw "Please validate the provided Controller is up and run ther Workflow again. No roll backs need to be done at this point. The error received: "+e
}

Error logs display :

2023-07-06 14:56:33.303 +02:00ERRORError in (Workflow:AVI REST API - Get Clouds Details / Test REST API (item1)#16) Please validate the provided Controller is up and run ther Workflow again. No roll backs need to be done at this point. The error received: InternalError: java.lang.NullPointerException (Workflow:AVI REST API - Get Clouds Details / Test REST API (item1)#8)
2023-07-06 14:56:33.313 +02:00ERRORWorkflow execution stack:


item: 'AVI REST API - Get Clouds Details/item1', state: 'failed'// retrieve CLOUD, business state: 'null', exception: 'Please validate the provided Controller is up and run ther Workflow again. No roll backs need to be done at this point. The error received: InternalError: java.lang.NullPointerException (Workflow:AVI REST API - Get Clouds Details / Test REST API (item1)#8) (Workflow:AVI REST API - Get Clouds Details / Test REST API (item1)#16)'
workflow: 'AVI REST API - Get Clouds Details' (c3f0ef89-dcdf-4712-9985-729a1dd4a8ca)
| 'attribute': name=tenant type=string value=admin
| 'attribute': name=controller type=string value=vqevominalbmgt01.naomipp.int
| 'attribute': name=aviVroClient type=Avi:AviVroClient value=dunes://service.dunes.ch/CustomSDKObject?id='vqevominalbmgt01.naomipp.int-admin'&dunesName='Avi:AviVroClient'
| 'output': name=cloudsAsJson type=string value=null
| 'no inputs'
*** End of execution stack.

Reproduction steps

  1. copy and paste the SC content in any workflow
  2. implement variables as presented in the description
  3. execute the vro workflow

i dont understand the issue. i presume it is plugin internal error

Expected behavior

the REST API is executed with success

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions