HTTP Error 500.30 - ASP.NET Core app failed to start (.NET core)

1.7k Views Asked by At

Hello there,

The site is in .NET core and I have hosted it on IIS, but it shows following error:

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.

In event viewer it shows the error:

First 30KB characters of captured stdout and stderr logs:
fail: FluentMigrator.Runner.Processors.SqlServer.SqlServer2016Processor[0]
      There was an exception checking if table MigrationVersionInfo in  exists
      Microsoft.Data.SqlClient.SqlException (0x80131904): A connection was successfully established with the server, but then an error occurred during the login process. (provider: SSL Provider, error: 0 - The certificate chain was issued by an authority that is not trusted.)
       ---> System.ComponentModel.Win32Exception (0x80090325): The certificate chain was issued by an authority that is not trusted.
         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.TdsParserStateObject.ThrowExceptionAndWarning(Boolean callerHasConnectionLock, Boolean asyncClose)
         at Microsoft.Data.SqlClient.TdsParserStateObject.SNIWritePacket(PacketHandle packet, UInt32& sniError, Boolean canAccumulate, Boolean callerHasConnectionLock, Boolean asyncClose)
         at Microsoft.Data.SqlClient.TdsParserStateObject.WriteSni(Boolean canAccumulate)
         at Microsoft.Data.SqlClient.TdsParserStateObject.WritePacket(Byte flushMode, Boolean canAccumulate)
         at Microsoft.Data.SqlClient.TdsParser.TdsLogin(SqlLogin rec, FeatureExtension requestedFeatures, SessionData recoverySessionData, FederatedAuthenticationFeatureExtensionData fedAuthFeatureExtensionData, SqlConnectionEncryptOption encrypt)

This is my connectionstring:

"ConnectionString": "Data Source=DESKTOP-HD83D6N;TrustServerCertificate=True;Encrypt=true;Initial Catalog=fargetta1_357_db;MultipleActiveResultSets=true;Integrated Security=False;Persist Security Info=True;Connect Timeout=120"

I tried to give DB privileges and republish the code and having following error:

info: FluentMigrator.Runner.MigrationRunner[1000] StoreMigration migrating info: FluentMigrator.Runner.Processors.SqlServer.SqlServer2016Processor[1004] Beginning Transaction info: FluentMigrator.Runner.Processors.SqlServer.SqlServer2016Processor[1003] BEGIN TRANSACTION info: FluentMigrator.Runner.MigrationRunner[1004] AlterTable Store info: FluentMigrator.Runner.Processors.SqlServer.SqlServer2016Processor[1003] info: FluentMigrator.Runner.MigrationRunner[1002] => 0.0006392s info: FluentMigrator.Runner.MigrationRunner[1004] AlterColumn Store DefaultTitle String info: FluentMigrator.Runner.Processors.SqlServer.SqlServer2016Processor[1003] ALTER TABLE [dbo].[Store] ALTER COLUMN [DefaultTitle] NVARCHAR(MAX) info: FluentMigrator.Runner.MigrationRunner[1002] => 0.0216846s info: FluentMigrator.Runner.MigrationRunner[1004] AlterTable Store info: FluentMigrator.Runner.Processors.SqlServer.SqlServer2016Processor[1003] info: FluentMigrator.Runner.MigrationRunner[1002] => 0.0001406s info: FluentMigrator.Runner.MigrationRunner[1004] AlterColumn Store DefaultMetaDescription String info: FluentMigrator.Runner.Processors.SqlServer.SqlServer2016Processor[1003] ALTER TABLE [dbo].[Store] ALTER COLUMN [DefaultMetaDescription] NVARCHAR(MAX) info: FluentMigrator.Runner.MigrationRunner[1002] => 0.0011302s info: FluentMigrator.Runner.MigrationRunner[1004] AlterTable Store info: FluentMigrator.Runner.Processors.SqlServer.SqlServer2016Processor[1003] info: FluentMigrator.Runner.MigrationRunner[1002] => 2.7E-06s info: FluentMigrator.Runner.MigrationRunner[1004] AlterColumn Store DefaultMetaKeywords String info: FluentMigrator.Runner.Processors.SqlServer.SqlServer2016Processor[1003] ALTER TABLE [dbo].[Store] ALTER COLUMN [DefaultMetaKeywords] NVARCHAR(MAX) info: FluentMigrator.Runner.MigrationRunner[1002] => 0.0008467s info: FluentMigrator.Runner.MigrationRunner[1004] AlterTable Store info: FluentMigrator.Runner.Processors.SqlServer.SqlServer2016Processor[1003] info: FluentMigrator.Runner.MigrationRunner[1002] => 1.6E-06s info: FluentMigrator.Runner.MigrationRunner[1004] AlterColumn Store HomepageDescription String info: FluentMigrator.Runner.Processors.SqlServer.SqlServer2016Processor[1003] ALTER TABLE [dbo].[Store] ALTER COLUMN [HomepageDescription] NVARCHAR(MAX) info: FluentMigrator.Runner.MigrationRunner[1002] => 0.0004624s info: FluentMigrator.Runner.MigrationRunner[1004] AlterTable Store info: FluentMigrator.Runner.Processors.SqlServer.SqlServer2016Processor[1003] info: FluentMigrator.Runner.MigrationRunner[1002] => 1.4E-06s info: FluentMigrator.Runner.MigrationRunner[1004] AlterColumn Store HomepageTitle String info: FluentMigrator.Runner.Processors.SqlServer.SqlServer2016Processor[1003] ALTER TABLE [dbo].[Store] ALTER COLUMN [HomepageTitle] NVARCHAR(MAX) info: FluentMigrator.Runner.MigrationRunner[1002] => 0.0004482s info: FluentMigrator.Runner.Processors.SqlServer.SqlServer2016Processor[1004] Committing Transaction info: FluentMigrator.Runner.Processors.SqlServer.SqlServer2016Processor[1003] COMMIT TRANSACTION info: FluentMigrator.Runner.MigrationRunner[1004] StoreMigration migrated info: FluentMigrator.Runner.MigrationRunner[1002] => 0.002727s info: FluentMigrator.Runner.Processors.SqlServer.SqlServer2016Processor[1003] INSERT INTO [dbo].[MigrationVersionInfo] ([Version], [AppliedOn], [Description]) VALUES (638059361410000000, '2023-07-04T06:47:58', N'Added new fields to store table') Unhandled exception. System.AggregateException: One or more errors occurred. (Cannot drop the procedure 'dbo.ProductLoadAllPagedNopAjaxFilters', because it does not exist or you do not have permission.) ---> Microsoft.Data.SqlClient.SqlException (0x80131904): Cannot drop the procedure 'dbo.ProductLoadAllPagedNopAjaxFilters', because it does not exist or you do not have permission. at Microsoft.Data.SqlClient.SqlConnection.OnError(SqlException exception)

1

There are 1 best solutions below

0
Jason Pan On

The root cause is you are using wrong connectionstring. I don't know how to modify your connectionstring in your environment. But you can follow my steps to find the right connectionstring for using.

Open your VS2022 to find SQL Server Object Explorer, follow below steps find the correct connectionstring, like

Data Source=tcp:your_sqlserver.database.windows.net,1433;Initial Catalog=db_name;User ID=jason;Password=********;Connect Timeout=30;Encrypt=True;Trust Server Certificate=False;Application Intent=ReadWrite;Multi Subnet Failover=False

Details

enter image description here enter image description here enter image description here enter image description here enter image description here