QBM_TransportToHistoryDatabase frozen job

Hi all

I took over an installation where transport of changes to history database is failing to complete due to an 'Cannot insert duplicate key in object 'dbo.HistoryJob' error.

I don't know where do begin. should I remove the corresponding row in the history database?

ErrorMessages	(2024-04-08 14:29:11.723) [810023] Error running statement: exec HDB_PProcessGroup '060A6871-7261-4F16-A093-5E6868ACAC7C'
[810143] Database error 3903: The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION.
Violation of PRIMARY KEY constraint 'PK__HistoryJ__789A82F1AA96B1CC'. Cannot insert duplicate key in object 'dbo.HistoryJob'. The duplicate key value is (ad6ea9d9-965b-4bf3-9409-2a1183ebf795).
[System.Data.SqlClient.SqlException] The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION.
Violation of PRIMARY KEY constraint 'PK__HistoryJ__789A82F1AA96B1CC'. Cannot insert duplicate key in object 'dbo.HistoryJob'. The duplicate key value is (ad6ea9d9-965b-4bf3-9409-2a1183ebf795).
   at VI.JobService.ProcessorThread._ExecuteJob(Job job, JobResult result)
   at HdbTransportComponent.HdbTransportComponent._ExportToHdb()
   at HdbTransportComponent.HdbTransportComponent._ProcessInDestination(IDbSession outSession, CancellationToken ct)
   at VI.Base.SyncActions.Do[T](Func`1 function)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
--- End of stack trace from previous location where exception was thrown ---
   at VI.DB.DataAccess.ReadWriteDbSession.<SqlExecuteNonQueryAsync>d__21.MoveNext()
   ---- Start of Inner Exception ----
   at VI.DB.DataAccess.ReadWriteDbSession.<SqlExecuteNonQueryAsync>d__21.MoveNext()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
--- End of stack trace from previous location where exception was thrown ---
   at VI.DB.DataAccess.ReadWriteDbSession.<IgnoreBrokenConnectionAsync>d__55`1.MoveNext()
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
--- End of stack trace from previous location where exception was thrown ---
   at VI.DB.DataAccess.ReadWriteDbSession.<_SqlExecuteNonQueryAsync>d__22.MoveNext()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
--- End of stack trace from previous location where exception was thrown ---
   at VI.DB.DataAccess.ReadOnlyDbSession.<ExecuteAndLogAsync>d__107`1.MoveNext()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
--- End of stack trace from previous location where exception was thrown ---
   at VI.DB.DataAccess.ReadOnlyDbSession.<ExecuteAndLogAsync>d__108`1.MoveNext()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
--- End of stack trace from previous location where exception was thrown ---
   at VI.DB.DataAccess.SafeDbCommand.<ExecuteNonQueryAsync>d__16.MoveNext()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
--- End of stack trace from previous location where exception was thrown ---
   at VI.DB.DataAccess.SafeDbCommand.<_CheckedAsync>d__43`1.MoveNext()
   ---- Start of Inner Exception ----
   at VI.DB.DataAccess.SafeDbCommand.<_CheckedAsync>d__43`1.MoveNext()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
--- End of stack trace from previous location where exception was thrown ---
   at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)
   at System.Data.SqlClient.SqlCommand.EndExecuteNonQueryAsync(IAsyncResult asyncResult)
   at System.Data.SqlClient.SqlCommand.EndExecuteNonQueryInternal(IAsyncResult asyncResult)
   at System.Data.SqlClient.SqlCommand.InternalEndExecuteNonQuery(IAsyncResult asyncResult, String endMethod, Boolean isInternal)
   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)