We are using Hangfire to schedule service calling. It was working fine all the way…
As queried from Hangfire db, the status stuck at processing and never succeed or failed, and i found that it hit null reference exception when try to perform the job:
2020-03-25 19:00:08.0146|Debug|AppStart|Hangfire.Server.Worker|Worker.Execute => Worker.TryChangeState => NLogLogger.LogException
State change attempt 1 of 10 failed due to an error, see inner exception for details
System.NullReferenceException: Object reference not set to an instance of an object.
at Hangfire.Common.JobFilterProviderCollection.d__4.MoveNext()
at System.Linq.Buffer1..ctor(IEnumerable
1 source)
at System.Linq.Enumerable.d__a01.MoveNext() at System.Linq.Enumerable.WhereSelectEnumerableIterator
2.MoveNext()
at System.Collections.Generic.List1..ctor(IEnumerable
1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source) at Hangfire.Common.JobFilterInfo..ctor(IEnumerable
1 filters)
at Hangfire.States.StateMachine.ApplyState(ApplyStateContext initialContext)
at Hangfire.States.BackgroundJobStateChanger.ChangeState(StateChangeContext context)
at Hangfire.Server.Worker.TryChangeState(BackgroundProcessContext context, IStorageConnection connection, IFetchedJob fetchedJob, IState state, String[] expectedStates, CancellationToken cancellationToken)
Any idea what is the reason caused this? It was recovered after a recycle app pool.