CodeBox
CodeBox

Reputation: 446

"Post condition failed" error when upgrading from 8.1 to 8.2

I'm in process of upgrading sitecore from 8.1 to 8.2 and now splitting into CD and CMS but im having issue getting CD working its giving me following error.

Not able to figure out where its causing the issue,

Stack trace:

[InvalidOperationException: Post condition failed]
Sitecore.Diagnostics.Assert.ResultNotNull(T result, String message) +85 Sitecore.Configuration.DefaultFactory.GetDatabase(String name) +86 Sitecore.Configuration.DefaultFactory.GetDatabases() +121 Sitecore.Data.Managers.DefaultItemManager.Initialize() +105 (Object , Object[] ) +117 Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +484 (Object , Object[] ) +71
Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +484
Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain) +22
Sitecore.Nexus.Web.HttpModule.Application_Start() +259
Sitecore.Nexus.Web.HttpModule.Init(HttpApplication app) +704
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +618
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +172
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +402
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +343

[HttpException (0x80004005): Post condition failed]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +579
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +112 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +712

Upvotes: 0

Views: 2094

Answers (2)

CodeBox
CodeBox

Reputation: 446

Managed to solve the issue by enabling switchMasterToWeb.config in Z.switchMasterToWeb folder instead of switchMasterToWeb in include folder.

Upvotes: 2

Marek Musielak
Marek Musielak

Reputation: 27142

The problem is with DefaultFactory and its GetDatabases method. This method gets all the databases which are defined inside sitecore/databases/database configuration.

Looks like there is still master database in that configuration, but you already removed its connection string or some other configuration relating to that database.

If you look at Configure a content delivery server guide, there is information to remove configuration/sitecore/databases/database (Comment out the entire master database section).

Upvotes: 2

Related Questions