2

Using the getting started project from Sitecore 10 docs, as per https://doc.sitecore.com/developers/100/developer-tools/en/walkthrough--using-the-getting-started-template.html the Identity server container fails to start and has a Base64 conversion error parsing the license key:

Unhandled Exception: System.FormatException: The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.
at System.Convert.FromBase64CharPtr(Char* inputPtr, Int32 inputLength)
at System.Convert.FromBase64String(String s)
at Sitecore.Framework.Runtime.Configuration.License.ReadFromRaw(ISitecoreHostingEnvironment host)
at Sitecore.Framework.Runtime.Licensing.SitecoreHostingEnvironmentExtensions.GetLicense(ISitecoreHostingEnvironment host)
at Sitecore.Framework.Runtime.Commands.SitecoreHostCommand.OnExecuteAsync(CommandLineApplication app)
at McMaster.Extensions.CommandLineUtils.Conventions.ExecuteMethodConvention.InvokeAsync(MethodInfo method, Object instance, Object[] arguments) in C:\projects\commandlineutils\src\CommandLineUtils\Conventions\ExecuteMethodConvention.cs:line 77
at McMaster.Extensions.CommandLineUtils.Conventions.ExecuteMethodConvention.OnExecute(ConventionContext context) in C:\projects\commandlineutils\src\CommandLineUtils\Conventions\ExecuteMethodConvention.cs:line 62
at McMaster.Extensions.CommandLineUtils.Conventions.ExecuteMethodConvention.<>c__DisplayClass0_0.<<Apply>b__0>d.MoveNext() in C:\projects\commandlineutils\src\CommandLineUtils\Conventions\ExecuteMethodConvention.cs:line 25
--- End of stack trace from previous location where exception was thrown ---

at McMaster.Extensions.CommandLineUtils.CommandLineApplication.<>c__DisplayClass126_0.<OnExecute>b__0() in C:\projects\commandlineutils\src\CommandLineUtils\CommandLineApplication.cs:line 505
at McMaster.Extensions.CommandLineUtils.CommandLineApplication.Execute[TApp](CommandLineContext context) in C:\projects\commandlineutils\src\CommandLineUtils\CommandLineApplication.Execute.cs:line 31
at McMaster.Extensions.CommandLineUtils.CommandLineApplication.ExecuteAsync[TApp](CommandLineContext context) in C:\projects\commandlineutils\src\CommandLineUtils\CommandLineApplication.Execute.cs:line 145
at McMaster.Extensions.CommandLineUtils.CommandLineApplication.ExecuteAsync[TApp](IConsole console, String[] args) in C:\projects\commandlineutils\src\CommandLineUtils\CommandLineApplication.Execute.cs:line 130
at Sitecore.Program.<Main>(String[] args)

The cortexprocessingworker, xdbautomationworker, and xdbsearchworker all fail to start after the ID container fails and the Up.ps1 script finishes with the following errors:

enter image description here

Using Windows 10 Build 1809, Docker Desktop 2.2.04. Partner license, and MVP license both for v9 and unexpired.

# If you intend to push to a private registry, fill that in here.
REGISTRY=
COMPOSE_PROJECT_NAME=headlessdemo1

# Configure host names, which will be used to configure Traefik proxy routing.
CM_HOST=cm.headlessdemo1.localhost
ID_HOST=id.headlessdemo1.localhost
RENDERING_HOST=www.headlessdemo1.localhost

# Sitecore Docker registry and platform version.
# The ltsc2019-based images are used by default here. Development-only 1909 images are also available.
SITECORE_DOCKER_REGISTRY=scr.sitecore.com/sxp/
SITECORE_VERSION=10.0.0-ltsc2019

# The sitecore\admin and SQL 'sa' account passwords for this environment are configurable here.
SITECORE_ADMIN_PASSWORD=xxx
SQL_SA_PASSWORD=xxx

# Other supporting images, including Sitecore modules and Docker tools
MANAGEMENT_SERVICES_IMAGE=scr.sitecore.com/sxp/modules/sitecore-management-services-xp1-assets:2.0.0-1809
HEADLESS_SERVICES_IMAGE=scr.sitecore.com/sxp/modules/jss-xp1-assets:14.0.0-1809
TOOLS_IMAGE=scr.sitecore.com/tools/sitecore-docker-tools-assets:10.0.0-1809
TRAEFIK_IMAGE=traefik:v2.2.0-windowsservercore-1809

# MSBuild configuration and the target build stage for the Rendering Host image.
BUILD_CONFIGURATION=debug

# Mount paths for code deployment, data persistence, and your Sitecore license.
LOCAL_DEPLOY_PATH=.\docker\deploy\
LOCAL_DATA_PATH=.\docker\data\
HOST_LICENSE_FOLDER=C:\installs\licenses\

# Because we are using a mounted license file, this value can be empty.
# Included here to suppress 'variable is not set' warning from docker-compose.
SITECORE_LICENSE=

# The isolation mode for Sitecore containers.
# Compatibility of isolation mode depends on the Host and Container OS versions.
ISOLATION=default
TRAEFIK_ISOLATION=hyperv

# Generated keys and certificates for your environment.
REPORTING_API_KEY=xxx
SITECORE_IDSECRET=xxx
TELERIK_ENCRYPTION_KEY=xxx
SITECORE_ID_CERTIFICATE=xxx
SITECORE_ID_CERTIFICATE_PASSWORD=xxx

enter image description here

  • So you're saying both licenses fail in this way? Can you add the contents of your .env file? SITECORE_LICENSE should be empty, and HOST_LICENSE_FOLDER should be pointed at a folder with your license.xml in it. – nickwesselman Aug 4 at 19:19
  • Thanks Nick, yes both licenses fail. The SITECORE_LICENCE value in .env is empty, however when I inspect ID server in Docker Desktop I can see that the ID server does have a value in the SITECORE_LICENCE and a mount point for the license.xml path that was passed in via Init.ps1 The services that start are CM, XCONNECT, RENDERING, MSSSQL, and SOLR. No other containers are listed apart from the failed ID container. – andyp Aug 4 at 22:28
5

Have you previously worked with older versions of Sitecore with Docker? If so, you may still have an environment variable floating around with an invalid license.

The getting started project appears to be using the mounted license file strategy. The SITECORE_LICENSE var shouldn't be set, as it is in your screenshot of the id container env vars. Having this env variable set may take precedence and cause unexpected consequences.

You can check for an existing SITECORE_LICENSE environment variable in powershell:

$env:SITECORE_LICENSE

If that exists, remove it, then go through the setup steps again with the mounted license file.

| improve this answer | |
  • Yep thanks George that was the issue - there was an existing machine level SITECORE_LICENSE environment variable that was being picked up and overriding the details passed to the .\Init.ps1 – andyp Aug 5 at 5:24
  • 2
    And just to make it easier, in powershell you can run $env:SITECORE_LICENSE = '' to remove the variable. – Dylan Young Aug 7 at 4:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.