1

We deployed our codebase on the upgraded instance on Sitecore 9.0.2 in an scaled environment with 1CM(for CM, Processing, Reporting), 1 xConnect and 2 CD (for Content Delivery Role). The CM and all the xConnect Roles are coming up fine but the Content Delivery Instance is throwing the exception mentioned below.

Using octopus to transform the config files, we verified that role:define have correct values on the corresponding environments. Since on Sitecore 9 there is no SwitchMasterToWeb config file hence the enabling/disabling references to Master DB should not be a manual process if we have role:define as ContentDelivery.

We also tried manually removing the Master DB configuration from Sitecore.Config, but that dint help as well.

We referred on this question as well but no luck: Post Condition Failed on Sitecore 9 Content Delivery Server

What else are we missing here?

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.Data.Managers.LanguageProvider.InitializeEventHandlers()
   at Sitecore.Data.Managers.LanguageProvider..ctor(BaseCacheManager cacheManager, BaseSettings settings)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.ConstructorCallSite.Invoke(ServiceProvider provider)
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.ScopedCallSite.Invoke(ServiceProvider provider)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.ConstructorCallSite.Invoke(ServiceProvider provider)
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.ScopedCallSite.Invoke(ServiceProvider provider)
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)
   at Sitecore.DependencyInjection.LazyResetable`1.get_Value()
   at Sitecore.Globalization.Language.TryParse(String name, Language& result)
   at Sitecore.Globalization.Language.Parse(String name)
   at Sitecore.Jobs.JobOptions..ctor(String jobName, String category, String siteName, Object obj, String methodName, Object[] parameters)
   at Sitecore.Jobs.JobOptions..ctor(String jobName, String category, String siteName, Object obj, String methodName)
   at Sitecore.CES.DeviceDetection.Providers.DeviceDetectionClient.Tick()


ManagedPoolThread #3 11:32:53 INFO  Trying to load XML configuration /App_Config/Security/Domains.config
ManagedPoolThread #0 11:32:53 ERROR Exception in alarm clock event subscriber.
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.Eventing.EventProvider.RaiseQueuedEvents()
   at Sitecore.Data.Eventing.EventQueueMonitor.AlarmClock_Ring(Object sender, EventArgs e)
   at Sitecore.Services.AlarmClock.<>c__DisplayClass11_0.<Heartbeat_Beat>b__0(Object state)

enter image description here

  • 1
    My guess would be that you have something in the config without a role limitation that is referencing the master db or something else removed on the CD role. – Richard Seal Feb 28 at 18:46
  • Everytime I have had Post condition errors have been found to be caused by configuration errors with variable replacements, where something is not being transformed correctly, or bad character in variable. Advice is to CAREFULLY examine all configs touched. – Pete Navarra Feb 28 at 21:38

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.