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

dashboard
Tags: #<Tag:0x00007f8d7d1d8f50>

#1

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:


#2

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


#3

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


#4

it seems to be fixed, thanks :slight_smile:


#5

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


#6

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.


#7

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.


#8

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


#9

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

Hope this help


#10

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


#11

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


#12

Perfect!
Thanks very much.

Regards


#13

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


#14

Hangfire version 1.6.17