Open Closed

Error activating AuditingManager in background job #5112


User avatar
0
arskapalli created
  • ABP Framework version: v7.1.1
  • UI type: Angular
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes / no
  • Exception message and stack trace:
[05/22/2023 09:20:45 > 73e6dd: INFO] [09:20:45 INF] Initialized all ABP modules. <s:Volo.Abp.Modularity.ModuleManager>
[05/22/2023 09:20:46 > 73e6dd: INFO] [09:20:46 ERR] Job DEFAULT.Volo.Abp.BackgroundJobs.BackgroundJobWorker threw an unhandled Exception:  <s:Quartz.Core.JobRunShell>
[05/22/2023 09:20:46 > 73e6dd: INFO] Autofac.Core.DependencyResolutionException: An exception was thrown while activating Volo.Abp.Auditing.AuditingManager -> Volo.Abp.Auditing.AuditingHelper -> Volo.Abp.AuditLogging.AuditingStore -> Volo.Abp.AuditLogging.AuditLogInfoToAuditLogConverter -> Volo.Abp.AspNetCore.ExceptionHandling.DefaultExceptionToErrorInfoConverter -> Microsoft.Extensions.Localization.StringLocalizer`1[[Volo.Abp.ExceptionHandling.Localization.AbpExceptionHandlingResource, Volo.Abp.ExceptionHandling, Version=7.1.1.0, Culture=neutral, PublicKeyToken=null]].
[05/22/2023 09:20:46 > 73e6dd: INFO]  ---> Autofac.Core.DependencyResolutionException: An exception was thrown while invoking the constructor 'Void .ctor(Microsoft.Extensions.Localization.IStringLocalizerFactory)' on type 'StringLocalizer`1'.
[05/22/2023 09:20:46 > 73e6dd: INFO]  ---> Autofac.Core.DependencyResolutionException: An exception was thrown while activating ?:Volo.Abp.VirtualFileSystem.IVirtualFileProvider -> Volo.Abp.VirtualFileSystem.VirtualFileProvider.
[05/22/2023 09:20:46 > 73e6dd: INFO]  ---> Autofac.Core.DependencyResolutionException: An exception was thrown while invoking the constructor 'Void .ctor(Microsoft.Extensions.Options.IOptions`1[Volo.Abp.VirtualFileSystem.AbpVirtualFileSystemOptions], Volo.Abp.VirtualFileSystem.IDynamicFileProvider)' on type 'VirtualFileProvider'.
[05/22/2023 09:20:46 > 73e6dd: INFO]  ---> System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Extensions.FileProviders.Embedded, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified.
[05/22/2023 09:20:46 > 73e6dd: INFO] File name: 'Microsoft.Extensions.FileProviders.Embedded, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'
[05/22/2023 09:20:46 > 73e6dd: INFO]    at Volo.Abp.VirtualFileSystem.VirtualFileSetListExtensions.CreateFileProvider(Assembly assembly, String baseNamespace, String baseFolder)
[05/22/2023 09:20:46 > 73e6dd: INFO]    at Volo.Abp.VirtualFileSystem.VirtualFileSetListExtensions.AddEmbedded[T](VirtualFileSetList list, String baseNamespace, String baseFolder)
[05/22/2023 09:20:46 > 73e6dd: INFO]    at Volo.Abp.Localization.AbpLocalizationModule.&lt;&gt;c.&lt;ConfigureServices&gt;b__0_0(AbpVirtualFileSystemOptions options)
[05/22/2023 09:20:46 > 73e6dd: INFO]    at Microsoft.Extensions.Options.OptionsFactory`1.Create(String name)
[05/22/2023 09:20:46 > 73e6dd: INFO]    at Microsoft.Extensions.Options.UnnamedOptionsManager`1.get_Value()
[05/22/2023 09:20:46 > 73e6dd: INFO]    at lambda_method650(Closure, Object[])
[05/22/2023 09:20:47 > 73e6dd: INFO]    at Autofac.Core.Activators.Reflection.BoundConstructor.Instantiate()
[05/22/2023 09:20:47 > 73e6dd: INFO]    --- End of inner exception stack trace ---
  • Steps to reproduce the issue:" We've been experiencing this issue in our production environment running our background job application as a web job in an Azure app service. The issue does not occur locally, which has made troubleshooting difficult.

I've checked the filesystem for the web job and the Microsoft.Extensions.FileProviders.Embedded.dll file is present, though when downloaded the version appears to be 7.0.4. This seems to differ from our packages.lock.json files, where the resolved version is 7.0.0.


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

    hi

    To reproduce it locally, you can set the ASPNETCORE_ENVIRONMENT to Production.

    https://learn.microsoft.com/en-us/aspnet/core/fundamentals/environments?view=aspnetcore-7.0

  • User Avatar
    0
    arskapalli created

    Hello,

    I changed the environment variables from Development to Production, but the issue still doesn't occur locally.

    The issue started presenting in the production environment shortly after we updated from ABP Framework 5.1.4 to 7.1.1.

    I've been pursuing the possibility that the Microsoft.Extensions.FileProviders.Embedded file can't be found due to a possible version mismatch after the build, but the AssemblyVersion does appear to be 7.0.0.0 as required by Volo.Abp.VirtualFileSystem:

    [assembly: AssemblyFileVersion("7.0.423.11903")]
    [assembly: AssemblyInformationalVersion("7.0.4+e56abc45c4f8adc518abfc11a59849d616431e2c")]
    [assembly: AssemblyProduct("Microsoft ASP.NET Core")]
    [assembly: AssemblyTitle("Microsoft.Extensions.FileProviders.Embedded")]
    [assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/dotnet/aspnetcore")]
    [assembly: NeutralResourcesLanguage("en-US")]
    [assembly: AssemblyVersion("7.0.0.0")]
    

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Can you try to publish the website locally?

    dotnet publish

  • User Avatar
    0
    arskapalli created

    Yes, I was able to publish the application to a local folder (bin/Release/net7.0/publish) and run it from there with no problem. I suppose this points to the issue most likely being in our Azure app service configuration or our Azure DevOps pipeline.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    We are not familiar with Azure.

    Yes, I was able to publish the application to a local folder (bin/Release/net7.0/publish) and run it from there with no problem.

    This can say the code and environment are no problem.

  • User Avatar
    0
    arskapalli created

    We were able to resolve the issue by making changes to our CI/CD pipeline to use global.json for the .NET SDK version in both the build and release pipelines and restarting the web job several times.

    Thank you for your assistance in troubleshooting, as ruling out issues with the code and release configuration helped us focus on the real issue at hand.

Made with ❤️ on ABP v9.1.0-preview. Updated on December 26, 2024, 06:07