Error: "class java.lang.NullPointerException" when adding a policy to an Organization VDC
search cancel

Error: "class java.lang.NullPointerException" when adding a policy to an Organization VDC

book

Article ID: 446272

calendar_today

Updated On:

Products

VMware Cloud Director

Issue/Introduction

  • When you try to create a vApp the task fails for an organization due to missing placement policies in VMware Cloud Director (VCD).
  • When you try to add a placement policy to an Organization Virtual Data Center (Org VDC) fails with error:

    class java.lang.NullPointerException

  • In /opt/vmware/vcloud-director/logs/vcloud-container-debug.log on the VCD cell, you see errors similar to:

    | ERROR    | pool-jetty-41             | DefaultExceptionMapper         | Internal server exception | requestId=########-####-####-####-############,request=PUT https://example.com/
    api/admin/vdc/########-####-####-####-############/computePolicies,requestTime=#############,remoteAddress=##.##.##.##:39090,userAgent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 ...,accept=application/*+json;version 40.0.0-alpha
    java.lang.NullPointerException
            at com.vmware.ssdc.backend.dao.impl.ComputePolicyDaoImpl.lambda$transformToVdcComputePolicySpecs$112(ComputePolicyDaoImpl.java:####)

Environment

VMware Cloud Director 10.6

Cause

The issue is caused by stale entries in the vdc_logical_resource table. Specifically, there are compute policy entries in vdc_logical_resource that no longer have a corresponding backing record in the vdc_compute_policy table. If one of these stale entries is marked as the "default" policy, the UI and API calls fail with a NullPointerException.

Resolution

Resolution involves making modifications to Cloud Director Database. Contact technical support and note this Knowledge Article ID (320498) in the problem description. For more information, see How to Submit a Support Request