Symptom:
The CD Server is logging errors because the Sitecore Connector is trying to locate the “database” master, but this “ConnectionString” does not exist on a CD Server and therefore the connector is throwing an error.
Sitecore Connect for Content Hub XP for 9.1.1 v. 3.1.0 rev. 00188
Sitecore Version 9.1.1
On the Log message we will see the following error ( full error message at the end of article)

When we decompile the DLL, we are able to identify the issue. This allows us to gain a deeper understanding of the problem and come up with a solution. Decompiling the DLL provided us with valuable insights that would not be possible without this step

Solution:
Create a Patch, to override the processor, , in this way , replacing the method with Issue “GetLabels” with a customized one, with the fix
Exception: System.InvalidOperationException
Message: Could not find configuration node: databases/database[@id='master']
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.Connector.ContentHub.DAM.Pipelines.RenderField.GetMImageRenderField.GetLabels()
at Sitecore.Connector.ContentHub.DAM.Pipelines.RenderField.GetMImageRenderField.Process(RenderFieldArgs args)
at (Object , Object )
at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
at Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain, Boolean failIfNotExists)
at Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain)
at Sitecore.LayoutService.Serialization.FieldRenderer.RenderField(Field field, Boolean disableExperienceEditorRendering)
at Sitecore.LayoutService.Serialization.FieldSerializers.BaseFieldSerializer.RenderField(Field field, Boolean disableEditing)
at Sitecore.LayoutService.Serialization.FieldSerializers.ImageFieldSerializer.GetRenderedValue(Field field, SerializationOptions options)
at Sitecore.LayoutService.Serialization.FieldSerializers.ImageFieldSerializer.WriteValue(Field field, JsonTextWriter writer)
at Sitecore.LayoutService.Serialization.FieldSerializers.BaseFieldSerializer.Serialize(Field field, JsonTextWriter writer)
at Sitecore.JavaScriptServices.GraphQL.JssExtender.SerializeField(Field field, IGetFieldSerializerPipeline getFieldSerializerPipeline)
at GraphQL.Resolvers.FuncFieldResolver`2.GraphQL.Resolvers.IFieldResolver.Resolve(ResolveFieldContext context)
at GraphQL.Execution.ExecutionStrategy.d__7.MoveNext()
Creating the Sitecore Patch
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:set="http://www.sitecore.net/xmlconfig/set/">
<sitecore>
<pipelines>
<StylelabsSiteId>
</StylelabsSiteId>
<renderField>
<processor patch:after="processor[@type='Sitecore.Connector.ContentHub.DAM.Pipelines.RenderField.GetMImageRenderField, Sitecore.Connector.ContentHub.DAM']" type="SC.MyProject.Org.Website.ContentHub.GetMImageRenderField, SC.MyProject.Org.Website"/>
</renderField>
</pipelines>
</sitecore>
</configuration>
You must be logged in to post a comment.