Friday, February 2, 2018

Sitecore Experience Commerce - Empty strings are not allowed after clean install

After installing Experience Commerce 9.0 successfully and attempting to load the front-end website I was greeted with the following error message:
Empty strings are not allowed.
Parameter name: value
With the stack trace:
[ArgumentException: Empty strings are not allowed.
Parameter name: value]
   Sitecore.Diagnostics.Assert.ArgumentNotNullOrEmpty(String argument, String argumentName) +204
   Sitecore.Data.ID.Parse(String value) +30
   Sitecore.Commerce.XA.Foundation.Common.Models.CommerceStorefront.get_ControlPanel() +105
   Sitecore.Commerce.XA.Foundation.Common.Models.CommerceStorefront.get_StorefrontConfiguration() +10
   Sitecore.Commerce.XA.Foundation.Common.Pipelines.SecuredPageProcessor.IsSslEnforcedForStorefront() +35
   Sitecore.Commerce.XA.Foundation.Common.Pipelines.SecuredPageProcessor.Process(PipelineArgs args) +164
   (Object , Object[] ) +74
   Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +469
   Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain) +22
   Sitecore.Web.RequestEventsHandler.OnPostAuthenticateRequest(HttpContextBase context) +214
   Sitecore.Nexus.Web.HttpModule.’ (Object “ , EventArgs ” ) +335
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +136
   System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +195
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +88
Sitecore commerce - empty strings are not allowed
This error message appears because on a default instance the example Storefront site (with content) is not installed and instead you get an empty site. In fact the home node by default actually has no presentation details.

Experience Commerce empty site
What you need to do is inser a new Site under the Sitecore node:

Sitecore Experience Commerce - new site
Ensuring that the following 3 features are selected to get the full Storefront demo:

Sitecore Experience Commerce - new site features
As well as selecting the correct theme:

Sitecore Experience Commerce - new site theme
In my case, I then deleted the empty Storefront site and renamed this new one Storefront. Performed a full publish and the front-end loaded correctly.

Sitecore Experience Commerce - Storefront demo site
In cases where you wish to build out a site from scratch, this demo site is still good to use as a reference to assist in building the required pages/components.

No comments:

Post a Comment