Recurring job failed without any mention

Tags: #<Tag:0x00007f066b98c6f0> #<Tag:0x00007f066b98c538> #<Tag:0x00007f066b98c3f8>

I use MS SQL to storage Hangfire data and self-written logger to log all stuff from Hangfire on my Asp.net MVC 5 site. The problem is I can startup Hangfire, configure it, add new recurring job without any problems, but it just doesn’t work (failed state in Hangfire.Job table).

I use OwinStartup configuration:

public static void ConfigureHangfire(IAppBuilder app, string connectionName)
{
	var options = new SqlServerStorageOptions
	{
		QueuePollInterval = TimeSpan.FromSeconds(10)
	};

	GlobalConfiguration.Configuration.UseSqlServerStorage(connectionName, options);

	// Do not try to rerun failed jobs by default!
	GlobalJobFilters.Filters.Add(new AutomaticRetryAttribute { Attempts = 0 });

	// Add logs into passed log
	LogProvider.SetCurrentLogProvider(new MyLogProvider()));

	app.UseHangfireServer();
}

So I have 2 question:

  1. How can I make it work?
  2. Why do I not get any log error messages?

And I’ve found out answers to all questions:

First of all, my logging became work after I had commented this line:

GlobalJobFilters.Filters.Add(new AutomaticRetryAttribute { Attempts = 0 });

I’ve tried to change Attempts to 1, but it still has not worked. Only full commenting of this code helped. Is this a bug? Frankly, I think so.

And after commenting I’ve got an opportunity to receive a problem message. And the problem is the class which owns called method isn’t contains parameterless constructor.