1

Sitecore throws below error when loading newly setup instance. Message: Could not find base site 'shell' for site 'unicorn'. Source: Sitecore.Kernel

It is mentioned in Git that this issue is fixed in this release https://github.com/SitecoreUnicorn/Unicorn/issues/398

But, the version I am using is already having this fix in place. I am looking for some solution where I can skip this config in CD using role:require = "ContentManagement" Adding this attribute to Unicorn is throwing other error as role is not specified attribute.

1 Answer 1

4

The ONLY recommended answer

The Unicorn configuration files should never be deployed to CD servers. In fact, no part of Unicorn should be deployed to CD servers. Ever.

You need to remove them.

https://github.com/SitecoreUnicorn/Unicorn/issues/398#issuecomment-1250021066

From a technical standpoint, you could alter the original file.

In line 13 of Unicorn.config, change this line:

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">

To this:

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:role="http://www.sitecore.net/xmlconfig/role/">

Now you've enabled the role:require setting. This will solve the error you describe with "role is not specified attribute".

At this point you can change the next line of configuration from:

<sitecore>

to

<sitecore role:require="StandAlone">

Or whatever role you want Unicorn to be active on. DO NOT ENABLE THIS FOR ContentDelivery


Sorry for all the bolded warnings, but I really can't stress this enough. Unicorn is entirely untested for Content Delivery servers and there could be anything from security problems to configuration problems coming from leaving it active in an environment it was never designed for.

For the curious, WHY isn't this set by default?

Because Unicorn tries its best to stick to the "path of least surprise". Unicorn is being used on a lot of projects < 9.x where config roles were introduced.

2
  • Thank you and it makes sense. I will try to make changes in our pipeline. So, there is no way for us to make this "ContentManagement" through the configs ?
    – Meghan
    Commented Feb 5 at 18:07
  • There is. But all you'll solve is to make this particular problem go away; not the underlying problem is that putting Unicorn onto a CD server is entirely "undefined behaviour" and the tool is just not supposed to be there at all.
    – Mark Cassidy
    Commented Feb 6 at 7:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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