sitecoresitecore8web-forms-for-marketersgoal-tracking

Sitecore is throwing a database node exception in the CD environment


WFFM works great in the CM environment.

In the CD environment, I unpacked the content inside of Web Forms for Marketers CD 8.2 rev. 161129.zip in my Website folder. I then:

  1. On all the CD servers, in the \Website\App_Config\Include\Sitecore.Forms.Config file, remove or disable the following sections. <hook type="Sitecore.Form.Core.WffmActionHook, Sitecore.Forms.Core"/>
  2. Removed the <event name="wffm:action:remote"> section as well.
  3. I added <setting name="WFM.IsRemoteActions" value="true" /> and <setting name="WFM.IsRemoteActions" value="true" />.

In my connectionstrings.config, there is no connection name for master. We've decided to remove all references to master in the CD environment.

In the showconfig file, I see <setting name="WFM.MasterDatabase" value="web" patch:source="Sitecore.Forms.config" />.

I published the entire site from CM to CD. When I look at the page in the CD environment, I get the following exception:

Exception: System.InvalidOperationException
Message: Could not find configuration node: databases/database[@id='master']
Source: Sitecore.Kernel
   at Sitecore.Diagnostics.Assert.IsTrue(Boolean condition, String format, Object[] args)
   at Sitecore.Configuration.DefaultFactory.GetConfigNode(String xpath, Boolean assert)
   at Sitecore.Configuration.DefaultFactory.CreateObject(String configPath, String[] parameters, Boolean assert)
   at Sitecore.Configuration.DefaultFactory.GetDatabase(String name, Boolean assert)
   at Sitecore.Configuration.DefaultFactory.GetDatabase(String name)
   at Sitecore.Marketing.Definitions.Goals.Data.ItemDb.GoalDefinitionItemRepository..ctor(String databaseName, Boolean assumeActive, IDefinitionRecord
Mapper`1 mapper)
   at Sitecore.Marketing.Definitions.Goals.Data.ItemDb.GoalDefinitionItemRepository..ctor(String databaseName, Boolean assumeActive)

Following this post, I truncated the links table in the Core database, and rebuilt it again. Still, no luck!

What am I doing wrong?


Solution

  • After going back and forth with Sitecore Support, they noted that this issue is not related to WFFM, but to the Goals definitions that cannot be loaded.

    Response from Sitecore

    The issue that SwitchMasterToWeb config leaves a reference to the Master database in node was registered as a bug in our bug tracking system. To track the future status of this bug report, please use the reference number 98770

    Important

    Make sure the following changes are made ONLY in the CD environment(s).

    Open \App_Config\Include\Sitecore.Marketing.config, and change the followings: from <itemRepositoriesDatabase>master</itemRepositoriesDatabase> to <itemRepositoriesDatabase>web</itemRepositoriesDatabase>

    Doing so, will cause a Sitecore.ContentSearch.Exceptions.IndexNotFoundException exception. Stack trace will include:

    Exception: Sitecore.ContentSearch.Exceptions.IndexNotFoundException
    Message: Index sitecore_marketingdefinitions_master was not found
    Source: Sitecore.ContentSearch
       at Sitecore.ContentSearch.ContentSearchManager.GetIndex(String name)
       at Sitecore.Marketing.Search.BaseDefinitionSearchProvider`2..ctor(String indexName)
    

    According to this article, sitecore_marketingdefinitions_master index should not be present on CD. To fix this issue, open \App_Config\Include\Sitecore.Marketing.Search.config, and change the following: from <searchIndexName>sitecore_marketingdefinitions_master</searchIndexName> to <searchIndexName>sitecore_marketingdefinitions_web</searchIndexName>