Identity server error after fresh install of 10.2

Sitecore 10.2 ships by default with Sitecore Identity Server 6 which has a dependency on NET Core 3.1 and related assemblies. As with previous versions it can easily be supported (in parallel with previous versions) by installing the NET Core 3.1 Hosting bundle.

As always the Sitecore download for installation via SIF includes prerequisite scripts and json to support any changes in prerequisites, including checking for existing installs of any packages and downloading the correct versions for you if required. Unfortunately, the prerequisite check for existing versions of NET Core 3.1 is a little off and in some situations can lead to not having the hosting bundle installed. NB: The Download URL was updated correctly, it’s just the check to see if it’s already installed that causes issue.

In the prerequisites.json file found in the config files of XP0 Configuration files 10.2.0 rev. 006766.zip we can see that the Skip parameter for the download and installation is dependant on the Net.Hosting.Package variable. Meaning the Download and Install tasks will not run if the variable evaluates to true.

........ 
"DownloadDotNetMultiTargeting": {
            "Type": "DownloadFile",
            "Params": {
                "SourceUri": "[parameter('DotNetHostingDownload')]",
                "DestinationPath": "[variable('DotNetHosting.Download')]"
            },
            "Skip": "[variable('Net.Hosting.Package')]"
        },
        "InstallDotNetMultiTargeting": {
            "Type": "StartProcess",
            "Params": {
                "FilePath": "[variable('DotNetHosting.Download')]",
                "ArgumentList": "[variable('InstallArgs')]",
                "Wait": true
            },
            "Skip": "[variable('Net.Hosting.Package')]"
        },
........

OOTB the Net.Hosting.Package is defined as:

....
 "Net.Hosting.Package": "[GetPackage(Name:'Microsoft` .NET` Core` 2.1.12` -` Windows` Server` Hosting',ErrorAction:'SilentlyContinue')]",
.....

So it looks like this value wasn’t updated to support the latest version. In the situation where you have already have NET Core 2.1.12 Hosting bundle installed, such as previous Sitecore installs this GetPackage call will return true, skipping the installation of 3.1. In turn, Identity Server will not work and throw errors immediately.

The fix is super easy…. just update the version on the NET.Hosting.Package variable to to the correct version. This will ensure the package is checked and installed as expected on machines without 3.1.

....
 "Net.Hosting.Package": "[GetPackage(Name:'Microsoft` .NET` Core` 3.1.16` -` Windows` Server` Hosting',ErrorAction:'SilentlyContinue')]",
.....

If you’ve already hit this and don’t want to run the full install again, you can just manually download the correct version of the hosting bundle (NB: The download URL is in prequisites.json in the DotNetHostingDownload parameter) and install it. Don’t forget to IISReset after the install.

Some food for thought if you find yourself in this situation: SIF is a really powerful tool, but issues like these really highlight where using containers is much more powerful. Containers don’t require you to be worried about complex pre-requisites, how things should be installed or why packages haven’t installed. So if you’re in an environment where using Docker in your workflow is possible, jump in!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s