8

Sitecore 9.0.1

I've tried to create a new site definition that's associated with a custom publishing target database.

I have the database registered, publishing targets built, content completely published however I'm tracking an inability for the site to render placeholders. I just get a blank page with the layout markup on it like the placeholders didn't exist.

The tricky part is that if i jump into the site.config and modify it to use the "web" database and jump into the connection strings and switch the names of the web and custom database then it works perfectly. This leads me to believe it's not the database itself.

My assumption is that i'm just missing some wireup in Sitecore, but i'm not sure what.

Here is my Site and Database definition along with my attempt to wire everything up for my new database. Any suggestions would be welcome.

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<sites>
  <site name="tenantcom.tenant.com"
        patch:before="site[@name='website']"
        hostName="*.tenant.com"
        enableTracking="true"
        virtualFolder="/"
        physicalFolder="/"
        rootPath="/sitecore/content/tenantCom Tenant"
        startItem="/tenantCom"
        language="en"
        database="tenantcomlive"
        domain="extranet"
        allowDebug="true"
        cacheHtml="true"
        htmlCacheSize="50MB"
        registryCacheSize="0"
        viewStateCacheSize="0"
        xslCacheSize="25MB"
        filteredItemsCacheSize="10MB"
        enablePreview="true"
        enableWebEdit="true"
        enableDebugger="true"
        disableClientData="false"
        cacheRenderingParameters="true"
        renderingParametersCacheSize="10MB"
        enableItemLanguageFallback="false"
        enableFieldLanguageFallback="false"
        itemwebapi.mode="Off"
        itemwebapi.access="ReadOnly"
        itemwebapi.allowanonymousaccess="false" />



</sites>
<databases>
  <database id="tenantcomlive" 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 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>
    </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>
    <Engines.DataEngine.Commands.AddFromTemplatePrototype>
      <obj type="Sitecore.Buckets.Commands.AddFromTemplateCommand, Sitecore.Buckets" />
    </Engines.DataEngine.Commands.AddFromTemplatePrototype>
  </database>
</databases>
<eventing defaultProvider="sitecore">
  <eventQueueProvider defaultEventQueue="core">
    <eventQueue name="tenantcomlive" type="Sitecore.Data.Eventing.$(database)EventQueue, Sitecore.Kernel">
      <param ref="dataApis/dataApi[@name='$(database)']" param1="$(name)" />
      <param ref="PropertyStoreProvider/store[@name='$(name)']" />
    </eventQueue>
  </eventQueueProvider>
</eventing>
<PropertyStoreProvider defaultStore="core">
  <store name="tenantcomlive" prefix="tenantcomlive" 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>
<scheduling>
  <!-- Agent to cleanup obsolete File Drop Area field media data -->
  <agent type="Sitecore.Tasks.CleanupFDAObsoleteMediaData" method="Run" interval="1.00:00:00">
    <databases hint="raw:AddDatabase">
      <database name="tenantcomlive"/>
    </databases>
  </agent>
</scheduling>

  • When you switch to the custom database in Sitecore, do you see the items? – Hishaam Namooya Apr 22 '18 at 10:45
  • Yes, if i simply rename the connection string to "web" in the connectionstrings.config then it works fine. – Jeff Darchuk Apr 23 '18 at 12:58
4

I needed to create a custom index core for this database or else it isn't able to apply a datasource in the rendering for some reason.

My main clue was seeing this pretty inconspicuous error message

9544 11:48:41 ERROR There is no appropriate index for /Home - {110D559F-DEA5-42EA-9C1C-8A5DF7E70EF9}. You have to add an index crawler that will cover this item 9544 11:48:41 WARN Failed to execute datasource query Sitecore.ContentSearch.Exceptions.IndexNotFoundException: Index (EMPTY) was not found at Sitecore.ContentSearch.ContentSearchManager.GetIndex(String name) at Sitecore.Mvc.ExperienceEditor.DatasourceValidator.DatasourceValidator.IsDatasourceValid(String dataSource, Database database) 9544 11:48:41 WARN '{B701850A-CB8A-4943-B2BC-DDDB1238C103}' is not valid datasource for tenantcomlive or user does not have permissions to access.

This prompted me to add an index core which consisted of this config:

<contentSearch>
  <configuration type="Sitecore.ContentSearch.ContentSearchConfiguration, Sitecore.ContentSearch" >
    <indexes hint="list:AddIndex">
      <index id="sitecore_tenantcomlive_index" type="Sitecore.ContentSearch.SolrProvider.SolrSearchIndex, Sitecore.ContentSearch.SolrProvider">
        <param desc="name">$(id)</param>
        <param desc="core">sc901_tenantcomlive_index</param>
        <param ref="contentSearch/indexConfigurations/databasePropertyStore" desc="propertyStore" param1="$(id)"/>
        <configuration ref="contentSearch/indexConfigurations/defaultSolrIndexConfiguration"/>
        <strategies hint="list:AddStrategy">
          <strategy ref="contentSearch/indexConfigurations/indexUpdateStrategies/onPublishEndAsyncSingleInstance"/>
        </strategies>
        <locations hint="list:AddCrawler">
          <crawler type="Sitecore.ContentSearch.SitecoreItemCrawler, Sitecore.ContentSearch">
            <Database>tenantcomlive</Database>
            <Root>/sitecore</Root>
          </crawler>
        </locations>
        <enableItemLanguageFallback>false</enableItemLanguageFallback>
        <enableFieldLanguageFallback>false</enableFieldLanguageFallback>
      </index>
    </indexes>
  </configuration>
</contentSearch>

and copying the web_index core at /server/solr/{prefix}_web_index to a new folder of /server/solr/tenantcomlive_index

after this i had to

  • Delete the existing index data out of the new copy
  • Restart the solr service
  • Rebuild the index in Sitecore

And poof, it works.

| improve this answer | |

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.