3

Alan Coates – Sitecore/.NET blog

 2 years ago
source link: https://blog.coates.dk/2021/11/23/sitecore-config-disappeared/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Sitecore config disappeared?

We had a Sitecore 9 solution that required the include files to be rearranged to align with a new azure deployment/provisioning setup using Terraform and to fix some duplication and inconsistencies.

Problem – Unicorn Sync Failed

When we enabled unicorn sync in the CD pipeline (see here for more details about Unicorn) the deploy failed?

Unfortunately (see image above) the configuration relating to the unicorn’s sc.variable‘s were missing?

Don’t have 2 <sitecore> elements

If there are 2 <sitecore> elements in a sitecore include file, even if they have mutely exclusive require statements Sitecore’s config merge ignores the file, without reporting an error!

Solution

There are 2 solutions to the problem

  1. Split the configuration into 2 files each with their own <sitecore> element.
  2. Merge the 2 <sitecore> elements into one element and move the require constraints to each sub element.

We decided to solution 2, see the result below.

Use patch:before=”prototypes” that way the new variables are shown at the top when showconfig.aspx is used (see image below) instead of half way down the page.

I hope this will help and no one else has to waste hours figuring this out, cheers Alan

This entry was posted in Sitecore on November 23, 2021.

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK