Symptoms:
- When configuring a new replication, the task fails and you see an error similar to:
Operation aborted due to an unexpected error.
- This issue occurs when the source virtual machine has multiple disks.
- In the /opt/vmware/h4/replcator/log/replicator.log file on the destination Replicator Appliance, you see entries similar to:
2022-11-17 16:31:46.080 WARN - [UI-########-####-####-####-########e6ea-r11650-Cy-IV-6T-Il] [job-15] o.h.engine.jdbc.spi.SqlExceptionHelper : SQL Error: 0, SQLState: 23505
2022-11-17 16:31:46.080 ERROR - [UI-########-####-####-####-########e6ea-r11650-Cy-IV-6T-Il] [job-15] o.h.engine.jdbc.spi.SqlExceptionHelper : ERROR: duplicate key value violates unique constraint "replication_disk_pkey"
Detail: Key (disk_id, replication_replication_id)=(########-####-####-####-########9f65, H4-########-####-####-####-########9df5) already exists.
2022-11-17 16:31:46.081 INFO - [UI-########-####-####-####-########e6ea-r11650-Cy-IV-6T-Il] [job-15] o.h.e.j.b.internal.AbstractBatchImpl : HHH000010: On release of batch it still contained JDBC statements
2022-11-17 16:31:46.083 ERROR - [UI-########-####-####-####-########e6ea-r11650-Cy-IV-6T-Il] [job-15] com.vmware.h4.jobengine.JobExecution : Task ########-####-####-####-########a377 (WorkflowInfo{type='setupDestination', resourceType='replication', resourceId='H4-########-####-####-####-########9df5', isPrivate=false, resourceName='null'}) has failed
org.springframework.dao.DataIntegrityViolationException: could not execute statement; SQL [n/a]; constraint [replication_disk_pkey]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement
at org.springframework.orm.jpa.vendor.HibernateJpaDialect.convertHibernateAccessException(HibernateJpaDialect.java:276)
at org.springframework.orm.jpa.vendor.HibernateJpaDialect.translateExceptionIfPossible(HibernateJpaDialect.java:233)
at org.springframework.orm.jpa.JpaTransactionManager.doCommit(JpaTransactionManager.java:566)
...
Caused by: org.hibernate.exception.ConstraintViolationException: could not execute statement
at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:109)
at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:37)
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:113)
...
Caused by: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "replication_disk_pkey"
Detail: Key (disk_id, replication_replication_id)=(########-####-####-####-########9f65, H4-########-####-####-####-########9df5) already exists.
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2675)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2365)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:355)
...
- Alternatively, in the /opt/vmware/h4/replcator/log/replicator.log file on the destination Replicator Appliance, you may instead see an entry similar to:
2022-11-17 16:37:54.357 ERROR - [UI-########-####-####-####-########e6ea-r12246-Bt-2F-Vd-kT] [job-20] com.vmware.h4.jobengine.JobExecution : Task ########-####-####-####-########c928 (WorkflowInfo{type='setupDestination', resourceType='replication', resourceId='H4-########-####-####-####-########2883', isPrivate=false, resourceName='null'}) has failed
org.springframework.dao.DataIntegrityViolationException: A different object with the same identifier value was already associated with the session : [com.vmware.h4.replicator.model.ReplicaDiskEntity#com.vmware.h4.replicator.model.ReplicaDiskEntity$ReplicationDiskUuid@5c2d1264]; nested exception is javax.persistence.EntityExistsException: A different object with the same identifier value was already associated with the session : [com.vmware.h4.replicator.model.ReplicaDiskEntity#com.vmware.h4.replicator.model.ReplicaDiskEntity$ReplicationDiskUuid@5c2d1264]
at org.springframework.orm.jpa.EntityManagerFactoryUtils.convertJpaAccessExceptionIfPossible(EntityManagerFactoryUtils.java:400)
at org.springframework.orm.jpa.vendor.HibernateJpaDialect.translateExceptionIfPossible(HibernateJpaDialect.java:235)
at org.springframework.orm.jpa.JpaTransactionManager.doCommit(JpaTransactionManager.java:566)
...
Caused by: javax.persistence.EntityExistsException: A different object with the same identifier value was already associated with the session : [com.vmware.h4.replicator.model.ReplicaDiskEntity#com.vmware.h4.replicator.model.ReplicaDiskEntity$ReplicationDiskUuid@5c2d1264]
at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:123)
at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:181)
at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:188)
...
Note: The preceding log excerpts are only examples. Date, time, and environmental variables may vary depending on your environment.