NullPointerException error while trying to access the segment in vCD when network tenancy is enabled.
search cancel

NullPointerException error while trying to access the segment in vCD when network tenancy is enabled.

book

Article ID: 415019

calendar_today

Updated On:

Products

VMware Cloud Director

Issue/Introduction

Below error is observed in UI when trying to view/access the segment in vCD:

"[ #######-####-####-####-##########] class java.lang.NullPointerException"

Environment

vCloud Director 10.6.x

Cause

When tenancy is enabled for an organization in vCD, a corresponding project is automatically created in NSX-T.

The segments were created under the default project in NSX-T. When these segments are imported under any organization in vCD with network tenancy enabled, the system throws an error because it looks for the segment within that specific tenant’s project in NSX-T.

Below is log excerpt from vcloud-container-debug.log:

YYYY-MM-DD HH:MM:SS,683 | DEBUG    | pool-jetty-1125792        | RestClient                     | Retry error message not found "error_code" : 500045 in response for GET /policy/api/v1/orgs/default/projects/########-####-####-####-################/
infra/segments/########-####-####-####-################ with status 404 after execution 1:
{
  "httpStatus" : "NOT_FOUND",
  "error_code" : 600,
  "module_name" : "common-services",
  "error_message" : "The requested object : /orgs/default/projects/########-####-####-####-################/infra/segments/########-####-####-####-################ could not be found. Object identifiers are case sensitive."

Resolution

Create the segments within their respective projects in NSX-T and then import them into their corresponding Organization VDCs (OVDCs) in vCD.

Additional Information

Tenancy Behavior and Segment Mapping:
When tenancy is enabled for an organization in vCD, a corresponding project is automatically created in NSX-T.

Example:
If two organizations — org1 and org2 — have tenancy enabled, the NSX-T project structure will appear as:

  • default

  • org1

  • org2

Segments can then be created under different projects in NSX-T, for example:

  • default-seg under the default project

  • org1-seg under the org1 project

When creating imported vDC networks in the org2 tenant portal using these segments:

  • vdc-imported-nw-1 (using default-seg)

  • vdc-imported-nw-2 (using org1-seg)

an error appears in vDC Networks → Segment Profiles within vCD.

Reason for the Error:

  • For vdc-imported-nw-1: vCD attempts to locate the segment under the org2 project (as tenancy is enabled), but the segment exists under default.

  • For vdc-imported-nw-2: vCD again looks under org2, while the segment actually resides under org1.