Background job creation failed. See inner exception for details

sql-server
Tags: #<Tag:0x00007f49a42147e8>

#1

I am using azure sql database and using latest hang fire version 1.7.6.
I am getting below error on production… Around 30000 files are processed… Any idea how this could be fixed.

Background job creation failed. See inner exception for details.

System.Data.SqlClient.SqlException (0x80131904): Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server

is not responding. —> System.ComponentModel.Win32Exception (0x80004005): The wait operation timed out

at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)

at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)

at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet

bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)

at
System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean

forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted)

at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32

timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)

at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method,

TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)

at
System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout,

Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)

at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()

at Hangfire.SqlServer.SqlCommandBatch.ExecuteNonQuery()

at Hangfire.SqlServer.SqlServerWriteOnlyTransaction.<Commit>b__12_0(DbConnection connection, DbTransaction transaction)

at Hangfire.SqlServer.SqlServerStorage.<>c__DisplayClass33_0.<UseTransaction>b__0(DbConnection connection, DbTransaction transaction)

at Hangfire.SqlServer.SqlServerStorage.UseConnection[T](DbConnection dedicatedConnection, Func`2 func)

at Hangfire.SqlServer.SqlServerStorage.UseTransaction[T](DbConnection dedicatedConnection, Func3 func, Nullable1 isolationLevel)

at
Hangfire.SqlServer.SqlServerStorage.UseTransaction(DbConnection dedicatedConnection, Action`2 action)

at Hangfire.SqlServer.SqlServerWriteOnlyTransaction.Commit()

at Hangfire.States.BackgroundJobStateChanger.ChangeState(StateChangeContext context)

at Hangfire.ContinuationsSupportAttribute.ExecuteContinuationsIfExist(ElectStateContext context)

at Hangfire.ContinuationsSupportAttribute.OnStateElection(ElectStateContext context)

at Hangfire.Profiling.ProfilerExtensions.InvokeAction[TInstance](InstanceAction`1 tuple)

at Hangfire.Profiling.SlowLogProfiler.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.States.BackgroundJobStateChanger.ChangeState(StateChangeContext context)

at Hangfire.Server.Worker.TryChangeState(BackgroundProcessContext context, IStorageConnection connection, IFetchedJob fetchedJob, IState state, String[]

expectedStates, CancellationToken initializeToken, CancellationToken abortToken)

ClientConnectionId:e7ca3e27-04b0-45e2-a2d9-bb3db90f315b