Azure DataCollection Fails with a null pointer error during loadbalancer enumeration in vRealize Automation
search cancel

Azure DataCollection Fails with a null pointer error during loadbalancer enumeration in vRealize Automation

book

Article ID: 322091

calendar_today

Updated On:

Products

VMware Aria Suite

Issue/Introduction

Symptoms:
  • Azure DataCollection Fails with a null pointer error during loadbalancer enumeration in vRealize Automation.
  • The /services-logs/prelude/provisioning-service-app/file-logs/provisioning-service-app.log file contains errors similar to:
2023-05-10T07:13:30.773Z WARN public-adapters [host='adapter-host-service-app-xxxxxxxxxx-xxxxx' thread='reactor-http-epoll-xx' user='' org='' trace='<UUID_1>' parent='' span='<UUID_2>'] c.v.xenon.common.ServiceErrorResponse.create:xx - message: Azure enumeration adapter '/provisioning/azure/load-balancer-enumeration-adapter' for '/resources/endpoints/<UUID_4>': FAILED, statusCode: 400, serverErrorId: <UUID_5>: Caused by java.lang.IllegalStateException: Azure enumeration adapter '/provisioning/azure/load-balancer-enumeration-adapter' for '/resources/endpoints/<UUID_4>': FAILED
        at com.vmware.photon.controller.model.adapters.azure.enumeration.AzureEnumerationAdapterService.lambda$triggerEnumerationAdapter$2(AzureEnumerationAdapterService.java:343)
        at com.vmware.xenon.common.Operation.completeOrFail(Operation.java:1359)
        at com.vmware.xenon.common.Operation.fail(Operation.java:1337)
......
        at com.vmware.xenon.common.Operation.completeOrFail(Operation.java:1359)
        at com.vmware.xenon.common.Operation.complete(Operation.java:1186)
.......
    Caused by: java.lang.NullPointerException
  • The target links for the Azure loadbalancers are null in the load_balancer_state table of the vRealize Automation provisioning service postgres database. See workaround section for steps to validate this.


Environment

VMware vRealize Automation 8.x

Cause

The issue occurs under the following circumstances:

  1. Add a load balancer in Azure without backend pools
  2. vRealize Automation data collects this load balancer
  3. Go back to Azure and add backend pools with IP configurations 
  4. The next data collection cycle fails with the Null Pointer Exception error

The code throws a null pointer exception when the targetLinks contains a null value for azure load balancer objects.

 

 

Resolution

There is currently no resolution available.

Workaround:

To workaround the issue:

 

1. Before proceeding first take a snapshot of the vRealize Automation appliance(s)

2. SSH to the vRealize Automation appliance and login as root user.

3. Connect to the provisioning service postgres database instance: answer yes when prompted.

vracli dev psql provisioning-db

4.validate you are hitting the issue by checking for null entries in the load_balancer_state table of the provisioning service postgres database:

SELECT load_balancer_state.name, endpoint_state.endpoint_type, endpoint_state.name
FROM load_balancer_state
JOIN endpoint_state ON load_balancer_state.endpoint_link = endpoint_state.document_self_link
where load_balancer_state.target_links is null;

5. Update load_balancer_state table so that target_links is non-null for each of the LBs returned by above query that are on endpoints of type azure:

update load_balancer_state set target_links = '[]' where name = 'the LB name returned in preceding Query ';


Additional Information

Impact/Risks:
The Azure data-collection tasks fail until the issue is resolved.