Activities of "kfrancis@clinicalsupportsystems.com"

There's a repro here: https://github.com/victoriatolls/Acme.BookStore.DistributedEvent

Working on using distributed events, though what we're seeing is that not all events are being received as expected (half?):

What you're seeing:

  • We're triggering a background job to be run from Web
  • That background job is being run within the Api.Host
  • When the background job is complete, we publish an event to notify the client (for the purpose of client-side notification)
  • In some cases (approximately half?) the message is received and can be dealt with properly (in SignalR hub which then causes client-side handler to ultimately call abp.notify
  • In other cases, nothing is occurring.

  • ABP Framework version: v7.4.2
  • UI Type: MVC
  • Database System: EF Core (SQL Server)
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes
  • Steps to reproduce the issue:

Here's the options:

Configure<AbpAzureServiceBusOptions>(options =>
{
    options.Connections.Default.Admin.Retry.MaxRetries = 3;
    options.Connections.Default.Client.RetryOptions.Delay = TimeSpan.FromMilliseconds(100);
    options.Connections.Default.Client.RetryOptions.MaxDelay = TimeSpan.FromSeconds(10);
    options.Connections.Default.Client.RetryOptions.Mode = Azure.Messaging.ServiceBus.ServiceBusRetryMode.Exponential;
    options.Connections.Default.Client.RetryOptions.MaxRetries = 10;
});
Question
  • ABP Framework version: v7.4.2
  • UI Type: MVC
  • Database System: EF Core (SQL Server)
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes, tiered

I'm seeing this logo flash when first loading any page in the app, not sure how to stop the lepton logo from appearing at all.

[Dependency(ReplaceServices = true)]
public class CabMDBrandingProvider : DefaultBrandingProvider
{
    public override string AppName => "CabMD";

    public override string LogoUrl => "/images/logo/logo_blue.png";

    public override string LogoReverseUrl => "/images/logo/logo_white_large.svg";
}

Is this a side effect of how the logo is rendered?

It doesn't seem to matter if I try and override it either based on this documentation: https://docs.abp.io/en/commercial/7.4/themes/lepton-x/mvc#main-header-branding

The content doesn't change and the problem persists (the following isn't rendered, but it doesn't look like that would even help the problem as lpx-brand-logo is being changed after initial render):

<a href="" class="lpx-brand-logo" data-woah="123"></a>

Just using standard localdb for local dev:

"ConnectionStrings": {
  "Default": "Server=(localdb)\\MSSQLLocalDB;Database=ProjectDb;Trusted_Connection=True;TrustServerCertificate=True"
}

Also, if it were a general permissions issue - I would have expected far more to be wrong, but everything works except this for me.

  • ABP Framework version: v7.4.1
  • UI Type: MVC
  • Database System: EF Core (SQL Server)
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes
  • Exception message and full stack trace:
[2023-11-15 12:42:02.262] [Error] DEV1-PC () <Microsoft.EntityFrameworkCore.Database.Command> Failed executing DbCommand ("3"ms) [Parameters=["@__p_1='?' (DbType = Int32), @__now_0='?' (DbType = DateTime2)"], CommandType='Text', CommandTimeout='30']"\r\n""SELECT TOP(@__p_1) [a].[Id], [a].[ConcurrencyStamp], [a].[CreationTime], [a].[ExtraProperties], [a].[IsAbandoned], [a].[JobArgs], [a].[JobName], [a].[LastTryTime], [a].[NextTryTime], [a].[Priority], [a].[TryCount]\r\nFROM [AbpBackgroundJobs] AS [a]\r\nWHERE [a].[IsAbandoned] = CAST(0 AS bit) AND [a].[NextTryTime] <= @__now_0\r\nORDER BY [a].[Priority] DESC, [a].[TryCount], [a].[NextTryTime]"
[2023-11-15 12:42:02.263] [Error] DEV1-PC () <Microsoft.EntityFrameworkCore.Query> An exception occurred while iterating over the results of a query for context type '"Volo.Abp.BackgroundJobs.EntityFrameworkCore.BackgroundJobsDbContext"'."\r\n""Microsoft.Data.SqlClient.SqlException (0x80131904): Invalid column name 'ConcurrencyStamp'.\r\nInvalid column name 'ExtraProperties'.\r\nInvalid column name 'JobName'.\r\n   at Microsoft.Data.SqlClient.SqlCommand.<>c.<ExecuteDbDataReaderAsync>b__209_0(Task`1 result)\r\n   at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke()\r\n   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)\r\n--- End of stack trace from previous location ---\r\n   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)\r\n   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)\r\n--- End of stack trace from previous location ---\r\n   at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)\r\n   at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)\r\n   at Microsoft.EntityFrameworkCore.Query.Internal.SplitQueryingEnumerable`1.AsyncEnumerator.InitializeReaderAsync(AsyncEnumerator enumerator, CancellationToken cancellationToken)\r\n   at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func`4 operation, Func`4 verifySucceeded, CancellationToken cancellationToken)\r\n   at Microsoft.EntityFrameworkCore.Query.Internal.SplitQueryingEnumerable`1.AsyncEnumerator.MoveNextAsync()\r\nClientConnectionId:1067e9e4-b969-4ddb-a740-d5b5df69f130\r\nError Number:207,State:1,Class:16"
Microsoft.Data.SqlClient.SqlException (0x80131904): Invalid column name 'ConcurrencyStamp'.
Invalid column name 'ExtraProperties'.
Invalid column name 'JobName'.
   at Microsoft.Data.SqlClient.SqlCommand.<>c.<ExecuteDbDataReaderAsync>b__209_0(Task`1 result)
   at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke()
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- End of stack trace from previous location ---
   at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Query.Internal.SplitQueryingEnumerable`1.AsyncEnumerator.InitializeReaderAsync(AsyncEnumerator enumerator, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func`4 operation, Func`4 verifySucceeded, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Query.Internal.SplitQueryingEnumerable`1.AsyncEnumerator.MoveNextAsync()

From what I can tell, the columns it's complaining about do exist and there are no pending migrations.

This is what's in the model snapshot as well, which also seems correct:

modelBuilder.Entity("Volo.Abp.BackgroundJobs.BackgroundJobRecord", b =>
    {
        b.Property<Guid>("Id")
            .ValueGeneratedOnAdd()
            .HasColumnType("uniqueidentifier");

        b.Property<string>("ConcurrencyStamp")
            .IsConcurrencyToken()
            .IsRequired()
            .HasMaxLength(40)
            .HasColumnType("nvarchar(40)")
            .HasColumnName("ConcurrencyStamp");

        b.Property<DateTime>("CreationTime")
            .HasColumnType("datetime2")
            .HasColumnName("CreationTime");

        b.Property<string>("ExtraProperties")
            .IsRequired()
            .HasColumnType("nvarchar(max)")
            .HasColumnName("ExtraProperties");

        b.Property<bool>("IsAbandoned")
            .ValueGeneratedOnAdd()
            .HasColumnType("bit")
            .HasDefaultValue(false);

        b.Property<string>("JobArgs")
            .IsRequired()
            .HasMaxLength(1048576)
            .HasColumnType("nvarchar(max)");

        b.Property<string>("JobName")
            .IsRequired()
            .HasMaxLength(128)
            .HasColumnType("nvarchar(128)");

        b.Property<DateTime?>("LastTryTime")
            .HasColumnType("datetime2");

        b.Property<DateTime>("NextTryTime")
            .HasColumnType("datetime2");

        b.Property<byte>("Priority")
            .ValueGeneratedOnAdd()
            .HasColumnType("tinyint")
            .HasDefaultValue((byte)15);

        b.Property<short>("TryCount")
            .ValueGeneratedOnAdd()
            .HasColumnType("smallint")
            .HasDefaultValue((short)0);

        b.HasKey("Id");

        b.HasIndex("IsAbandoned", "NextTryTime");

        b.ToTable("AbpBackgroundJobs", (string)null);
    });

Any ideas?

I have made a sample, though this isn't using hangfire: https://github.com/kfrancis/abp-hangfire-sample and that seems to work. If you seed and login under default/admin then go to the books listing, you can see one book (one is tenanted, one is not). Click on the book row to fill in the id, then click "run". You can see in the HttpApi.Host logs that the job is running and it's pulling the name of the book to use in the log entry.

  • The report job is enqueued from the BooksAppService
  • DI seems to be working normally
  • Data filtering seems to be working normally (using CurrentTenant.Change)
  • I've added SignalR to facilitate abp.notify on the clients when the background job completes (to the specific user)

Here's what that looks like:

If you can, would you be able to take a look and see what changes need to be made to make this use Hangfire?

I do see the SeperateBackgroundJob sample, but it's not quite the same use case. In most cases, I would think people would be running hangfire with the Web project and be able to queue jobs from any other code.

Hi,

We're in desperate need of a working abp sample using hangfire with SQL, where jobs can be enqueued from Web and Application (from AppService). Would this be possible?

We've having a heck of a time trying to get this working, because the documentation isn't straightforward enough and doesn't really include this scenario (enqueue job from app service) but it's vital for a job that generates reports which can be done from multiple clients (web, maui, etc).

  • ABP Framework version: v7.0.3 (trying to update)
  • UI Type: MVC
  • Database System: EF Core
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes

Issues we've run into:

  • Unidentified background job for the job args type (type here)
  • The job type is not registered to DI Volo.Abp.AbpException: The job type is not registered to DI: CabMD.GeneratedReports.GenerateReportJob at Volo.Abp.BackgroundJobs.BackgroundJobExecuter.ExecuteAsync(JobExecutionContext context) at Volo.Abp.BackgroundJobs.Hangfire.HangfireJobExecutionAdapter`1.ExecuteAsync(String queue, TArgs args) at InvokeStub_TaskAwaiter.GetResult(Object, Object, IntPtr*) at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)

What would be nice to see exactly:

  • What modules should be included in what. For example, when should AbpBackgroundJobsHangfireModule be used vs AbpBackgroundJobsAbstractionsModule, when does it matter?
  • What projects need to reference what?
  • Where should the code for background jobs be in the default tiered example?
  • Where does IsJobExecutionEnabled need to set? In what module(s)?
  • Where should JobStorage.Current be set?
  • The documentation suggests using UseAbpHangfireDashboard but AFAIK, that's not available - though maybe that's because of where I'm using it? Seeing this in a working example would be nice.

In my example, the job is simply defined:

public class GenerateReportJob: AsyncBackgroundJob&lt;GenerateReportJobArgs&gt;, ITransientDependency
{}

[Serializable]
public class GenerateReportJobArgs
{
    public GeneratedReportType_Id GeneratedReportType_Id { get; set; }
    public GeneratedReport_Id Id { get; internal set; }
    public string StringParam { get; set; }
    public ReportTaskType TaskTypeId { get; set; } // will be enum, likely report and score_card
    public User_Id UserId { get; set; }
    public int TenantId { get; set; }
}

Shared now with shiwei.liang@volosoft.com

I imagine there would need to be one of these per each (light, dark, dim)?

Question

We're having a hard time upgrading from v7.0.3 to v7.4.0 and from the looks of it, it's related to this dynamic proxy. We really want to keep using the dynamic proxy for the time being, as it's just one less step - but even generating the static proxy I continue to get errors.

  • ABP Framework version: v7.4.0
  • UI Type: MVC
  • Database System: EF Core (SQL Server)
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes
  • Exception message and full stack trace:
Volo.Abp.AbpException: Could not found remote action for method: System.Threading.Tasks.Task`1[CabMD.BillingAgents.BillingAgent_Id] GetCurrentBillingAgentAsync(System.Threading.CancellationToken) on the URL: https://localhost:44326/
   at Volo.Abp.Http.Client.DynamicProxying.ApiDescriptionFinder.FindActionAsync(HttpClient client, String baseUrl, Type serviceType, MethodInfo method)
   at Volo.Abp.Http.Client.DynamicProxying.DynamicHttpProxyInterceptor`1.GetActionApiDescriptionModel(IAbpMethodInvocation invocation)
   at Volo.Abp.Http.Client.DynamicProxying.DynamicHttpProxyInterceptor`1.InterceptAsync(IAbpMethodInvocation invocation)
   at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
   at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo)
   at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync()
   at Volo.Abp.Validation.ValidationInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
   at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
   at CabMD.Web.Pages.IndexModel.OnGet() in D:\Projects\CabMD15\aspnet-core\src\CabMD.Web\Pages\Index.cshtml.cs:line 72
   at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.ExecutorFactory.NonGenericTaskHandlerMethod.Execute(Object receiver, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.InvokeHandlerMethodAsync()
   at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.InvokeNextPageFilterAsync()
   at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.Rethrow(PageHandlerExecutedContext context)
   at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.InvokeInnerFilterAsync()
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|26_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ExceptionContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   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>g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)
   at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
   at Volo.Abp.AspNetCore.Serilog.AbpSerilogMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
   at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<<UseMiddlewareInterface>b__1>d.MoveNext()
--- End of stack trace from previous location ---
   at Volo.Abp.AspNetCore.Auditing.AbpAuditingMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
   at Volo.Abp.AspNetCore.Auditing.AbpAuditingMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
   at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<<UseMiddlewareInterface>b__1>d.MoveNext()
--- End of stack trace from previous location ---
   at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)
   at CabMD.UsefulExtensions.<>c.<<UseNoSniffHeaders>b__0_0>d.MoveNext() in D:\Projects\CabMD15\aspnet-core\src\CabMD.HttpApi\CabMDHttpApiModule.cs:line 72
--- End of stack trace from previous location ---
   at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
   at StackExchange.Profiling.MiniProfilerMiddleware.Invoke(HttpContext context) in C:\projects\dotnet\src\MiniProfiler.AspNetCore\MiniProfilerMiddleware.cs:line 103
   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
   at Volo.Abp.AspNetCore.Uow.AbpUnitOfWorkMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
   at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<<UseMiddlewareInterface>b__1>d.MoveNext()
--- End of stack trace from previous location ---
   at Volo.Abp.AspNetCore.ExceptionHandling.AbpExceptionHandlingMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
   at Volo.Abp.AspNetCore.ExceptionHandling.AbpExceptionHandlingMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
   at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<<UseMiddlewareInterface>b__1>d.MoveNext()
--- End of stack trace from previous location ---
   at Volo.Abp.AspNetCore.MultiTenancy.MultiTenancyMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
   at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<<UseMiddlewareInterface>b__1>d.MoveNext()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
   at Volo.Abp.AspNetCore.Security.AbpSecurityHeadersMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
   at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<<UseMiddlewareInterface>b__1>d.MoveNext()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.RequestLocalization.AbpRequestLocalizationMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
   at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<<UseMiddlewareInterface>b__1>d.MoveNext()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context)

Everything has been working great generally. Upgrading v7.0.3 to v7.4.0 hasn't been going well though I feel like we're getting close. For example, I had to reconcile a number of package issues on the AuthServer just to get it to actually run (no errors, nothing being logged, but definitely not working).

Showing 11 to 20 of 61 entries
Made with ❤️ on ABP v9.0.0-preview Updated on September 19, 2024, 10:13