1

We are migrating to Sitecore 10.1 (Full Azure Paas), we have added a new publishing target following this documentation (link).

All databases were created using ARM template, we have a blue/green setup.

We are not able to publish or browse the secondary publishing target via CMS. We get the same issue also when trying to run Indexes or use dbBrowser on that DB. Note that Core, Master and Web work perfectly fine.

Here an error example when trying to switch view to the staging database from desktop:

 [ArgumentNullException: Value cannot be null.
Parameter name: item]
Sitecore.Diagnostics.Assert.ArgumentNotNull(Object argument, String argumentName) +63
Sitecore.Data.Managers.ItemProvider.ApplySecurity(Item item, SecurityCheck securityCheck) +33
Sitecore.Data.Managers.DefaultItemManager.GetRootItem(Language language, Version version, Database database) +110
Sitecore.Nexus.Data.DataCommands.ResolvePathCommand.ResolvePath(String itemPath, Database database) +134
Sitecore.Nexus.Data.DataCommands.ResolvePathCommand.Execute(String itemPath, Database database) +493
Sitecore.Data.Engines.EngineCommand`2.Execute() +93
Sitecore.Data.Managers.ItemProvider.GetItem(String itemPath, Language language, Version version, Database database, SecurityCheck securityCheck) +149
Sitecore.ContentTesting.Pipelines.ItemProvider.GetItem.GetItemUnderTestProcessor.Process(GetItemArgs args) +128
(Object , Object ) +14
Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +490
Sitecore.Data.Managers.DefaultItemManager.GetItem(String itemPath, Language language, Version version, Database database, SecurityCheck securityCheck) +305
Sitecore.Data.Managers.DefaultItemManager.GetItem(String itemPath, Language language, Version version, Database database) +147
Sitecore.Data.Managers.ItemManager.GetItem(String itemPath, Language language, Version version, Database database) +154
Sitecore.Globalization.DictionaryDomain.GetDomainDefinitionItem(Database database, String name)+188
Sitecore.Globalization.DictionaryDomain.TryParse(String domainDefinition, Database database, DictionaryDomain& domain) +416
Sitecore.Globalization.DictionaryDomain.GetDefaultDomain(Database database) +134
Sitecore.Pipelines.GetTranslation.TryGetFromContextDatabase.Process(GetTranslationArgs args) +149
(Object , Object ) +9
Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +490
Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain, Boolean failIfNotExists) +236
Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, Boolean failIfNotExists) +36
Sitecore.Globalization.DefaultTranslate.TextByLanguage(String domainName, TranslateOptions options, String key, Language language, String defaultValue, Object[] parameters) +416
Sitecore.Globalization.DefaultTranslate.TextByLanguage(String key, Language language, String defaultValue, Object[] parameters) +161
Sitecore.Globalization.DefaultTranslate.TextByLanguage(String key, Language language, String defaultValue) +162
Sitecore.Globalization.DefaultTranslate.TextByLanguage(String key, Language language) +150
Sitecore.Web.UI.HtmlControls.Literal.set_Text(String value) +143
[TargetInvocationException: Exception has been thrown by the target of an invocation.]
System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0
System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) +132
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +146
System.Reflection.RuntimePropertyInfo.SetValue(Object obj, Object value, Object[] index) +36
Sitecore.Reflection.ReflectionUtil.SetProperty(Object obj, PropertyInfo property, Object value) +277
Sitecore.Reflection.ReflectionUtil.SetProperty(Object obj, String name, Object value) +268
Sitecore.Web.UI.XmlControls.ControlFactory.SetProperties(Control control, Object[] properties) +771
Sitecore.Web.UI.XmlControls.XmlControl.AddControl(Control control, Control parent, String placeholderID, String[] properties) +54
Sitecore.Web.UI.XmlControls.WebPanel_a_265.Initialize() +865
Sitecore.Web.UI.XmlControls.XmlControl..ctor() +84
[TargetInvocationException: Exception has been thrown by the target of an invocation.]
System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0
System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +297
Sitecore.Reflection.ReflectionUtil.CreateObject(Type type) +109
Sitecore.Web.UI.XmlControls.ControlFactory.GetControl(Control parent, String controlName, String mode, Object[] properties, AllowGenericControl allowGeneric) +56
Sitecore.Web.UI.XmlControls.FormPage_a_264.Initialize() +183
Sitecore.Web.UI.XmlControls.XmlControl..ctor() +84
Sitecore.Web.UI.XmlControls.FormPage_a_264..ctor() +16
[TargetInvocationException: Exception has been thrown by the target of an invocation.]
System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0
System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +297
Sitecore.Reflection.ReflectionUtil.CreateObject(Type type) +109
Sitecore.Web.UI.XmlControls.ControlFactory.GetControl(Control parent, String controlName, String mode, Object[] properties, AllowGenericControl allowGeneric) +56
Sitecore.Web.UI.XmlControls.Shell_a_263.Initialize() +1829
Sitecore.Web.UI.XmlControls.XmlControl..ctor() +84
[TargetInvocationException: Exception has been thrown by the target of an invocation.]
System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0
System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +297
Sitecore.Reflection.ReflectionUtil.CreateObject(Type type) +109
Sitecore.Web.UI.XmlControls.ControlFactory.GetControl(Control parent, String controlName, String mode, Object[] properties, AllowGenericControl allowGeneric) +56
Sitecore.Web.UI.XmlControls.DucatShell_a_262.Initialize() +115
Sitecore.Web.UI.XmlControls.XmlControl..ctor() +84
[TargetInvocationException: Exception has been thrown by the target of an invocation.]
System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0
System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +297
Sitecore.Reflection.ReflectionUtil.CreateObject(Type type) +109
Sitecore.Web.UI.XmlControls.ControlFactory.GetControl(Control parent, String controlName, String mode, Object[] properties, AllowGenericControl allowGeneric) +56
Sitecore.Web.UI.XmlControls.ControlFactory.GetControl(String controlName) +48
Sitecore.Shell.DefaultPage.OnInit(EventArgs e) +117
System.Web.UI.Control.InitRecursive(Control namingContainer) +454
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1719

The added patches seems to load correctly, here a view of showconfig.aspx:

Property Store Provider:

<PropertyStoreProvider patch:source="Sitecore.PropertyStore.config" defaultStore="web">
    <store name="web" prefix="web" getValueWithoutPrefix="true" singleInstance="true" type="Sitecore.Data.Properties.SqlServerPropertyStore, Sitecore.Kernel">
        <param ref="dataApis/dataApi[@name='SqlServer']" param1="$(name)"/>
        <param type="Sitecore.Abstractions.BaseEventManager, Sitecore.Kernel" resolve="true"/>
        <param type="Sitecore.Abstractions.BaseCacheManager, Sitecore.Kernel" resolve="true"/>
    </store>
    <store name="webstaging" prefix="webstaging" getValueWithoutPrefix="true" singleInstance="true" type="Sitecore.Data.Properties.SqlServerPropertyStore, Sitecore.Kernel" patch:source="Baseline.Foundation.SitecoreExtensions.config">
        <param ref="dataApis/dataApi[@name='SqlServer']" param1="$(name)"/>
        <param type="Sitecore.Abstractions.BaseEventManager, Sitecore.Kernel" resolve="true"/>
        <param type="Sitecore.Abstractions.BaseCacheManager, Sitecore.Kernel" resolve="true"/>
    </store>
    <store name="master" prefix="master" getValueWithoutPrefix="true" singleInstance="true" type="Sitecore.Data.Properties.SqlServerPropertyStore, Sitecore.Kernel">
        <param ref="dataApis/dataApi[@name='SqlServer']" param1="$(name)"/>
        <param type="Sitecore.Abstractions.BaseEventManager, Sitecore.Kernel" resolve="true"/>
        <param type="Sitecore.Abstractions.BaseCacheManager, Sitecore.Kernel" resolve="true"/>
    </store>
    <store name="core" prefix="core" getValueWithoutPrefix="true" singleInstance="true" type="Sitecore.Data.Properties.SqlServerPropertyStore, Sitecore.Kernel">
        <param ref="dataApis/dataApi[@name='SqlServer']" param1="$(name)"/>
        <param type="Sitecore.Abstractions.BaseEventManager, Sitecore.Kernel" resolve="true"/>
        <param type="Sitecore.Abstractions.BaseCacheManager, Sitecore.Kernel" resolve="true"/>
    </store>
</PropertyStoreProvider>

Event Queue Provider:

<eventQueueProvider patch:source="Sitecore.Eventing.config" defaultEventQueue="web">
        <eventQueue name="web" type="Sitecore.Data.Eventing.SqlServerEventQueue, Sitecore.Kernel">
            <param ref="dataApis/dataApi[@name='SqlServer']" param1="$(name)"/>
            <param ref="PropertyStoreProvider/store[@name='$(name)']"/>
        </eventQueue>
        <eventQueue name="webstaging" type="Sitecore.Data.Eventing.SqlServerEventQueue, Sitecore.Kernel" patch:source="Baseline.Foundation.SitecoreExtensions.config">
            <param ref="dataApis/dataApi[@name='SqlServer']" param1="$(name)"/>
            <param hint="" ref="PropertyStoreProvider/store[@name='$(name)']"/>
        </eventQueue>
        <eventQueue name="master" type="Sitecore.Data.Eventing.SqlServerEventQueue, Sitecore.Kernel">
            <param ref="dataApis/dataApi[@name='SqlServer']" param1="$(name)"/>
            <param hint="" ref="PropertyStoreProvider/store[@name='$(name)']"/>
        </eventQueue>
        <eventQueue name="core" type="Sitecore.Data.Eventing.SqlServerEventQueue, Sitecore.Kernel">
            <param ref="dataApis/dataApi[@name='SqlServer']" param1="$(name)"/>
            <param ref="PropertyStoreProvider/store[@name='$(name)']"/>
        </eventQueue>
    </eventQueueProvider>

Data Base Definition:

<database id="webstaging" type="Sitecore.Data.DefaultDatabase, Sitecore.Kernel" singleInstance="true" patch:source="Baseline.Foundation.SitecoreExtensions.config">
        <param desc="name">$(id)</param>
        <icon>Images/database_web.png</icon>
        <securityEnabled>true</securityEnabled>
        <dataProviders hint="list:AddDataProvider">
            <dataProvider type="Sitecore.Data.DataProviders.CompositeDataProvider, Sitecore.Kernel">
                <param hint="list" desc="readOnlyDataProviders">
                    <protobufItems type="Sitecore.Data.DataProviders.ReadOnly.Protobuf.ProtobufDataProvider, Sitecore.Kernel">
                        <filePaths hint="list">
                            <filePath>D:\home\site\wwwroot\App_Data/items/$(id)</filePath>
                        </filePaths>
                    </protobufItems>
                </param>
                <param desc="headProvider">
                    <dataProvider ref="dataProviders/main" param1="$(id)">
                        <disableGroup>publishing</disableGroup>
                        <prefetch hint="raw:AddPrefetch">
                            <childLimit>100</childLimit>
                            <logStats>false</logStats>
                            <template desc="template">{AB86861A-6030-46C5-B394-E8F99E8B87DB}</template>
                            <template desc="template section">{E269FBB5-3750-427A-9149-7AA950B49301}</template>
                            <template desc="template field">{455A3E98-A627-4B40-8035-E683A0331AC7}</template>
                            <template desc="language">{F68F13A6-3395-426A-B9A1-FA2DC60D94EB}</template>
                            <template desc="device">{B6F7EEB4-E8D7-476F-8936-5ACE6A76F20B}</template>
                            <item desc="root">{11111111-1111-1111-1111-111111111111}</item>
                            <children desc="main sections">{11111111-1111-1111-1111-111111111111}</children>
                            <cacheSize>100MB</cacheSize>
                            <template desc="alias">{54BCFFB7-8F46-4948-AE74-DA5B6B5AFA86}</template>
                            <template desc="layout">{3A45A723-64EE-4919-9D41-02FD40FD1466}</template>
                            <template desc="Sublayout">{0A98E368-CDB9-4E1E-927C-8E0C24A003FB}</template>
                            <template desc="xsl rendering">{F1F1D639-4F54-40C2-8BE0-81266B392CEB}</template>
                            <item desc="home">{110D559F-DEA5-42EA-9C1C-8A5DF7E70EF9}</item>
                            <children desc="main items">{110D559F-DEA5-42EA-9C1C-8A5DF7E70EF9}</children>
                            <!--  MVC  -->
                            <template desc="Controller rendering">{2A3E91A0-7987-44B5-AB34-35C2D9DE83B9}</template>
                            <template desc="Item rendering">{86776923-ECA5-4310-8DC0-AE65FE88D078}</template>
                            <template desc="Rendering">{92D4A8C4-5754-4E1A-96A6-095BD193E12B}</template>
                            <template desc="Sublayout">{0A98E368-CDB9-4E1E-927C-8E0C24A003FB}</template>
                            <template desc="View rendering">{99F8905D-4A87-4EB8-9F8B-A9BEBFB3ADD6}</template>
                            <!--  Rules  -->
                            <template desc="Action">{F90052A5-B4E6-4E6D-9812-1E1B88A6FCEA}</template>
                            <template desc="Condition">{F0D16EEE-3A05-4E43-A082-795A32B873C0}</template>
                            <template desc="Conditional Rendering Rule">{550B5CEF-242C-463F-8ED5-983922A39863}</template>
                            <template desc="Content Editor Warning Rule">{71A2C881-FBB3-4A23-A187-7FD50A20F924}</template>
                            <template desc="Insert Options Rule">{664E5035-EB8C-4BA1-9731-A098FCC9127A}</template>
                            <template desc="Rule">{D9BDF22F-6E17-47F3-AB64-49C717BA92DA}</template>
                            <template desc="Script">{AB6DD55D-75E3-4A02-9793-7054ED90FCB6}</template>
                            <template desc="Element Folder">{54DAE7CD-BFD8-4E69-9679-75F2AE9F9034}</template>
                            <template desc="Rule Elements Visibility Rule">{271F5CF1-95C7-474D-9F04-06C6EBB20D8F}</template>
                            <template desc="Rules Context Folder">{DDA66314-03F3-4C89-84A9-39DFFB235B06}</template>
                            <template desc="Rules Folder">{8EA2CF67-4250-47A2-AECA-4F70FD200DC7}</template>
                            <template desc="Tag">{1A9B6300-4652-477C-A4B5-B2A64E86B29F}</template>
                            <template desc="Tags Definition">{854BA861-63EA-4A0C-8C7B-541E9A7EC4C1}</template>
                            <template desc="Tags Definitions Folder">{96C8E5DD-63C3-496B-A97C-A3E37E1DACBA}</template>
                            <template desc="Visibility">{AA91A868-02F2-41D3-8B78-1CAD91B4DCAE}</template>
                            <template desc="Validation Result">{29045375-C15F-4E69-B873-75C3F5C1814B}</template>
                            <template desc="Validation Rule">{0512BDE9-5696-42C4-8C7D-B349EDA9CEF9}</template>
                        </prefetch>
                    </dataProvider>
                </param>
            </dataProvider>
        </dataProviders>
        <PropertyStore ref="PropertyStoreProvider/store[@name='$(id)']"/>
        <remoteEvents.EventQueue>
            <obj ref="eventing/eventQueueProvider/eventQueue[@name='$(id)']"/>
        </remoteEvents.EventQueue>
        <archives hint="raw:AddArchive">
            <archive name="archive"/>
            <archive name="recyclebin"/>
        </archives>
        <cacheSizes hint="setting">
            <data>100MB</data>
            <items>50MB</items>
            <paths>2500KB</paths>
            <itempaths>50MB</itempaths>
            <standardValues>2500KB</standardValues>
        </cacheSizes>
        <BlobStorage hint="raw:AddBlobStorage">
            <providers default="classic">
                <provider name="classic" type="Sitecore.Data.Blobs.ClassicSqlBlobProvider, Sitecore.Kernel">
                    <param desc="databaseName">$(id)</param>
                </provider>
            </providers>
        </BlobStorage>
    </database>

Connection strings:

<add name="web" connectionString="*********" />
<add name="webstaging" connectionString="*********" />
4
  • Welcome to sitecore stack exchange. Can you verify using /sitecore/admin/showconfig.aspx if your changes are correctly appearing? Also how was the new database created in sql? If possible please add more details to the question, like log errors for example. Mar 13 at 8:21
  • We need exceptions/stack traces as text, not images. For SEO.
    – Mark Cassidy
    Mar 13 at 10:47
  • Have you tried switching in connectionstrings.config web with webstaging, to make sure that the db is correctly setup? Mar 15 at 21:14
  • Yes, i have switched connection string with the main web database, and still have the same issue.
    – MyMehdi
    Mar 16 at 15:31
0

I Opened a Sitecore ticket, and they confirm that the documentation for Sitecore 10.1 (here) will not work, they will update the documentation soon. Meanwhile here's the correct steps provided by their engineers:

  • Please, use the attached sample for the patch instead of the code that is used in the article:
  • Copy the "Web" folder in the "...App_Data\items" folder
  • Rename the folder and the .dat file: use the database name (e.g., web_preview) instead of "web" in the folder name and in the file name (file path should be like "...\web_preview\items.web_preview.dat"
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
  <sitecore>
    <eventing defaultProvider="sitecore">
      <eventQueueProvider>
        <eventQueue name="web_preview" patch:after="eventQueue[@name='web']" type="Sitecore.Data.Eventing.$(database)EventQueue, Sitecore.Kernel">
          <param ref="dataApis/dataApi[@name='$(database)']" param1="$(name)" />
          <param hint="" ref="PropertyStoreProvider/store[@name='$(name)']" />
        </eventQueue>
      </eventQueueProvider>
    </eventing>
    <PropertyStoreProvider>
      <store name="web_preview" patch:after="store[@name='web']" prefix="web_secondary" getValueWithoutPrefix="true" singleInstance="true" type="Sitecore.Data.Properties.$(database)PropertyStore, Sitecore.Kernel">
        <param ref="dataApis/dataApi[@name='$(database)']" param1="$(name)" />
        <param resolve="true" type="Sitecore.Abstractions.BaseEventManager, Sitecore.Kernel" />
        <param resolve="true" type="Sitecore.Abstractions.BaseCacheManager, Sitecore.Kernel" />
      </store>
    </PropertyStoreProvider>
    <databases>
      <!-- web_secondary -->
      <database id="web_preview" patch:after="database[@id='web']" singleInstance="true" type="Sitecore.Data.DefaultDatabase, Sitecore.Kernel">
        <param desc="name">$(id)</param>
        <icon>Images/database_web.png</icon>
        <securityEnabled>true</securityEnabled>
        <dataProviders hint="list:AddDataProvider">
          <dataProvider type="Sitecore.Data.DataProviders.CompositeDataProvider, Sitecore.Kernel">
          <param desc="readOnlyDataProviders" hint="list">
            <protobufItems type="Sitecore.Data.DataProviders.ReadOnly.Protobuf.ProtobufDataProvider, Sitecore.Kernel">
              <filePaths hint="list">
                <filePath>$(dataFolder)/items/$(id)</filePath>
              </filePaths>
            </protobufItems>
          </param>
            <param desc="headProvider">
              <dataProvider ref="dataProviders/main" param1="$(id)">
                <disableGroup>publishing</disableGroup>
                <prefetch hint="raw:AddPrefetch">
                  <sc.include file="/App_Config/Prefetch/Common.config" />
                  <sc.include file="/App_Config/Prefetch/Webdb.config" />
                </prefetch>
              </dataProvider>
            </param>
          </dataProvider>
        </dataProviders>
        <PropertyStore ref="PropertyStoreProvider/store[@name='$(id)']" />
        <remoteEvents.EventQueue>
          <obj ref="eventing/eventQueueProvider/eventQueue[@name='$(id)']" />
        </remoteEvents.EventQueue>
        <archives hint="raw:AddArchive">
          <archive name="archive" />
          <archive name="recyclebin" />
        </archives>
        <cacheSizes hint="setting">
          <data>100MB</data>
          <items>50MB</items>
          <paths>2500KB</paths>
          <itempaths>50MB</itempaths>
          <standardValues>2500KB</standardValues>
        </cacheSizes>
      </database>
    </databases>
  </sitecore>
</configuration>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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