arnoldasgudas / Hangfire.MySqlStorage

MySql storage for Hangfire - fire-and-forget, delayed and recurring tasks runner
GNU Lesser General Public License v3.0
175 stars 114 forks source link

MonitoringLogger - Connection must be Open; current state is Closed #85

Closed sarunprasath closed 11 months ago

sarunprasath commented 2 years ago

Jobs are working initially,, But it has broken the hangfire and not able trigger or deleted..

System.InvalidOperationException: Connection must be Open; current state is Closed at MySqlConnector.MySqlConnection.getSession() in //src/MySqlConnector/MySqlConnection.cs:line 655 at MySqlConnector.Core.ICancellableCommandExtensions.ResetCommandTimeout(ICancellableCommand command) in /_/src/MySqlConnector/Core/ICancellableCommand.cs:line 41 at MySqlConnector.MySqlCommand.d69.MoveNext() in //src/MySqlConnector/MySqlCommand.cs:line 263 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at MySqlConnector.MySqlCommand.ExecuteNonQuery() in //src/MySqlConnector/MySqlCommand.cs:line 100 at MySqlConnector.Core.XaEnlistedTransaction.ExecuteXaCommand(String statement) in //src/MySqlConnector/Core/XaEnlistedTransaction.cs:line 48 at MySqlConnector.Core.XaEnlistedTransaction.OnRollback(Enlistment enlistment) in //src/MySqlConnector/Core/XaEnlistedTransaction.cs:line 41 at MySqlConnector.Core.EnlistedTransactionBase.System.Transactions.IEnlistmentNotification.Rollback(Enlistment enlistment) in /_/src/MySqlConnector/Core/EnlistedTransactionBase.cs:line 39 at System.Transactions.VolatileEnlistmentAborting.EnterState(InternalEnlistment enlistment) at System.Transactions.TransactionStateAborted.EnterState(InternalTransaction tx) at System.Transactions.Transaction.Rollback() at System.Transactions.TransactionScope.InternalDispose() at System.Transactions.TransactionScope.Dispose() at Hangfire.MySql.MySqlStorage.UseTransaction[T](Func2 func, Nullable1 isolationLevel) at Hangfire.MySql.MySqlStorage.UseTransaction(Action`1 action) at Hangfire.RecurringJobManager.Trigger(String recurringJobId) at Hangfire.Dashboard.BatchCommandDispatcher.d3.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Hangfire.Dashboard.MiddlewareExtensions.<>cDisplayClass1_1.<b1>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.Owin.Mapping.MapMiddleware.d0.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.IntegratedPipelineContextStage.d7.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.IntegratedPipelineContext.d__12.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.StageAsyncResult.End(IAsyncResult ar) at System.Web.HttpApplication.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

federicofz85 commented 11 months ago

Hi, I'm having the same issue after 1 year without incidences. Any idea on how to solve this? Server restart maybe?

sarunprasath commented 11 months ago
federicofz85 commented 11 months ago

Server restart didn't help but I just created a new db just for hangfire and it solved my issue. Thanks

sarunprasath commented 11 months ago

Check primary key as well that should solve

On Fri, 1 Dec 2023 at 11:53 PM, Federico @.***> wrote:

Server restart didn't help but I just created a new db just for hangfire and it solved my issue. Thanks

— Reply to this email directly, view it on GitHub https://github.com/arnoldasgudas/Hangfire.MySqlStorage/issues/85#issuecomment-1836577568, or unsubscribe https://github.com/notifications/unsubscribe-auth/AH74BIBYTP443FCI3PHIJATYHIOA7AVCNFSM5JY7PV5KU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOBTGY2TONZVGY4A . You are receiving this because you modified the open/close state.Message ID: @.***>