QueryTree
QueryTree copied to clipboard
Scheduled reports error on save
When trying to schedule reports an error pops up. Looking at the logs this is what I am seeing any ideas?
---> System.InvalidOperationException: Current JobStorage instance has not been initialized yet. You must set it before using Hangfire Client or Server API. For .NET Core applications please call the IServiceCollection.AddHangfire
extension method from Hangfire.NetCore or Hangfire.AspNetCore package depending on your application type when configuring the services and ensure service-based APIs are used instead of static ones, like IBackgroundJobClient
instead of BackgroundJob
and IRecurringJobManager
instead of RecurringJob
.
at Hangfire.JobStorage.get_Current()
at Hangfire.RecurringJobManager..ctor()
at Hangfire.RecurringJob.<>c.<.cctor>b__21_0()
at System.Lazy1.CreateValue() at Hangfire.RecurringJob.AddOrUpdate(String recurringJobId, Expression
1 methodCall, String cronExpression, TimeZoneInfo timeZone, String queue)
at QueryTree.Controllers.ApiController.AddOrUpdateJob(ScheduledReport schedule, String editUrl, String period) in /build/Web/Controllers/ApiController.cs:line 393
at QueryTree.Controllers.ApiController.AddOrUpdateScheduleJob(ScheduledReport schedule, String editUrl) in /build/Web/Controllers/ApiController.cs:line 370
at QueryTree.Controllers.ApiController.AddOrUpdateScheduleTask(ScheduledReport scheduledReport) in /build/Web/Controllers/ApiController.cs:line 362
at QueryTree.Controllers.ApiController.Schedule(ScheduledReportViewModel model) in /build/Web/Controllers/ApiController.cs:line 350
at lambda_method615(Closure , Object )
at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
--- End of stack trace from previous location ---
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()
--- End of stack trace from previous location ---
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)