We're upgrading from Sitecore 8.1 Update 3 to Sitecore 9.1. We use Solr for xConnect search, Lucene for web site search The CM is working, but the CD is not. Got the following error message:

Server Error in '/' Application.
Post condition failed
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.InvalidOperationException: Post condition failed

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

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

I have this in the log file:

6948 2019:03:12 12:22:08 ERROR Error loading hook: <hook 
type="Sitecore.ContentSearch.Hooks.Initializer, Sitecore.ContentSearch" patch:source="Sitecore.ContentSearch.config" xmlns:patch="http://www.sitecore.net/xmlconfig/" />
Exception: System.InvalidOperationException
Message: Post condition failed
Source: Sitecore.Kernel
   at Sitecore.Diagnostics.Assert.ResultNotNull[T](T result, String message)
   at Sitecore.Configuration.DefaultFactory.GetDatabase(String name)
   at Sitecore.Configuration.DefaultFactory.GetDatabases()
   at Sitecore.Abstractions.FactoryWrapper.GetDatabases()
   at Sitecore.ContentSearch.Maintenance.EventHub.Initialize()
   at Sitecore.ContentSearch.Hooks.Initializer.Initialize()
   at Sitecore.Events.Hooks.HookManager.LoadAll()

Any idea? Thanks

  • It looks like the name parameter is null on Sitecore.Configuration.DefaultFactory.GetDatabase(String name). Any reason why it would happen? Mar 12, 2019 at 19:15
  • I removed the core db from my custom config and it works now. Thanks
    – mv98
    Mar 12, 2019 at 21:23
  • Just a note... in 9.1 Lucene is no longer supported in production or for scaled setups like yours. Not related to your error, just wanted to make sure you know the support impact Mar 13, 2019 at 14:09

1 Answer 1


As you mentioned in the comments, you had a reference to the core database. In the default configuration of Sitecore 9.1 when using the ContentDelivery role in web.config, the core DB will be disabled.

This was mentioned in the Sitecore 9.1.0 release notes.

You can either re-enable the core database if you definitely require it - you can compare the Sitecore.config with the Sitecore.config in Sitecore 9.0.2 as to how this was changed - or you can ensure that there are no references to the core database when running the ContentDelivery role.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.