Git pull in Aria Orchestrator doesnt pull expected content logs "ERROR: duplicate key value violates unique constraint "uq_vmoscriptmodule""
search cancel

Git pull in Aria Orchestrator doesnt pull expected content logs "ERROR: duplicate key value violates unique constraint "uq_vmoscriptmodule""

book

Article ID: 314864

calendar_today

Updated On:

Products

VMware Aria Suite

Issue/Introduction

Symptoms:
  • Git pull initiated in Aria Orchestrator does not pull the expected commits "no local changes, X commits behind"
  • The /var/log/services-logs/prelude/vco-app/file-logs/vco-server-app.log file contains a duplicate key value unique constraint violation error:

2023-10-04T12:42:23.887Z ERROR vco [host='' thread='vcoSystemTaskScheduler-1' user='' org='' trace=''] {} com.vmware.o11n.service.version.ExternalVersionControlManager - Failed to run
: class com.vmware.o11n.service.version.ExternalVersionControlManager$PullTask. Reason: could not execute batch; SQL [update vmo_scriptmodule set createdAt=?, updatedAt=?, actionEnvironmentId=?, actionpurpos
e=?, allowedoperations=?, description=?, entryPoint=?, iconId=?, name=?, objlocked=?, objversion=?, returntype=?, runtime=?, runtimeLimits=?, scriptmode=?, scriptmodulecategoryid=?, xmlparameter=? where id=?
 and tenantid=?]; constraint [uq_vmoscriptmodule]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute batch
org.springframework.dao.DataIntegrityViolationException: could not execute batch; SQL [update vmo_scriptmodule set createdAt=?, updatedAt=?, actionEnvironmentId=?, actionpurpose=?, allowedoperations=?, descr
iption=?, entryPoint=?, iconId=?, name=?, objlocked=?, objversion=?, returntype=?, runtime=?, runtimeLimits=?, scriptmode=?, scriptmodulecategoryid=?, xmlparameter=? where id=? and tenantid=?]; constraint [u
q_vmoscriptmodule]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute batch

 

Caused by: java.sql.BatchUpdateException: Batch entry 0 update vmo_scriptmodule set createdAt='<Date&Timestamp>', updatedAt=''<Date&Timestamp>', actionEnvironmentId=NULL, actionpurpose=0, allowedoperations=NULL, description='<ContentDescription>', entryPoint=NULL, iconId=NULL, name='<ContentName>', objlocked=0, objversion='', returntype='', runtime=NULL, runtimeLimits=NULL, scriptmode=0, scriptmodulecategoryid='<CategroyID>', xmlparameter='<parameters>></parameters>' where id='<ID>' and tenantid='__SYSTEM' was aborted: ERROR: duplicate key value violates unique constraint "uq_vmoscriptmodule"
  Detail: Key (tenantid, scriptmodulecategoryid, name)=(__SYSTEM, <ID>, <ContentName>) already exists.  Call getNextException to see other errors in the batch.

 


Environment

VMware vRealize Orchestrator 8.x

Cause

The error can occur when two actions or other content type has different id's on the Orchestrator server and in the git repository but they both have the same module and name.

Resolution

To resolve the issue either remove or rename one of the conflicting content entries either locally on the Orchestrator server or on the external Git repository.