Greetings!
There seems to be a discrepancy between running jobs and Hangfire Server count displayed in the Dashboard. Jobs keep performing but the Dashboard shows 0 Servers. When in the Servers tab no servers are displayed too.
Repro steps: random occurrence
Context:
Context
-number of apps working with this hangfire database - 1 (only this, simplest case, no multi-app meddling)
-number of hangfire servers in the app - 8 (shows 0)
-nuget Hangfire.AspNetCore version: 1.7.18
-host hardware: checked hardware resources should be ok 99.99% of the time, sometimes processor spikes to high loads due to (different) 3rd party apps hosted on the same machine.
-ASP.NET Core 3.1 configuration: (usage of db provider defined in .UseHangfire() method only, not in .UseHangfireDashboard - normally working ok)
-types of jobs being done: IBackgroundJobClient.Enqueue, via IBackgroundJobClient injected in the class by ASP.NET (default case when not calling the static BackgroundJob.Enqueue)
Configuration code
services.AddHangfire((serviceProvider, config) =>
{
config.UsePostgreSqlStorage(hangfireDbConnectionString,
new PostgreSqlStorageOptions()
{
InvisibilityTimeout = TimeSpan.FromHours(12),
PrepareSchemaIfNecessary = false,
});
config.UseFilter(serviceProvider.GetRequiredService<HangfireJobFilters>());
});
public void UseHangfireDashbord(IApplicationBuilder app)
{
app.UseHangfireDashboard("/hangfire", new DashboardOptions
{
Authorization = new[]
{
new BasicAuthAuthorizationFilter(
options: new BasicAuthAuthorizationFilterOptions
{
RequireSsl = false,
SslRedirect = false,
LoginCaseSensitive = true,
Users = new []
{
new BasicAuthAuthorizationUser
{
Login = _hangfireConfiguration.BasicAuthAuthorizationUser.Username,
PasswordClear = _hangfireConfiguration.BasicAuthAuthorizationUser.Password
}
}
})
},
IsReadOnlyFunc = (DashboardContext context) => _hangfireConfiguration.IsHangfireDashboardReadOnly
});
}
After some time (tracked around 1 hr) the servers go back up to standard. This happens auto-magically. No app restart or anything.
Any knowledge on why is the Dashboard’s showing 0 servers?
Is it a known issue?
Is it event a dashboard problem or is it something deeper and concerning?