Open Closed

Random error on standard abp AuditLog Blazor Page #9624


User avatar
0
rferrarin created

Hi, I have this strange and very random error just by opening (or changing pages) the audit log standard abp page (reload message appears bottom left), UI language is set to Italian

this is the stack trace I got from the logs:

[2025-07-17 06:36:46 INF] Executed DbCommand (8ms) [Parameters=[@__ef_filter__CurrentTenantId_0='?' (DbType = Guid), @__startTime_0='?' (DbType = DateTime2), @__p_1='?' (DbType = Int32), @__p_2='?' (DbType = Int32)], CommandType='"Text"', CommandTimeout='30'] SELECT [a].[Id], [a].[AuditLogId], [a].[ChangeTime], [a].[ChangeType], [a].[EntityId], [a].[EntityTenantId], [a].[EntityTypeFullName], [a].[ExtraProperties], [a].[TenantId] FROM [AbpEntityChanges] AS [a] WHERE [a].[TenantId] = @__ef_filter__CurrentTenantId_0 AND [a].[ChangeTime] >= @__startTime_0 ORDER BY [a].[ChangeTime] DESC, [a].[Id] OFFSET @__p_1 ROWS FETCH NEXT @__p_2 ROWS ONLY [2025-07-17 06:36:46 INF] Executed DbCommand (4ms) [Parameters=[@__ef_filter__CurrentTenantId_0='?' (DbType = Guid), @__startTime_0='?' (DbType = DateTime2), @__p_1='?' (DbType = Int32), @__p_2='?' (DbType = Int32)], CommandType='"Text"', CommandTimeout='30'] SELECT [a].[Id], [a].[ApplicationName], [a].[BrowserInfo], [a].[ClientId], [a].[ClientIpAddress], [a].[ClientName], [a].[Comments], [a].[ConcurrencyStamp], [a].[CorrelationId], [a].[Exceptions], [a].[ExecutionDuration], [a].[ExecutionTime], [a].[ExtraProperties], [a].[HttpMethod], [a].[HttpStatusCode], [a].[ImpersonatorTenantId], [a].[ImpersonatorTenantName], [a].[ImpersonatorUserId], [a].[ImpersonatorUserName], [a].[TenantId], [a].[TenantName], [a].[Url], [a].[UserId], [a].[UserName] FROM [AbpAuditLogs] AS [a] WHERE [a].[TenantId] = @__ef_filter__CurrentTenantId_0 AND [a].[ExecutionTime] >= @__startTime_0 ORDER BY [a].[ExecutionTime] DESC OFFSET @__p_1 ROWS FETCH NEXT @__p_2 ROWS ONLY [2025-07-17 06:36:46 INF] Executed DbCommand (2ms) [Parameters=[@__ef_filter__CurrentTenantId_0='?' (DbType = Guid), @__startTime_0='?' (DbType = DateTime2)], CommandType='"Text"', CommandTimeout='30'] SELECT COUNT_BIG()FROM [AbpEntityChanges] AS [a]WHERE [a].[TenantId] = @__ef_filter__CurrentTenantId_0 AND [a].[ChangeTime] >= @__startTime_0[2025-07-17 06:36:46 INF] Executed DbCommand (4ms) [Parameters=[@__ef_filter__CurrentTenantId_0='?' (DbType = Guid), @__startTime_0='?' (DbType = DateTime2)], CommandType='"Text"', CommandTimeout='30']SELECT COUNT_BIG() FROM [AbpAuditLogs] AS [a] WHERE [a].[TenantId] = @__ef_filter__CurrentTenantId_0 AND [a].[ExecutionTime] >= @__startTime_0 [2025-07-17 06:36:47 WRN] Unhandled exception rendering component: Object reference not set to an instance of an object. System.NullReferenceException: Object reference not set to an instance of an object. at Volo.Abp.AuditLogging.Blazor.Pages.AuditLogging.Components.HttpMethodColumnComponent.BuildRenderTree(RenderTreeBuilder __builder) at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment, Exception& renderFragmentException) [2025-07-17 06:36:47 ERR] Unhandled exception in circuit 'yIadqSJxapoOAChgIfM1wpzWJ5xCdzjNicJ4rlKScww'. System.NullReferenceException: Object reference not set to an instance of an object. at Volo.Abp.AuditLogging.Blazor.Pages.AuditLogging.Components.HttpMethodColumnComponent.BuildRenderTree(RenderTreeBuilder __builder) at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment, Exception& renderFragmentException) [2025-07-17 06:36:47 INF] Executed endpoint 'Microsoft.AspNetCore.Routing.RouteEndpoint'

this behavior is random, if I refresh the page the problem may disappear, but can (and usually does) reappear a couple of grid data pages change. The page is standard ABP without any overrides.


5 Answer(s)
  • User Avatar
    0
    AI-Bot created
    Support Team ABP Agent
    • The error you are experiencing on the standard ABP Audit Log Blazor page is caused by a NullReferenceException in the HttpMethodColumnComponent. This typically happens when the component tries to access a property or value that is unexpectedly null in the audit log data.

    • This issue is often related to missing or null values in the audit log records, especially for fields like HttpMethod. In ABP, some audit log entries (such as those created for background jobs, event handlers, or internal processes) may not have HTTP context, resulting in null values for HttpMethod or related fields.

    • The ABP Framework intentionally allows these fields to be nullable, as not all audit logs are tied to HTTP requests. If you want to avoid this error, you should update your UI or customize the component to handle null values gracefully. For example, you can check for null before rendering the HTTP method or display a placeholder (like "-") when the value is missing.

    • Alternatively, you can create a custom audit log contributor or configure AbpAuditingOptions to filter out or handle such cases. See the official documentation for more details:

      • https://abp.io/docs/latest/modules/audit-logging
      • https://abp.io/support/questions/9397
    • This is not a database or configuration issue, but a UI rendering issue due to unhandled nulls in the standard component. Customizing the component to check for nulls will resolve the random error.

    Sources:

    • https://abp.io/docs/latest/modules/audit-logging
    • https://abp.io/support/questions/9397

    This response was generated by AI. If it didn’t solve your problem, feel free to post a new answer — our support team will jump in to help you soon.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    I will check this case.

    Thanks.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    I have refunded your ticket. I will do more NULL checks in the next patch version.

    Thanks.

  • User Avatar
    0
    rferrarin created

    thank you!

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    Don't mention it. :)

Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.0.0-preview. Updated on September 01, 2025, 08:37