No active server found

queues
sql-server
dashboard
Tags: #<Tag:0x00007fa53bbbeb70> #<Tag:0x00007fa53bbbea30> #<Tag:0x00007fa53bbbe7b0>

#1

Hi everyone,
I have read the forum but I have not found an answer to my problem. I am using MVC5.
I have followed theese instructions: http://docs.hangfire.io/en/latest/tutorials/send-email.html#id3

So im my startup.cs file I have added the following code:

public partial class Startup
{
    public void ConfigureHangfire(IAppBuilder app)
    {
        var sqlOptions = new SqlServerStorageOptions
        {
            QueuePollInterval = TimeSpan.FromSeconds(1)
        };

        GlobalConfiguration.Configuration
            .UseSqlServerStorage("Accounts", sqlOptions)
            .UseFilter(new LogEmailFailureAttribute());

        app.UseHangfireDashboard();
        app.UseHangfireServer();
    }
}

Then I call the method:

[assembly: OwinStartupAttribute(typeof(Intranet.Startup))]
namespace Intranet
{
    public partial class Startup
    {
         public void Configuration(IAppBuilder app)
         {
             ConfigureHangfire(app);
         }
     }
}

No exception is raised.
Then I try to send an email in backgroud, but my background job never run. In my dashboard I can see the enqueued job but I do not see any active server.

I am using SQL Server.

Can anyone help me to understand why the server do not start?

Thank you


#2

I was having this problem. SQL Server was reporting a login failure for the domain\machinename that Hangfire was on. It turns out I had to make sure that the IIS Application pool identity also had permission to use the database. We were using identity impersonation; so, I ended up changing the identity to the same user we were impersonating rather than the default ApplicationPoolIdentity. When I restarted the application pool, the server came right up.