Sitecore WFFM CD gives “Could not find configurati

2019-06-25 09:02发布

问题:

Sitecore WFFM page in CMS (connected to Master) works. In CD all pages works but when we go a WFFM page we get error Could not find configuration node: databases/database[@id='master'] It looks like WFFM in CD is looking into Master. In the connection string there is no master as it is CD. I think this config is causing issue (Sitecore.Marketing.Definitions.MarketingAssets.Repositories.config). Am I missing any steps in deploying to CD?

This error was shown in page(some part of it):

Sitecore.Configuration.DefaultFactory.CreateObject(String configPath, String[] parameters, Boolean assert) +615 Sitecore.WFFM.Abstractions.Dependencies.DependenciesManager.Resolve(String path) +24 Sitecore.Form.Core.Ascx.Controls.SimpleForm..ctor() +26 Sitecore.Form.Web.UI.Controls.SitecoreSimpleForm..ctor(Item item) +21

This is taken from error logs

Exception: System.InvalidOperationException Message: Could not find configuration node: databases/database[@id='master'] Source: Sitecore.Kernel 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, IDefinitionRecordMapper`1 mapper) at Sitecore.Marketing.Definitions.Goals.Data.ItemDb.GoalDefinitionItemRepository..ctor(String databaseName, Boolean assumeActive)

回答1:

Enable the SwitchMasterToWeb.config configuration patch file in the CD environments. This file helps simplify the setup of Sitecore CD instances by removing any references to the Master database from the Sitecore configuration files.

To enable the SwitchMasterToWeb.config file, rename it to have a ".config" extension.

It's also a good idea to rename the SwitchMasterToWeb.config file, or the folder that contains it, so that it is applied after any other include files that contain references to the Master database. E.G. move it into a "zzz" folder in the App_Config/Include folder.



回答2:

  1. Make sure this is done: (taken from official installation guide) Extra steps WFFM for Content Delivery (CD) Servers:

Copy the contents of "Web Forms for Marketers CD 8.2 rev.170413.zip" file into the web root On all the CD servers, in the \Website\App_Config\Include\Sitecore.Forms.Config file, remove or disable the following sections: In the section, remove: In the section, remove:

Add the following node to the section:

 <setting name="WFM.IsRemoteActions" value="true" />Make sure this setting is set as follows. <setting name="WFM.MasterDatabase" value="web" />
  1. SwitchMasterToWeb.config this might require customization. So first you would need to check the log file. In our case we found that some "master" reference was not added in SwitchMasterToWeb.config so we had to add it(that way master is changed to web). Some people contact Sitecore directly and Sitecore gave it customised for them. as given here