Question

Hi all I'm having a bit of a problem with our Content Delivery servers. We are unable to remove the master database without it blowing up. Our current information is below:

Sitecore.NET 6.5.0 (rev. 111230)
December 30, 2011
.NET Framework 4.0.30319.239
Database version: 500

The error and stack trace that we are receiving is:

[InvalidOperationException: Unknown connection string. Name: 'master']
   Sitecore.Configuration.Settings.GetConnectionString(String connectionStringName) +364
   Sitecore.Configuration.Factory.CreateFromConnectionStringName(XmlNode configNode, String[] parameters, Boolean assert) +106
   Sitecore.Configuration.Factory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper) +164
   Sitecore.Configuration.Factory.GetInnerObject(XmlNode paramNode, String[] parameters, Boolean assert) +110
   Sitecore.Configuration.Factory.GetConstructorParameters(XmlNode configNode, String[] parameters, Boolean assert) +209
   Sitecore.Configuration.Factory.CreateFromTypeName(XmlNode configNode, String[] parameters, Boolean assert) +94
   Sitecore.Configuration.Factory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper) +141
   Sitecore.Configuration.Factory.CreateObject(String configPath, String[] parameters, Boolean assert) +424
   Sitecore.Configuration.Factory.CreateFromReference(XmlNode configNode, String[] parameters, Boolean assert) +194
   Sitecore.Configuration.Factory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper) +118
   Sitecore.Configuration.Factory.GetInnerObject(XmlNode paramNode, String[] parameters, Boolean assert) +930
   Sitecore.Configuration.Factory.AssignProperties(XmlNode configNode, String[] parameters, Object obj, Boolean assert, Boolean deferred, IFactoryHelper helper) +581
   Sitecore.Configuration.Factory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper) +296
   Sitecore.Configuration.Factory.CreateObject(String configPath, String[] parameters, Boolean assert) +424
   Sitecore.Configuration.Factory.GetDatabase(String name, Boolean assert) +185
   Sitecore.Configuration.Factory.GetDatabases() +152
   Sitecore.Data.Managers.HistoryManager.InitializeEventHandlers() +49
   Sitecore.Pipelines.Loader.InitializeManagers.Process(PipelineArgs args) +14
   (Object , Object[] ) +80
   Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +191
   Sitecore.Nexus.Web.HttpModule.Application_Start() +146
   Sitecore.Nexus.Web.HttpModule.Init(HttpApplication app) +603
   System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +575
   System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +352
   System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +407
   System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +375

[HttpException (0x80004005): Unknown connection string. Name: 'master']
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +11700608
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +141
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +4868805

It appears that when the History Manager is initializing it is requesting information from the master database at some point. Can anybody help me track down where this issue is occurring?

Thanks in advance,

-Tom

Update #1

After adding SwitchMasterToWeb.config to the app_config/include folder I now get this message:

[InvalidOperationException: Could not find configuration node: databases/database[@id='master']]
   Sitecore.Diagnostics.Assert.IsTrue(Boolean condition, String message) +57
   Sitecore.Configuration.Factory.GetConfigNode(String xpath, Boolean assert) +279
   Sitecore.Configuration.Factory.CreateObject(String configPath, String[] parameters, Boolean assert) +144
   Sitecore.Configuration.Factory.GetDatabase(String name) +169
   LuceneSearch.LuceneSearch.LuceneSearchBox.Page_Load(Object sender, EventArgs e) in C:\xyz\Website\sitecore modules\LuceneSearch\LuceneSearchBox.ascx.cs:29
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +25
   System.Web.UI.Control.LoadRecursive() +71
   System.Web.UI.Control.LoadRecursive() +190
   System.Web.UI.Control.LoadRecursive() +190
   System.Web.UI.Control.LoadRecursive() +190
   System.Web.UI.Control.LoadRecursive() +190
   System.Web.UI.Control.LoadRecursive() +190
   System.Web.UI.Control.LoadRecursive() +190
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3064
Was it helpful?

Solution

Your search index configuration likely contains references to both master and web databases. You'll need to patch it or replace it on the CD server to just include a web database location .

OTHER TIPS

LuceneSearch.LuceneSearch.LuceneSearchBox.Page_Load() has a hard-coded reference to the master DB. Re-compile without this or don't deploy the DLL that this code-behind is in.

If you copy SwitchMasterToWeb.Config in the app_config\include the references to the master database should be removed. In case you already copied it, then check whether you made a copy-paste error when configuring the history engine.

If you want to remove the master database for the production environment you need to remember about updating the configuration of the environment as well (repointing each site to web database, removing master database indexes and archives, etc).

Here is the documentation explaining how to configure Sitecore production environment. It is written for the Sitecore 6.0 but it works in a same way in newer versions. Chapter 1.2.1 explains what you need to do to remove master database:

http://sdn.sitecore.net/upload/sdn5/developer/configuring%20production%20environments/configuring%20production%20environments.pdf

Go to www.yoursite.com/sitecore/admin/showconfig.aspx to view your current configuration. Do a text search for "master" or check the sections

<indexes>

and

<Engines.HistoryEngine.Storage>

You probably have a setting which still points to the master database. It might be included by one of the include files in the /App_Config/

I removed the file "Sitecore.ContentSearch.Lucene.Index.Master.config" from the App_Config directory, and this resolved for me. I was attempting to setup the LaunchSitecore side, using CM and CD environments.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top