Open Closed

ABP IIS Hosting Problem #8088


User avatar
0
koraykirdinli created

Hi, We are trying to publish our abp api host project to IIS. We got HTP 500.30 and our project cannot be opened. What can be the problem.

HTTP Error 500.30 - ASP.NET Core app failed to start Common solutions to this issue: The app failed to start The app started but then stopped The app started but threw an exception during startup Troubleshooting steps: Check the system event log for error messages Enable logging the application process' stdout messages Attach a debugger to the application process and inspect For more guidance on diagnosing and handling these errors, visit Troubleshoot ASP.NET Core on Azure App Service and IIS.


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

    hi

    You have called the same code in two place

    PreConfigure<OpenIddictBuilder> and PreConfigure<OpenIddictServerBuilder>(

    I think you can try to remove the code from PaymentManagementApplicationContractsModule and try again.

    The authserver.pfx and openiddict.pfx do the same thing. you can keep the openiddict.pfx and remove the authserver.pfx

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    AddDevelopmentEncryptionAndSigningCertificate should be false if you have called the AddProductionEncryptionAndSigningCertificate

  • User Avatar
    0
    koraykirdinli created

    Hi again. I tried to create a new demo project from scratch to fix the issue. My connectionstring is like below but I got the sql connection error. I can also connect from the SQL Management Studio.

    "Default": "Server=(localdb)\\MSSQLLocalDB;Database=PaymentManagement;Trusted_Connection=True;TrustServerCertificate=false",

    2024-10-22 22:52:22.424 +03:00 [INF]     - Volo.Abp.Gdpr.AbpGdprEntityFrameworkCoreModule
    2024-10-22 22:52:22.424 +03:00 [INF]     - Volo.Abp.BlobStoring.Database.EntityFrameworkCore.BlobStoringDatabaseEntityFrameworkCoreModule
    2024-10-22 22:52:22.424 +03:00 [INF]   - Volo.Abp.Swashbuckle.AbpSwashbuckleModule
    2024-10-22 22:52:22.424 +03:00 [INF]   - Volo.Abp.AspNetCore.Serilog.AbpAspNetCoreSerilogModule
    2024-10-22 22:52:23.677 +03:00 [INF] Saving external localizations...
    2024-10-22 22:52:23.829 +03:00 [INF] Initialized all ABP modules.
    2024-10-22 22:52:23.892 +03:00 [INF] Initializing UI Database
    2024-10-22 22:52:26.025 +03:00 [INF] Saving healthchecks configuration to database
    2024-10-22 22:52:26.562 +03:00 [INF] Request starting HTTP/1.1 GET http://localhost:44349/ - null null
    2024-10-22 22:52:26.576 +03:00 [WRN] The 'WebRootPath' is not set! The 'CheckLibs' feature is disabled!
    2024-10-22 22:52:26.609 +03:00 [ERR] GetHealthReport threw an exception when trying to get report from /health-status configured with name AbpSolution2 Health Status.
    System.InvalidOperationException: Could not get endpoint uri from configuration
       at HealthChecks.UI.Core.HostedService.HealthCheckReportCollector.GetEndpointUri(HealthCheckConfiguration configuration) in /_/src/HealthChecks.UI/Core/HostedService/HealthCheckReportCollector.cs:line 176
       at HealthChecks.UI.Core.HostedService.HealthCheckReportCollector.GetHealthReportAsync(HealthCheckConfiguration configuration) in /_/src/HealthChecks.UI/Core/HostedService/HealthCheckReportCollector.cs:line 118
    2024-10-22 22:52:27.080 +03:00 [INF] Application started. Press Ctrl+C to shut down.
    2024-10-22 22:52:27.081 +03:00 [INF] Hosting environment: Production
    2024-10-22 22:52:27.081 +03:00 [INF] Content root path: C:\inetpub\wwwroot\AbpDeneme2
    2024-10-22 22:52:27.211 +03:00 [INF] Completed to save external localizations.
    2024-10-22 22:52:27.447 +03:00 [INF] Executing endpoint 'AbpSolution2.Controllers.HomeController.Index (AbpSolution2.HttpApi.Host)'
    2024-10-22 22:52:27.487 +03:00 [INF] Route matched with {action = "Index", controller = "Home", area = "", page = ""}. Executing controller action with signature Microsoft.AspNetCore.Mvc.ActionResult Index() on controller AbpSolution2.Controllers.HomeController (AbpSolution2.HttpApi.Host).
    2024-10-22 22:52:27.534 +03:00 [INF] Executing RedirectResult, redirecting to /swagger.
    2024-10-22 22:52:27.544 +03:00 [INF] Executed action AbpSolution2.Controllers.HomeController.Index (AbpSolution2.HttpApi.Host) in 47.9922ms
    2024-10-22 22:52:27.544 +03:00 [INF] Executed endpoint 'AbpSolution2.Controllers.HomeController.Index (AbpSolution2.HttpApi.Host)'
    2024-10-22 22:52:27.612 +03:00 [INF] Request starting HTTP/1.1 GET http://localhost:44349/swagger/index.html - null null
    2024-10-22 22:52:27.613 +03:00 [INF] Request finished HTTP/1.1 GET http://localhost:44349/ - 302 null null 1052.877ms
    2024-10-22 22:52:27.720 +03:00 [INF] Request finished HTTP/1.1 GET http://localhost:44349/swagger/index.html - 200 null text/html;charset=utf-8 108.2377ms
    2024-10-22 22:52:28.009 +03:00 [INF] Request starting HTTP/1.1 GET http://localhost:44349/swagger/v1/swagger.json - null null
    2024-10-22 22:52:33.336 +03:00 [INF] Request finished HTTP/1.1 GET http://localhost:44349/swagger/v1/swagger.json - 200 null application/json;charset=utf-8 5325.7166ms
    2024-10-22 22:52:33.495 +03:00 [INF] Request starting HTTP/1.1 GET http://localhost:44349/api/abp/application-configuration - null null
    2024-10-22 22:52:33.510 +03:00 [INF] Executing endpoint 'Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationConfigurationController.GetAsync (Volo.Abp.AspNetCore.Mvc)'
    2024-10-22 22:52:33.533 +03:00 [INF] Route matched with {area = "abp", action = "Get", controller = "AbpApplicationConfiguration", page = ""}. Executing controller action with signature System.Threading.Tasks.Task`1[Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationConfigurationDto] GetAsync(Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationConfigurationRequestOptions) on controller Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationConfigurationController (Volo.Abp.AspNetCore.Mvc).
    2024-10-22 22:52:33.690 +03:00 [WRN] The cookie 'XSRF-TOKEN' has set 'SameSite=None' and must also set 'Secure'.
    2024-10-22 22:52:37.158 +03:00 [ERR] GetHealthReport threw an exception when trying to get report from /health-status configured with name AbpSolution2 Health Status.
    System.InvalidOperationException: Could not get endpoint uri from configuration
       at HealthChecks.UI.Core.HostedService.HealthCheckReportCollector.GetEndpointUri(HealthCheckConfiguration configuration) in /_/src/HealthChecks.UI/Core/HostedService/HealthCheckReportCollector.cs:line 176
       at HealthChecks.UI.Core.HostedService.HealthCheckReportCollector.GetHealthReportAsync(HealthCheckConfiguration configuration) in /_/src/HealthChecks.UI/Core/HostedService/HealthCheckReportCollector.cs:line 118
    2024-10-22 22:52:37.168 +03:00 [INF] Notification is sent on same window time.
    2024-10-22 22:52:41.393 +03:00 [ERR] An error occurred using the connection to database 'AbpSolution2' on server '(LocalDb)\MSSQLLocalDB'.
    2024-10-22 22:52:41.393 +03:00 [ERR] An error occurred using the connection to database 'AbpSolution2' on server '(LocalDb)\MSSQLLocalDB'.
    2024-10-22 22:52:41.393 +03:00 [ERR] An error occurred using the connection to database 'AbpSolution2' on server '(LocalDb)\MSSQLLocalDB'.
    2024-10-22 22:52:41.410 +03:00 [ERR] An exception occurred while iterating over the results of a query for context type 'Volo.Abp.PermissionManagement.EntityFrameworkCore.PermissionManagementDbContext'.
    Microsoft.Data.SqlClient.SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 50 - Local Database Runtime error occurred. Cannot create an automatic instance. See the Windows Application event log for error details.
    )
     ---> System.ComponentModel.Win32Exception (0x89C50118): Unknown error (0x89c50118)
       at Microsoft.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
       at Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
       at Microsoft.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnectionString connectionOptions, Boolean withFailover)
       at Microsoft.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, Boolean withFailover)
       at Microsoft.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString connectionOptions, SqlCredential credential, TimeoutTimer timeout)
       at Microsoft.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer timeout, SqlConnectionString connectionOptions, SqlCredential credential, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance)
       at Microsoft.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, Boolean applyTransientFaultHandling, String accessToken, DbConnectionPool pool)
       at Microsoft.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
       at Microsoft.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions)
       at Microsoft.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
       at Microsoft.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
       at Microsoft.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)
       at Microsoft.Data.ProviderBase.DbConnectionPool.WaitForPendingOpen()
    --- End of stack trace from previous location ---
    
    
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    "Default": "Server=(localdb)\MSSQLLocalDB;Database=PaymentManagement;Trusted_Connection=True;TrustServerCertificate=false",

    But the logs show An error occurred using the connection to database 'AbpSolution2' on server '(LocalDb)\MSSQLLocalDB'.

  • User Avatar
    0
    koraykirdinli created

    Sorry the demo project config is like below

    "Default": "Server=(LocalDb)\MSSQLLocalDB;Database=AbpSolution2;Trusted_Connection=True;TrustServerCertificate=true",

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Is your app run on IIS?

    https://serverfault.com/a/933281

  • User Avatar
    0
    koraykirdinli created

    Yes my app is run on IIS.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Can you check this https://serverfault.com/a/933281 ?

    the Trusted_Connection=True in IIS needs more settings.

  • User Avatar
    0
    koraykirdinli created

    Ok I will check but

    we We noticed the following: we created two projects from scratch. For the first one, we did not create a separate auth server, and your default project got a 500.30 error when hosted on IIS. However, when we created the separate auth server, we were able to run it this time. Could there be a different situation here? Could you also check this on your side with this in mind?

    abp new AbpDeneme2 -u angular -m none --separate-auth-server --theme leptonx -csf

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    500.30 error

    We have changed the Log code. Please add the new code to your Program.cs and check the exception of the 500.30 error

    public async static Task<int> Main(string[] args)
    {
        Log.Logger = new LoggerConfiguration()
    #if DEBUG
            .MinimumLevel.Debug()
    #else
            .MinimumLevel.Information()
    #endif
            .MinimumLevel.Override("Microsoft", LogEventLevel.Information)
            .MinimumLevel.Override("Microsoft.EntityFrameworkCore", LogEventLevel.Warning)
            .Enrich.FromLogContext()
            .WriteTo.Async(c => c.File("Logs/logs.txt"))
            .WriteTo.Async(c => c.Console())
            .CreateLogger();
    

Made with ❤️ on ABP v9.1.0-preview. Updated on November 11, 2024, 11:11