We have been doing a lot of Umbraco upgrades lately and have been hitting the same issue several times so I decided that I have to blog about it for "future me" and any other Umbraco developer that has the same problem with booting when trying to upgrade to Umbraco 12.
The error message looks something like this:
Umbraco.Cms.Core.Exceptions.BootFailedException: Boot failed: Umbraco cannot run. See Umbraco's log file for more details.
at Umbraco.Cms.Core.Exceptions.BootFailedException.Rethrow(BootFailedException bootFailedException)
at Umbraco.Cms.Web.Common.Middleware.BootFailedMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<<UseMiddlewareInterface>b__1>d.MoveNext()
--- End of stack trace from previous location ---
at SixLabors.ImageSharp.Web.Middleware.ImageSharpMiddleware.Invoke(HttpContext httpContext, Boolean retry)
at React.AspNet.BabelFileMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context)
It's really hard to know what went wrong based on this error message. The Umbraco version that I was installing (12.0.1) did not show any kind of helpful information when the site was booting. It's easy to think that it's something wrong with any of the middleware but they are just showing up because they are a part of the pipeline.
After some research, I found a couple of posts in the Umbraco forum around similar issues:
It turns out that dependencies were updated for v12 and that Microsoft.Data.SqlClient has some breaking changes that require us to explicitly trust the SQL Server certificate. This can be done by appending TrustServerCertificate=true to the database connection string:
{
"ConnectionStrings": {
"umbracoDbDSN": "<server,user,password>;TrustServerCertificate=true;",
}
}
This made the site start again and the installer to kick in.