Я обновил до последней версии Hangfire.Mon go (0.6.7) и последних драйверов MongoDB (2.10.3). После обновлений некоторые задания Hangfire выдают это исключение:
A bulk write operation resulted in one or more errors. Cannot create field 'Continuations' in element {Parameters: [ [ "CurrentCulture", ""en-SE"" ], [ "CurrentUICulture", ""en-US"" ] ]}'
Любые попытки запустить задание с BackgroundJob.ContinueJobWith
выдают это исключение.
Вот где я отследил исключение в Visual Studio:
Это трассировка стека:
at MongoDB.Driver.MongoCollectionImpl`1.BulkWrite(IClientSessionHandle session, IEnumerable`1 requests, BulkWriteOptions options, CancellationToken cancellationToken)
at MongoDB.Driver.MongoCollectionImpl`1.<>c__DisplayClass23_0.<BulkWrite>b__0(IClientSessionHandle session)
at MongoDB.Driver.MongoCollectionImpl`1.UsingImplicitSession[TResult](Func`2 func, CancellationToken cancellationToken)
at MongoDB.Driver.MongoCollectionImpl`1.BulkWrite(IEnumerable`1 requests, BulkWriteOptions options, CancellationToken cancellationToken)
at Hangfire.Mongo.MongoWriteOnlyTransaction.Commit() in C:\Code\Hangfire.Mongo\src\Hangfire.Mongo\MongoWriteOnlyTransaction.cs:line 400
at Hangfire.Mongo.MongoConnection.SetJobParameter(String id, String name, String value) in C:\Code\Hangfire.Mongo\src\Hangfire.Mongo\MongoConnection.cs:line 76
at Hangfire.ContinuationsSupportAttribute.AddContinuation(ElectStateContext context, AwaitingState awaitingState)
at Hangfire.Profiling.ProfilerExtensions.InvokeAction[TInstance](InstanceAction`1 tuple)
at Hangfire.Profiling.EmptyProfiler.InvokeMeasured[TInstance,TResult](TInstance instance, Func`2 action, String message)
at Hangfire.Profiling.ProfilerExtensions.InvokeMeasured[TInstance](IProfiler profiler, TInstance instance, Action`1 action, String message)
at Hangfire.States.StateMachine.ApplyState(ApplyStateContext initialContext)
at Hangfire.Client.CoreBackgroundJobFactory.<>c__DisplayClass14_0.<Create>b__3(Int32 attempt)
at Hangfire.Client.CoreBackgroundJobFactory.<>c__DisplayClass15_0.<RetryOnException>b__0(Int32 attempt)
at Hangfire.Client.CoreBackgroundJobFactory.RetryOnException[T](Int32& attemptsLeft, Func`2 action)