"ERROR: value too long for type character varying" error observed when vCenter Server disconnects in Cloud Director
search cancel

"ERROR: value too long for type character varying" error observed when vCenter Server disconnects in Cloud Director

book

Article ID: 325681

calendar_today

Updated On:

Products

VMware Cloud Director

Issue/Introduction

Symptoms:

  • vCenter Server disconnects from Cloud Director every few minutes
  • Within the log file /opt/vmware/vcloud-director/logs/vcloud-container-debug.log file the following error is observed.
2023-10-19 07:14:02,188 | DEBUG    | pc-activity-pool-24520    | CJob                           | updateFailedJob(com.vmware.ssdc.util.LMException) with locale=null |
com.vmware.ssdc.util.LMException: Error caused vCenter Server disconnect
        at com.vmware.ssdc.backend.vimeventlistener.VirtualCenterListener.onVirtualCenterConnectionStateChanged(VirtualCenterListener.java:108)
        at com.vmware.vcloud.inventory.events.impl.VirtualCenterConnectionChangedEvent.dispatchTo(VirtualCenterConnectionChangedEvent.java:39)
 
Caused by: java.sql.BatchUpdateException: Batch entry 0 /* Method: unknown */ /* Method: unknown */ /* update com.vmware.vcloud.common.model.inventory.VirtualMachineInvModel */ update vm_inv set <values>::uuid was aborted: ERROR: value too long for type character varying(128)  Call getNextException to see other errors in the batch.

Cause

This issue occurs when the VcPropertyCollectorJob tries to sync a Virtual Machine which has a Guest OS name which is longer than 128 characters.

If the Virtual Machine has been configured with an Operating System Family and Operating System type such as 'Other' / 'Other (64 bit)' then it will cause the Guest OS type to display the distroName, distroVersion, familyName, kernelVersion and prettyName values from the Guest OS. This can result in a lengthy Guest OS name which exceeds the 128 character length limit in Cloud Director.

Note:

This issue has been observed in, but is not limited to the following:

  • The OVA of "Home Assistant".
  • Various versions of Alma Linux.

Resolution

This matter is resolved in Cloud Director 10.5.1 and 10.4.3 which are available for download here. The supported character length for the Guest OS field has been increased to resolve this issue

To resolve this issue on earlier versions:

  1. Shutdown the Virtual Machine which has the lengthy Guest OS name (The name of this Virtual Machine should be visible in the error which occurred in Cloud Director).
  2. Edit the Operating System family type to be as accurate as possible to the Guest OS installed in the Virtual machine. Example: Linux / Debian GNU/Linux 10 (64 bit)

Workaround:
An alternative workaround for this issue requires modification of the Cloud Director database. If installation of the available patch is not possible, then please open a Support Request and make reference to this KB Article (325681) when doing so.

Note:
As modification of the database is required, please ensure a backup of the database has been taken prior to any session taking place with Technical Support.