Open Closed

Error in Deployment #6085


User avatar
0
AliJaradat995 created
  • ABP Framework version: v7.4
  • UI Type: MVC
  • Database System: EF Core (SQL Server)
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes/no
  • Exception message and full stack trace: Upon deployment, our application is encountering an error that results in an HTTP 500.30 status code. The exact error message is as follows:

2023-10-30 16:38:37.817 +03:00 [FTL] Host terminated unexpectedly! Volo.Abp.AbpInitializationException: An error occurred during ConfigureServicesAsync phase of the module Volo.Abp.OpenIddict.AbpOpenIddictAspNetCoreModule, Volo.Abp.OpenIddict.AspNetCore, Version=7.4.0.0, Culture=neutral, PublicKeyToken=null. See the inner exception for details. ---> System.Security.Cryptography.CryptographicException: The system cannot find the file specified. at System.Security.Cryptography.X509Certificates.CertificatePal.FilterPFXStore(ReadOnlySpan1 rawData, SafePasswordHandle password, PfxCertStoreFlags pfxCertStoreFlags) at System.Security.Cryptography.X509Certificates.CertificatePal.FromBlobOrFile(ReadOnlySpan1 rawData, String fileName, SafePasswordHandle password, X509KeyStorageFlags keyStorageFlags) at System.Security.Cryptography.X509Certificates.X509Certificate..ctor(String fileName, String password, X509KeyStorageFlags keyStorageFlags) at System.Security.Cryptography.X509Certificates.X509Certificate2..ctor(String fileName, String password) at Bsnt.NARC.Web.NARCWebModule.GetSigningCertificate(IWebHostEnvironment hostingEnv, IConfiguration configuration) at Bsnt.NARC.Web.NARCWebModule.<>c__DisplayClass0_0.<PreConfigureServices>b__3(OpenIddictServerBuilder builder) at Volo.Abp.Options.PreConfigureActionList1.Configure(TOptions options) at Microsoft.Extensions.DependencyInjection.ServiceCollectionPreConfigureExtensions.ExecutePreConfiguredActions[TOptions](IServiceCollection services, TOptions options) at Volo.Abp.OpenIddict.AbpOpenIddictAspNetCoreModule.<>c__DisplayClass1_0.<AddOpenIddictServer>b__0(OpenIddictServerBuilder builder) at Microsoft.Extensions.DependencyInjection.OpenIddictServerExtensions.AddServer(OpenIddictBuilder builder, Action1 configuration) at Volo.Abp.OpenIddict.AbpOpenIddictAspNetCoreModule.AddOpenIddictServer(IServiceCollection services) at Volo.Abp.OpenIddict.AbpOpenIddictAspNetCoreModule.ConfigureServices(ServiceConfigurationContext context) at Volo.Abp.Modularity.AbpModule.ConfigureServicesAsync(ServiceConfigurationContext context) at Volo.Abp.AbpApplicationBase.ConfigureServicesAsync() --- End of inner exception stack trace --- at Volo.Abp.AbpApplicationBase.ConfigureServicesAsync() at Volo.Abp.AbpApplicationFactory.CreateAsync[TStartupModule](IServiceCollection services, Action1 optionsAction) at Microsoft.Extensions.DependencyInjection.ServiceCollectionApplicationExtensions.AddApplicationAsync[TStartupModule](IServiceCollection services, Action1 optionsAction) at Microsoft.Extensions.DependencyInjection.WebApplicationBuilderExtensions.AddApplicationAsync[TStartupModule](WebApplicationBuilder builder, Action`1 optionsAction) at Bsnt.NARC.Web.Program.Main(String[] args)

And There is attachment on what error in IIS

this error in deployment

  • Steps to reproduce the issue: I have attempted the following steps to resolve the issue without success:

Server and application pool reset Creation of a new application pool Verification of permissions for certificate access and file system

  • Request for Assistance: I kindly request your urgent assistance in diagnosing and resolving this issue. The error is severely impacting our production environment, leading to downtime for our users. Please let me know if you require any additional information or if there are specific steps you would like me to take to further diagnose the problem. Thank you for your prompt attention to this matter.

Best regards,


3 Answer(s)
  • User Avatar
    0
    Anjali_Musmade created
    Support Team Support Team Member

    Hi,

    please check https://support.abp.io/QA/Questions/4845/How-to-install-app-on-IIS-having-issues-with-Cryptography

  • User Avatar
    0
    AliJaradat995 created

    I am facing an issue related to loading a signing certificate in my ABP application. I have ensured that the certificate file (authserver.pfx) is placed in the correct path. However, when attempting to read the certificate using the provided code, it fails to find the certificate at the specified path.

    I have used the following code snippet to load the certificate:


    private X509Certificate2 GetSigningCertificate(IWebHostEnvironment hostingEnv, IConfiguration configuration) { // use the following cmd to generate the file // dotnet dev-certs https --trust -v -ep authserver.pfx -p 2D7AA457-5D33-48D6-936F-C48E5EF468ED

    var fileName = "authserver.pfx";
    var passPhrase = "2D7AA457-5D33-48D6-936F-C48E5EF468ED";
    var file = Path.Combine(hostingEnv.ContentRootPath, fileName);
    
    if (!System.IO.File.Exists(file))
    {
        throw new FileNotFoundException($"Signing Certificate couldn't found: {file}");
    }
    
    return new X509Certificate2(file, passPhrase);
    

    }


  • User Avatar
    0
    Anjali_Musmade created
    Support Team Support Team Member

    Hello AliJaradat995,

    Have you set Load User Profile to true in IIS Once check whether, IISUSER has read and write permissions to the publish folder (Try giving Full Control)

    regards,

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