Replication fails with an error "Operation cancelled due to unexpected error" while using Org admin credentials, in VMware Cloud Director Availability
search cancel

Replication fails with an error "Operation cancelled due to unexpected error" while using Org admin credentials, in VMware Cloud Director Availability

book

Article ID: 414416

calendar_today

Updated On:

Products

VMware Cloud Director

Issue/Introduction

  • Replication is not working when used Org admin credentials, however it works with the Root (system admin) Credentials  in VMware Cloud Director Availability.

  Error- Operation cancelled due to unexpected error.

  • In /opt/vmware/h4/cloud/log/cloud.log on the Cloud Director Replication Management Appliance on the recovery site, you see a similar message:

    2024-04-15 10:19:24.636 DEBUG - [UI-xxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxxxx-xxxx-xx-xx] [https-jsse-nio-8046-exec-218] c.vmware.h4.jobengine.WorkflowThrottler  : Scheduling job: WorkflowInfo{type='start', resourceType='vmReplication', resourceId='C4-xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx'2024-04-15 10:19:27.491  WARN - [UI-xxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxxxx-xxxx-xx-xx] [job-49] o.h.engine.jdbc.spi.SqlExceptionHelper: SQL Error: 0, SQLState: 23505
    2024-04-15 10:19:27.491 ERROR - [UI-xxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxxxx-xxxx-xx-xx] [job-49] o.h.engine.jdbc.spi.SqlExceptionHelper   : ERROR: duplicate key value violates unique constraint "uk_source_vapp_id"
      Detail: Key (v_app_id, source_site)=(xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx, <Source Site>) already exists.
    2024-04-15 10:19:27.491  INFO - [UI-xxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxxxx-xxxx-xx-xx] [job-49] o.h.e.j.b.internal.AbstractBatchImpl     : xxxxxxxxxx: On release of batch it still contained JDBC statements
    2024-04-15 10:19:27.492  INFO - [UI-xxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxxxx-xxxx-xx-xx] [job-49] c.vmware.h4.cloud.job.VmReplicationJob   : Could not create vApp replication and did not find one with site <Source Site> and source vapp id  xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx

    org.springframework.dao.DataIntegrityViolationException: could not execute statement; SQL [n/a]; constraint [uk_source_vapp_id]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement
    rg.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl.beforeCompletionCallback(JdbcResourceLocalTransactionCoordinatorImpl.java:183)
    at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl.access$300(JdbcResourceLocalTransactionCoordinatorImpl.java:40)
    atorg.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl$TransactionDriverControlImpl.commit(JdbcResourceLocalTransactionCoordinatorImpl.java:281)
    at org.hibernate.engine.transaction.internal.TransactionImpl.commit(TransactionImpl.java:101)
    at org.springframework.orm.jpa.JpaTransactionManager.doCommit(JpaTransactionManager.java:562)
    ... 20 common frames omitted

    Caused by: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "uk_source_vapp_id"
      Detail: Key (v_app_id, source_site)=(xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx, <Source Site>) already exists.
    at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:197)

    ... 41 common frames omitted


    2024-04-15 10:19:27.492 ERROR - [UI-xxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxxxx-xxxx-xx-xx] [job-49] com.vmware.h4.jobengine.JobExecution: Task xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx (WorkflowInfo{type='start', resourceType='vmReplication', resourceId='C4-xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx', isPrivate=false, resourceName='null'}) has failed
    java.lang.RuntimeException: Could not create vapp replication 


Note: The preceding log excerpts are only examples. Date, time, and environmental variables may vary depending on your environment.

Environment

Cloud Director Availability 4.7.3

Cause

  • While creating replications, the destination is different for the VMs that are part of the same vApp.

Resolution

  • Make sure that the destination should be the same as the rest of the VMs that are part of the same vApp.