Thursday, March 29, 2018

Sitecore Experience Commerce - Update data templates fails

After upgrading from version 9.0 to 9.1 of Sitecore Experience Commerce, the update data templates command was failing.

Sitecore Experience Commerce - Update data templates error
The Sitecore logs were showing:
ERROR GetList(id='Catalogs',type='Sitecore.Commerce.Plugin.Catalog.Catalog, Sitecore.Commerce.Plugin.Catalog',skip=0,take=1)?$expand=Items($select=Id)
System.Exception: An error occured while trying to contact the Commerce Service. Error code BadRequest at Sitecore.Commerce.Engine.Connect.DataProvider.CatalogRepository.LogResponseError(HttpResponseMessage response, Boolean raiseError)
   at Sitecore.Commerce.Engine.Connect.DataProvider.CatalogRepository.<InvokeHttpClientGetAsync>d__24.MoveNext()
Looking into the logs for the Authoring role of commerce engine, there were more detailed logs:
ERROR Management.block.getitembypath: Sitecore Item Service Get item failed, Item /sitecore/Commerce/Commerce Control Panel/Storefront Settings/Storefronts/MyShop not found.54 13:23:40 ERROR CtxMsg.Error.InvalidShop: Text=Shop 'MyShop' does not exist.54 13:23:40 ERROR PipelineAbort:Shop 'MyShop' does not exist.54 13:23:40 ERROR CtxMsg.Error.InvalidShop: Text=Shop 'MyShop' does not exist.49 13:23:40 ERROR CommerceController.OnActionExecuting.BadRequest: Code=Error|TermKey=InvalidShop|Text=Shop 'MyShop' does not exist.
Two changes was able to get this resolved for me:
  • If you have renamed the default instance of the Storefront settings (/sitecore/Commerce/Commerce Control Panel/Storefront Settings/Storefronts\Storefront) this change may have been overwritten during the upgrade.
  • Ensure that the PlugIn.Content.PolicySet-1.0.0.json file inside each commerce engine site has the correct Host URL that points to your Sitecore instance.
These changes should get the data templates updating as expected. Don't forget to bootstrap if you change the PolicySet inside the commerce engine sites.

No comments:

Post a Comment