Multiple servers generating error 500 in HANGFIRE

1/15/2020

When I put the application into production with pod-managed Kubernetes architecture where it has the possibility of scaling so today it has two servers running the same application, hangfire recognizes both but returns an error 500

Unable to refresh the statistics: the server responded with 500 (error). Try reloading the page manually, or wait for automatic reload that will happen in a minute.

But when I leave on stage which is the testing application where there is only one server, hangfire works normally.

Hangfire Configuration:

Startup.cs

services.AddHangfire(x => x.UsePostgreSqlStorage(Configuration.GetConnectionString("DefaultConnection")));


app.UseHangfireDashboard("/hangfire", new DashboardOptions
{
   Authorization = new[] { new AuthorizationFilterHangfire() }
});           
app.UseHangfireServer();

Error

-- iago soares
asp.net-core
c#
hangfire
kubernetes

0 Answers