Exception during Layout Service RenderItem - Could not find configuration node: databases/database[@id='core']
Had the following exception since core db was unreachable from cd instance as a result cd api host failed for any page using multilist. So, fixed the same as follows:
Exception:
8000 05:27:23 ERROR Exception during Layout Service RenderItem (configuration: default, item: {20D5306F-6FF1-4CD8-A82A-7668A5D2288F}) Exception: System.InvalidOperationException Message: Could not find configuration node: databases/database[@id='core'] 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.Web.UI.HtmlControls.Data.LookupSources.GetDatabase(String source) at Sitecore.Data.Fields.CustomField.GetDatabase() at Sitecore.Data.Fields.MultilistField.GetItems() at Sitecore.LayoutService.Serialization.FieldSerializers.MultilistFieldSerializer.WriteValue(Field field, JsonTextWriter writer) at Sitecore.LayoutService.Serialization.FieldSerializers.MultilistFieldSerializer.Serialize(Field field, JsonTextWriter writer) at Sitecore.LayoutService.Serialization.ItemSerializers.BaseItemSerializer.SerializeItem(Item item, SerializationOptions options) at Sitecore.LayoutService.Serialization.FieldSerializers.InternalLinkFieldSerializer.GetProperties(Item item, InternalLinkField field, Int32 depth) at Sitecore.LayoutService.Serialization.FieldSerializers.InternalLinkFieldSerializer.WriteValueObject(Item item, InternalLinkField field, JsonTextWriter writer, Int32 depth) at Sitecore.LayoutService.Serialization.FieldSerializers.InternalLinkFieldSerializer.WriteValue(Field field, JsonTextWriter writer) at Sitecore.LayoutService.Serialization.FieldSerializers.InternalLinkFieldSerializer.Serialize(Field field, JsonTextWriter writer) at Sitecore.LayoutService.Serialization.ItemSerializers.BaseItemSerializer.SerializeItem(Item item, SerializationOptions options) at Sitecore.LayoutService.Serialization.FieldSerializers.MultilistFieldSerializer.GetProperties(Item item, MultilistField field, Int32 depth) at Sitecore.LayoutService.Serialization.FieldSerializers.MultilistFieldSerializer.WriteValueObject(IEnumerable`1 items, MultilistField field, JsonTextWriter writer, Int32 depth) at Sitecore.LayoutService.Serialization.FieldSerializers.MultilistFieldSerializer.WriteValue(Field field, JsonTextWriter writer) at Sitecore.LayoutService.Serialization.FieldSerializers.MultilistFieldSerializer.Serialize(Field field, JsonTextWriter writer) at Sitecore.LayoutService.Serialization.ItemSerializers.BaseItemSerializer.SerializeItem(Item item, SerializationOptions options) at Sitecore.LayoutService.ItemRendering.LayoutService.Render(Item item, IRenderingConfiguration renderingConfiguration, RenderOptions renderOptions) at Sitecore.LayoutService.Mvc.Controllers.LayoutServiceController.RenderItem(String configuration, String item)
Solution:
Add core connection string to cd environment connectionstrings.config
Next, add a patch to cd instance under a folder from where you are sure the config will be deployed/patched to cd instance, since security in connectionstrings.config was pointing to core db, used the same in the patch(as highlighted below):
Sitecore.Core.ConnectionString.config
<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"
xmlns:role="http://www.sitecore.net/xmlconfig/role/"
xmlns:security="http://www.sitecore.net/xmlconfig/security/">
<sitecore>
<databases>
<database id="core" singleInstance="true" type="Sitecore.Data.DefaultDatabase, Sitecore.Kernel" role:require="ContentDelivery">
<param desc="name">security</param>
<connectionStringName>security</connectionStringName>
</database>
</databases>
</sitecore>
</configuration>
Comments
Post a Comment