Tuesday, May 30, 2017

Sitecore Commerce Product not found. Catalog='x' Product='y'

After adding an inventory catalog to the product catalog, the following error was showing on a product page.
[System Error: Product not found. Catalog='MyProductCatalog' Product='MyProductId']
This was occurring because the product definition was expecting product variants, where my products did not have variants. Another symptom of this issue is that inventory information cannot be added to products using Sitecore's merchandising manager.

To fix this error, I fired up the Commerce Server Catalog and Inventory Schema Manager desktop application. Then opened up the product definition for editing:


Now by simply removing the Assigned Variant Properties selections, the product definition now matched what was expected. Inventory can also be added to the product using the merchandising manager.

Sitecore commerce merchandising manager, set product inventory
The error should now no longer appear on the front-end.

Sitecore commerce The product catalog is not associated to this inventory catalog

In the process of setting up a a demo commerce site in Sitecore, the following error occurred when attempting to use my new catalog.
[System Error: The product catalog is not associated to this inventory catalog.]
In my case, there was a base catalog (which contained the products and categories). But not an inventory catalog. To fix this error, load up the merchandising manager, and go to the inventory catalog tab.

Sitecore merchandising manager, inventory catalog tab

After creating an inventory catalog, you simply associate it with a product catalog.

Sitecore commerce, associate inventory catalog with product catalog

You are now able to add inventory to products and the error above will not occur.

Friday, May 26, 2017

Sitecore Commerce catalog web service error

When attempting to load up Sitecore's commerce server catalog manager, the following error may occur when attempting to connect.
The Catalog Web Service is currently unavailable. The web service might be experiencing technical difficulties, or you may need to adjust your connection settings.
 It often occurs when the URL of the service inside the connection was incorrect. Ensure you are using the correct base URL and that the path in fact leads to the web service. In the example image above, part of the URL is incorrect. It should have been Habitat_CatalogWebService instead of HabitatCatalogWebService.

Thursday, May 25, 2017

Sitecore Demo Retail install sites issues

At the time of writing the Sitecore Demo Retail project, it is not possible to spin up the solution with visual studio 2017 installed on the machine. At the top of the wiki, the following notice appears:
Important Note
Visual Studio 2015 is required for this solution. Installing Visual Studio 2017 alongside will cause issues with .NET Core dependencies and will prevent the solution from deploying correctly
If you attempt to install the solution (with visual studio 2017)), a number of errors may happen during the install PowerShell script. These generally happen when MSBuild is attempting to build solutions.
C:\Projects\Sitecore.Demo.Retail\src\Foundation\Commerce.Entitlements\Engine.Entitlements\Sitecore.Foundation.Commerce.
Engine.Plugin.Entitlements.xproj(7,3): error MSB4019: The imported project "
C:\Program Files\dotnet\sdk\1.0.4\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Props" was not found. Confirm that the path
 in the <Import> declaration is correct, and that the file exists on disk.
 C:\Projects\Sitecore.Demo.Retail\src\Project\Retail\code\Sitecore.Demo.Retail.csproj(197,3): error MSB4019:
The imported project "C:\ProgramFiles\dotnet\sdk\1.0.4\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" was not found.
 C:\Projects\Sitecore.Demo.Retail\src\Foundation\Commerce\Engine\Sitecore.Foundation.Commerce.Engine.xproj : error  :
The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.  C:\Projects\Sitecore.Demo.Retail\src\Foundation\Commerce\Engine\Sitecore.Foundation.Commerce.Engine.xproj
C:\Users\ryanb\.nuget\packages\baseclass.contrib.nuget.output\2.1.0\build\net40\Baseclass.Contrib.Nuget.Output.targets(
73,5): error MSB4801: The task factory "CodeTaskFactory" could not be loaded because this version of MSBuild does not
support it. [C:\Projects\Sitecore.Demo.Retail\src\Foundation\Commerce\Engine\Engine.csproj]
These errors occur for two reasons:
  1. Visual Studio 2017 needs to be uninstalled
  2. Any other versions of the .NET core need to be uninstalled. The instructions (at time of writing) specify .NET Core 1.0.3 SDK Preview 2 build 3156.

Wednesday, May 24, 2017

Sitecore Demo Retail installation error

After pulling down Sitecore Demo Retail, and attempting to deploy it over Habitat, a couple errors came up during the install-commerce-sites PowerShell script. This one occurred during step 6
Invoke-Sqlcmd : Cannot drop the database 'demo.local_SitecoreCommerce.SharedEnvironments', because it does not exist or you do not have permission.

It traced back to one of the scripts being run: ManageSqlServer.psm1. The line where the dacservice for SQL server was originally the following:
$dacService = new-object Microsoft.SqlServer.Dac.DacServices "server=$server"
Updating the connection string to use windows credentials then allowed it to run correctly.
$dacService = new-object Microsoft.SqlServer.Dac.DacServices "server=$server;Integrated Security = True;"


Tuesday, May 23, 2017

Sitecore site gives a 503 service unavailable message

When attempting to load a Sitecore 8.2 instance on my local machine, the front-end site and Sitecore administration site were returning an error:
HTTP Error 503. The service is unavailable.
An IIS Reset did not appear to fix the issue and the Sitecore logs were not showing anything interesting.

It turns out that the application pool for the site was stopped for some reason. Starting this up allowed the web site to load correctly.