Bladed Knowledge Base

Batch Error: Sequence contains no matching element
Category: Bladed Batch

Problem

Bladed Batch terminates with a handled exception stating that the "Sequence contains no matching element".

Batch Sequence Error

This is also captured in the Batch log file (C:\Users\XXXX\AppData\Local\Temp\5\GH.BatchFramework.Clinet.log). This results from the corruption of a Batch configuration resulting from a failure to save a job status correctly or a crash during a prior operation.

Log

2021-07-06 12:23:39,421 [6] INFO  Manager: 9376c811-d906-4eb6-899c-808d0309fa86 -  re-registering existing runners
2021-07-06 12:23:39,444 [14] INFO  Manager: 9376c811-d906-4eb6-899c-808d0309fa86 - Resetting job JAU23-Vout-t3-0-a270:ce4e77c9-eb4d-42f8-9bce-e46d54fa8c21, which was in Preparing state on startup.
2021-07-06 12:23:39,450 [14] INFO  Manager: 9376c811-d906-4eb6-899c-808d0309fa86 - Abort requested, but no jobs specified. Ignoring
2021-07-06 12:23:39,455 [14] ERROR GH.BatchFramework.Client.Program - Global exceptionHandler caught 
System.InvalidOperationException: Sequence contains no matching element
   at System.Linq.Enumerable.First[TSource](IEnumerable`1 source, Func`2 predicate)
   at GH.Wolverine.Modules.Batch.Entities.Manager.PerformBulkEditOnListOfJobsSync(List`1 jobIds, JobEditType bulkEditType)
   at GH.Wolverine.Modules.Batch.Entities.Manager.CheckJobRunsAreInAGoodStateOnStartup()
   at GH.Wolverine.Modules.Batch.Entities.Manager.<InitializeBatchRootFile>b__108_0()
   at GH.Wolverine.Modules.Batch.Serialization.BatchFileSystemSerializer.jobListLoader_Completed(Object sender, RunWorkerCompletedEventArgs e)
   at System.ComponentModel.BackgroundWorker.OnRunWorkerCompleted(RunWorkerCompletedEventArgs e)
   at System.ComponentModel.BackgroundWorker.AsyncOperationCompleted(Object arg)
   at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state)
   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.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
2021-07-06 12:23:39,462 [14] ERROR GH.BatchFramework.Client.Program - Terminating: True

Solution

The simplest resolution to this is the deletion of the contents of the Batch folder: C:\Users\XXXXX\DNV GL\Batch\DefaultBatchDirectory.

WARNING! Deletion of the contents will remove the corrupted element but also the batch configuration - it will need to be re-setup.





Keywords Batch; Corrupt; Bladed; Log