NullPointerException occurs in VCMS after upgrade to AppDefense 2.3.2
search cancel

NullPointerException occurs in VCMS after upgrade to AppDefense 2.3.2

book

Article ID: 320931

calendar_today

Updated On:

Products

VMware

Issue/Introduction

Symptoms:
After upgrading the AppDefense Appliance to version 2.3.2, you experience these symptoms:
  • The inventory is not getting updated or not syncing on the UI.
  • In the /var/log/appdefense/vcenter-management-service.log file, you see entries similar to:

    java.lang.NullPointerException: null
    at com.vmware.appd.appliance.vcenter.utils.VirtualMachineDtoConverter.toDto(VirtualMachineDtoConverter.java:33) ~[classes!/:2.3.2.0]
    at com.vmware.appd.appliance.vcenter.service.impl.VcenterServiceImpl.convertInventoryObjectsToDTO(VcenterServiceImpl.java:1533) ~[classes!/:2.3.2.0]

     
  • If you check the vcms.virtual_machine table in postgres, you see a null value for the column gmm_enabled for few (or all) rows.


Cause

This issue occurs due to an error in the Inventory Synchronization with cloud manager while processing incompatible pre-upgrade data.

Resolution

To resolve this issue:
  1. Open an SSH connection to the AppDefense Appliance.
  2. Connect to the psql shell as the super user by running this command:

    sudo /opt/vmware/vpostgres/current/bin/psql appliancedb
     
  3. Create a backup of the existing state of the virtual_machine table by running this statement:

    CREATE table vcms.backup_virtual_machine as SELECT * FROM vcms.virtual_machine;
     
  4. Update the null value in the gmm_enabled column in the virtual_machine table by running this statement:

    UPDATE vcms.virtual_machine set gmm_enabled = 'f' where gmm_enabled is null;
     
  5. Exit psql shell by typing:

    \q
     
  6. Restart the vcenter-management-service:
    1. Log into the AppDefense Appliance through SSH.
    2. Log in with the root account using the "su" command.
    3. Run this command:

      systemctl restart appdefense-vcenter-management-service