Dashboard error: Object reference not set to an instance of an object

Hello

when i try to access to /JobsQueue/jobs/scheduled

i get this error:

Server Error in ‘/’ Application.
Object reference not set to an instance of an object.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.]
Hangfire.Common.TypeExtensions.GetFullNameWithoutNamespace(Type type) +79
Hangfire.Common.TypeExtensions.ToGenericTypeString(Type type) +35
Hangfire.Common.Job.ToString() +37
Hangfire.Dashboard.HtmlHelper.JobNameLink(String jobId, Job job) +61
Hangfire.Dashboard.Pages.ScheduledJobsPage.Execute() +3418
Hangfire.Dashboard.RazorPage.TransformText(String body) +30
Hangfire.Dashboard.RazorPageDispatcher.Dispatch(RequestDispatcherContext context) +145
Hangfire.Dashboard.<>c__DisplayClass1_1.b__1(IDictionary`2 env) +459
Microsoft.Owin.Mapping.d__0.MoveNext() +461
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +13877064
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +61
Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.d__5.MoveNext() +203
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +13877064
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +61
Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.d__2.MoveNext() +193
Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.StageAsyncResult.End(IAsyncResult ar) +96
System.Web.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +363
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +157

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.6.81.0

It was working correctly with HangFire 1.4, and started to produce this error after migrating to 1.6 (with NUGET)

Any Help will be greatly appreciated :slight_smile:

1 Like

Bump, i’m still looking for a solution to this issue

Is this still an issue for you with the stable 1.6?

it seems to be fixed, thanks :slight_smile:

Hi all,
I have the same issue in all the 1.6.*.
All seem to work correctly with the 1.5.9.

Is an issue or I’m making some configuration mistakes?

Thanks

I exactly get same error in succeeded jobs page. my error details are exactly same as above, line by line. earlier version works fine. deleting database didnt help.
framework 4.5.2 and sql2016.

Maybe it helps, I dropped all tables.
noticed that when there jobs, “scheduled” page throws that error.
succeeded page works fine, shows no record.
when jobs complete then “succeeded” page thows that error and scheduled page works fine again

I create jobs exactly as in previous versions.

Exactly,
the error appears only if there is some elements to list.

The 1.6.2 work fine with a web API application.
The issue is in a webpages site with razor.

Hope this help

I got the issue…
seems that the problem is when we call in enqueue a method that have no namespace…

Can you check and fix?

Regards

Thanks for investigating the problem, @IdWeb! The fix will be released with Hangfire 1.6.3 today!

Perfect!
Thanks very much.

Regards

Hi, when i try to access to /hangfire/jobs/enqueued
i get this error:

Server Error in ‘/’ Application.
Object reference not set to an instance of an object.

Stack trace:

[NullReferenceException: Object reference not set to an instance of an object.]
MySql.Data.MySqlClient.NativeDriver.ExecutePacket(MySqlPacket packetToExecute) +37
MySql.Data.MySqlClient.NativeDriver.SendQuery(MySqlPacket queryPacket) +48
MySql.Data.MySqlClient.Driver.SendQuery(MySqlPacket p) +26
MySql.Data.MySqlClient.Statement.ExecuteNext() +89
MySql.Data.MySqlClient.PreparableStatement.Execute() +47
MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior) +1527
MySql.Data.MySqlClient.MySqlCommand.ExecuteNonQuery() +147
MySql.Data.MySqlClient.MySqlTransaction.Rollback() +115
MySql.Data.MySqlClient.MySqlTransactionScope.Rollback(SinglePhaseEnlistment singlePhaseEnlistment) +148
MySql.Data.MySqlClient.MySqlPromotableTransaction.System.Transactions.IPromotableSinglePhaseNotification.Rollback(SinglePhaseEnlistment singlePhaseEnlistment) +35
System.Transactions.DurableEnlistmentAborting.EnterState(InternalEnlistment enlistment) +374
System.Transactions.TransactionStateAborted.EnterState(InternalTransaction tx) +218
System.Transactions.Transaction.Rollback() +244
System.Transactions.TransactionScope.InternalDispose() +424
System.Transactions.TransactionScope.Dispose() +2301
Hangfire.MySql.MySqlStorage.UseTransaction(Func2 func, Nullable1 isolationLevel) +246
Hangfire.MySql.Monitoring.MySqlMonitoringApi.SucceededJobs(Int32 from, Int32 count) +148
Hangfire.Dashboard.Pages.SucceededJobs.Execute() +423
Hangfire.Dashboard.RazorPage.TransformText(String body) +30
Hangfire.Dashboard.RazorPageDispatcher.Dispatch(DashboardContext context) +85
Hangfire.Dashboard.<>c__DisplayClass1_2.b__1(IDictionary`2 env) +465
Microsoft.Owin.Mapping.d__0.MoveNext() +460
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +31
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +62
Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.d__5.MoveNext() +202
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +31
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +62
Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.d__2.MoveNext() +193
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +31
Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.StageAsyncResult.End(IAsyncResult ar) +119
System.Web.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +365
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +134

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.2106.0

Hangfire version 1.6.17

Hi Guys , i tried this and it worked , try to delete the hangfire tables in databases and recreat them , it worked for me