简体   繁体   中英

Internal Server Error after publishing and Tables not being created

This issue is only present on the server I've published to. Locally I'm having zero issues.

After publishing from VS2017, the web page is displaying an Internal Server error with no further description on that page. This is not the first time I've published, so this issue is very random.

I'm at my wits end and am totally stumped as to what's causing this. Especially since before I hit publish, it was working fine. Although, it has been quite awhile since I've published from VS.

Things I've tried:

  • Restarting Server
  • Repairing IIS and ensuring correct .net core versions are installed.
  • More server restarting
  • Ensuring correct DLL's are present(even though this isn't first time publishing)
  • Check connection strings in appsettings
  • View stdoutLog output
  • View event log - this didn't display anything helpful

The stdoutLog stacktrace is as follows:

info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0]
      User profile not available. Using 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ASP.NET\4.0.30319.0\AutoGenKeys\S-1-5-82-1102471511-930544150-2645822985-2987586966-3557056008\DataProtection' as key repository and Windows DPAPI to encrypt keys at rest.
Application startup exception: System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: providerInvariantName
   at Serenity.Data.DbProviderFactories.GetFactory(String providerInvariantName)
   at Serenity.Data.SqlConnections.GetFactory(String providerName)
   at Serenity.Data.ConnectionStringInfo.get_ProviderFactory()
   at ApexCore.DataMigrations.EnsureDatabase(String databaseKey) in DataMigrations.cs:line 40
   at ApexCore.DataMigrations.Initialize() in DataMigrations.cs:line 27
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.Configure(IApplicationBuilder app)
   at Microsoft.AspNetCore.Server.IISIntegration.IISSetupFilter.<>c__DisplayClass4_0.<Configure>b__0(IApplicationBuilder app)
   at Microsoft.AspNetCore.HostFilteringStartupFilter.<>c__DisplayClass0_0.<Configure>b__0(IApplicationBuilder app)
   at Microsoft.AspNetCore.Hosting.Internal.AutoRequestServicesStartupFilter.<>c__DisplayClass0_0.<Configure>b__0(IApplicationBuilder builder)
   at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()
crit: Microsoft.AspNetCore.Hosting.Internal.WebHost[6]
      Application startup exception

As you can see, it's saying errors are being thrown in DataMigrations.cs . Which doesn't entirely make sense, since there has been zero changes in there for a significant amount of time. The area where the errors are being thrown is past the point where the database tables are created. So this would make sense that migrations are failing since the Tables don't exist.

So, to sum it up... Website won't load after newest publish. Tables aren't being created in Database as they should be. Connection strings are correct and no errors are appearing saying it's unable to connect.

One thing I do want to mention is that when looking in IIS Manager under Connection Strings, I noticed that there's nothing there anymore. Isn't this suppose to get auto-populated with whats in my AppSettings ?

you can resolve this issue by repairing the iis server in programs and features.
please read this answer. it may help you
Specified argument was out of the range of valid values. Parameter name: site

After much debacle, it turns out when I publish Release mode the website wont work. But if I publish in Debug mode, everything is good to go. It's a temp fix, but it'll have to do for now. I'll have to look into why publishing release mode is broke.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM