Open Closed

Hangfire RecurringJob is throwing an error When trying update to abp v9 #8560


User avatar
0
cangunaydin created
  • ABP Framework version: v9.0.2
  • UI Type: Angular
  • Database System: EF Core ( PostgreSQL)
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes
  • Exception message and full stack trace:

Hello, I am trying to upgrade my project to abp v9 When i run my backend, i am getting an exception. I use Hangfire for background jobs and background workers. Here is the exception i am getting from Volo.Abp.Identity.Pro.Domain

[19:16:09 FTL] Doohlink.HttpApi.Host terminated unexpectedly! Volo.Abp.AbpInitializationException: An error occurred during the initialize Volo.Abp.Modularity.OnApplicationInitializationModuleLifecycleContributor phase of the module Volo.Abp.Identity.AbpIdentityProDomainModule, Volo.Abp.Identity.Pro.Domain, Version=9.0.2.0, Culture=neutral, PublicKeyToken=null: Current storage doesn't support specifying queues directly for a specific job. Please use the QueueAttribute instead.. See the inner exception for details. ---> System.NotSupportedException: Current storage doesn't support specifying queues directly for a specific job. Please use the QueueAttribute instead. at Hangfire.RecurringJobManager.AddOrUpdate(String recurringJobId, Job job, String cronExpression, RecurringJobOptions options) in C:\projects\hangfire-525\src\Hangfire.Core\RecurringJobManager.cs:line 108 at Hangfire.RecurringJob.AddOrUpdate(String recurringJobId, String queue, Expression`1 methodCall, String cronExpression, RecurringJobOptions options) in C:\projects\hangfire-525\src\Hangfire.Core\RecurringJob.cs:line 568 at Volo.Abp.BackgroundWorkers.Hangfire.HangfireBackgroundWorkerManager.AddAsync(IBackgroundWorker worker, CancellationToken cancellationToken) at Volo.Abp.Identity.AbpIdentityProDomainModule.OnApplicationInitializationAsync(ApplicationInitializationContext context) at Volo.Abp.Modularity.OnApplicationInitializationModuleLifecycleContributor.InitializeAsync(ApplicationInitializationContext context, IAbpModule module) at Volo.Abp.Modularity.ModuleManager.InitializeModulesAsync(ApplicationInitializationContext context) --- End of inner exception stack trace --- at Volo.Abp.Modularity.ModuleManager.InitializeModulesAsync(ApplicationInitializationContext context) at Volo.Abp.AbpApplicationBase.InitializeModulesAsync() at Volo.Abp.AbpApplicationWithExternalServiceProvider.InitializeAsync(IServiceProvider serviceProvider) at Microsoft.AspNetCore.Builder.AbpApplicationBuilderExtensions.InitializeApplicationAsync(IApplicationBuilder app) at Doohlink.Program.Main(String[] args) in C:\dev\projects\Adzup\aspnet-core\src\Doohlink.HttpApi.Host\Program.cs:line 91

and here is how i configure my hangfire.

 private void ConfigureHangfire(ServiceConfigurationContext context, IConfiguration configuration)
    {
        context.Services.AddHangfire(config =>
        {
            config.UsePostgreSqlStorage(configuration.GetConnectionString("Default"),
                new PostgreSqlStorageOptions()
                {
                    DistributedLockTimeout = TimeSpan.FromMinutes(1)
                });
        });
    }

is this a bug?


3 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    ABP 9 is targeted to net9.0. Is the UsePostgreSqlStorage support net 9 as well?

    In fact, this error is not related to abp.

    Thanks

  • User Avatar
    0
    cangunaydin created

    Hello, Yes i figured it out. It is caused by old nuget package Hangfire.PostgreSql 1.19.12. When i upgraded that to 1.20.10 it is solved. We can close this. thank you.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    : )

Made with ❤️ on ABP v9.1.0-preview. Updated on January 02, 2025, 07:06