# App Hard Crash (Owin stack overflow) when visiting Dashboard in Production, but not Dev

**URL:** <https://discuss.hangfire.io/t/app-hard-crash-owin-stack-overflow-when-visiting-dashboard-in-production-but-not-dev/11387>\
**Category:** bug?\
**Tags:** dashboard\
**Created:** [October 10, 2025, 6:36pm UTC](https://discuss.hangfire.io/t/app-hard-crash-owin-stack-overflow-when-visiting-dashboard-in-production-but-not-dev/11387 "2025-10-10T18:36:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mpgrady82](https://dub1.discourse-cdn.com/flex017/user_avatar/discuss.hangfire.io/mpgrady82/32/4044_2.png) [@mpgrady82](https://discuss.hangfire.io/u/mpgrady82)\
**Post date:** [October 10, 2025, 6:36pm UTC](https://discuss.hangfire.io/t/app-hard-crash-owin-stack-overflow-when-visiting-dashboard-in-production-but-not-dev/11387/1 "2025-10-10T18:36:25Z")

</div>

In my two release builds (Stage & Production), the app will hard crash to an azure 502 error whenever I try and hit the hangfire dashbaord. The same code built in debug works (dev) has no issue hitting the dashboard. Locally I have tried a few things to reproduce the issue via release builds and have been unable to reproduce.

The stack overflow log looks something like:

FaultingExceptionFrame  
HelperMethodFrame  
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()  
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)  
Microsoft.Owin.Security.Infrastructure.AuthenticationMiddleware`1+<Invoke>d__5[[System.__Canon, mscorlib]].MoveNext() System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run() System.Threading.Tasks.AwaitTaskContinuation.RunCallback(System.Threading.ContextCallback, System.Object, System.Threading.Tasks.Task ByRef) System.Threading.Tasks.Task.FinishContinuations() System.Threading.Tasks.Task.Finish(Boolean) System.Threading.Tasks.Task`1[[System.Threading.Tasks.VoidTaskResult, mscorlib]].TrySetException(System.Object)  
System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.Threading.Tasks.VoidTaskResult, mscorlib]].SetException(System.Exception) Microsoft.Owin.Security.Infrastructure.AuthenticationMiddleware`1+d\_\_5[[System.\_\_Canon, mscorlib]].MoveNext()  
HelperMethodFrame  
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()  
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)  
Microsoft.Owin.Security.Infrastructure.AuthenticationMiddleware`1+<Invoke>d__5[[System.__Canon, mscorlib]].MoveNext() System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run() System.Threading.Tasks.AwaitTaskContinuation.RunCallback(System.Threading.ContextCallback, System.Object, System.Threading.Tasks.Task ByRef) System.Threading.Tasks.Task.FinishContinuations() System.Threading.Tasks.Task.Finish(Boolean) System.Threading.Tasks.Task`1[[System.Threading.Tasks.VoidTaskResult, mscorlib]].TrySetException(System.Object)  
System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.Threading.Tasks.VoidTaskResult, mscorlib]].SetException(System.Exception) Microsoft.Owin.Security.Infrastructure.AuthenticationMiddleware`1+d\_\_5[[System.\_\_Canon, mscorlib]].MoveNext()  
HelperMethodFrame

---

<div class="post-metadata">

**Author:** ![odinserj](https://dub1.discourse-cdn.com/flex017/user_avatar/discuss.hangfire.io/odinserj/32/648_2.png) [@odinserj](https://discuss.hangfire.io/u/odinserj)\
**Post date:** [October 16, 2025, 10:12am UTC](https://discuss.hangfire.io/t/app-hard-crash-owin-stack-overflow-when-visiting-dashboard-in-production-but-not-dev/11387/2 "2025-10-16T10:12:39Z")

</div>

Does it look similar to [OWIN Stack overflow exception · Issue #424 · aspnet/AspNetKatana · GitHub](https://github.com/aspnet/AspNetKatana/issues/424) ? I would appreciate it if you could share the first lines of the exception to understand the originating method for this. Also, could you share your configuration code here?

---

<div class="post-metadata">

**Author:** ![mpgrady82](https://dub1.discourse-cdn.com/flex017/user_avatar/discuss.hangfire.io/mpgrady82/32/4044_2.png) [@mpgrady82](https://discuss.hangfire.io/u/mpgrady82)\
**Post date:** [October 17, 2025, 1:51pm UTC](https://discuss.hangfire.io/t/app-hard-crash-owin-stack-overflow-when-visiting-dashboard-in-production-but-not-dev/11387/3 "2025-10-17T13:51:08Z")

</div>

it is similar to that issue. The error above is pasted directly from the azure logs, so I don’t have much more I can give

```auto
  GlobalConfiguration.Configuration
      .UseSqlServerStorage("IdentityConnection",
       new Hangfire.SqlServer.SqlServerStorageOptions()
       {
           //SchemaName = "grady"
       });

  app.UseHangfireDashboard("/hangfire",
      new DashboardOptions
      {
          Authorization = new[] { new Hangfire.Dashboard.AuthorizationFilter() { Roles = "NationalAdministrators" } }                    
      });

  if (h.GetIsHangfireEnabled())
  {
      app.UseHangfireServer();

      TaskManager.Bootstrap();
  }                

```

The site itself is a multi domained + identiyserver3 setup.
