Scheduler issue post reboot

Our scheduler is not working following a server reboot and our control room operators are having to kick off jobs manually. In the event log we see this error. What can we do to quickly resolve this issue?

A database error occurred while executing the statement:
insert into BPAScheduleLog (scheduleid, instancetime, firereason, heartbeat, servername) values (@scheduleid, @instant, @reason, getutcdate(), @server); select scope_identity()

Error Details: System.Data.SqlClient.SqlException: Violation of UNIQUE KEY constraint 'UNQ_BPAScheduleLog_scheduleid_time'. Cannot insert duplicate key in object 'dbo.BPAScheduleLog'. The duplicate key value is (238, Aug 7 2018 2:00AM).
The statement has been terminated.
at BluePrism.AutomateAppCore.clsDBConnection.ReportError(SqlCommand cmd, Exception ex)
at BluePrism.AutomateAppCore.clsDBConnection.ExecuteReturnScalar(SqlCommand cmd)
at BluePrism.AutomateAppCore.clsServer.SchedulerCreateLog(Int32 scheduleId, DateTime instant, TriggerActivationReason reason, String schedulerName)
at BluePrism.AutomateAppCore.DatabaseBackedScheduleStore.CreateLog(ITriggerInstance inst, TriggerActivationReason reason)
at BluePrism.Scheduling.BackgroundThreadScheduler.OnTriggered(TriggeredEventArgs args)
at BluePrism.Scheduling.SchedulerThread.ActivateTriggers(DateTime instant)
at BluePrism.Scheduling.SchedulerThread.ProcessRunState()
at BluePrism.Scheduling.SchedulerThread.Run()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
 

VJR

Well-Known Member
Hi Colin,

I haven't encountered this error before but I can suggest you to try out some changes.
The error message states that a row in the database is being inserted and during the insert it is adding the same value to a key column value which is already present in the database (as another row).

Table Name: BPAScheduleLog
Column Name: UNQ_BPAScheduleLog_scheduleid_time
Duplicate Value: 238, Aug 7 2018 2:00AM

As per database concepts a same value cannot be held inside a table on a column which is defined as a key column (UNQ_BPAScheduleLog_scheduleid_time in this case) .
So you can request the control room operators, who may have access to the database, to open this table and either modify this old entry or delete if not needed after identifying to which process or an old run it belongs to. 238 appears to be a Schedule Id so maybe something like editing the time (Aug 7 2018 2:00AM to Aug 7 2018 2:01AM) or totally deleting the old Schedules and re-creating another one so that no duplicate entry will be added the next time.

Something may have have happened after the reboot and we don't know what that is. If this one time change works out then you are good, but if not then there may be a slightly bigger problem than this and needs to be investigated further.
 
Top