0

In Sitecore (9.1) processing server's logs, I could see the following error:

Exception: System.Reflection.TargetInvocationException
Message: Exception has been thrown by the target of an invocation.
Source: mscorlib
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Sitecore.Reflection.ReflectionUtil.InvokeMethod(MethodInfo method, Object[] parameters, Object obj)
   at Sitecore.Tasks.CommandItem.Execute(Item[] items, ScheduleItem schedule) 
  
Nested Exception 
  
Exception: System.InvalidOperationException
Message: Could not find configuration node: contentSearch/configuration
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.ContentSearch.ContentSearchManager.get_SearchConfiguration()
   at Sitecore.ContentSearch.ContentSearchManager.GetIndex(String name)
   at Sitecore.ContentTesting.Tasks.RebuildIndex.Process(Item[] items, CommandItem command, ScheduleItem schedule)


Could anyone please let me know what's the issue here and how to solve it?
6
  • Does this help? community.sitecore.com/… Commented Dec 29, 2022 at 14:12
  • Hi @SumitBhatia, I checked that link already, but couldn't find the root cause.
    – GVK
    Commented Dec 29, 2022 at 14:22
  • Did you enable the config SwitchMasterToWeb.config? Commented Dec 29, 2022 at 14:28
  • No. This is occurring only in prod server and lower environments are not throwing this error.
    – GVK
    Commented Dec 29, 2022 at 14:38
  • The initial task in the stack trace is 'RebuildIndex'. Do you have the "Indexing" sub role configured to run on processing server? If so, I think it may need to be paired with CM. Other than that, check all SOLR configs and ensure there are no crawlers pointing to databases that dont have a defined connection string. Seem to recall seeing that error on CD server if reference to master DB is accidentally left in config. Commented Jan 1, 2023 at 20:18

2 Answers 2

0

Rather than continuing in comments, will try and provide some points to check here.

As per my comment, I believe you may have slight mis configuration in roles. As first suggestion please make sure processing server has:

<AppSettings>
<add key="role:define" value="Processing"/>
</AppSettings>

Then on only one content management:

<AppSettings>
<add key="role:define" value="ContentManagement, Indexing"/>
</AppSettings>

This should ensure the rebuild index task is performed on an instance that has access to both Web and master databases.

I believe the reason for the exception is because your processing server is trying to rebuild an index that requires a database it doesn't have access to.

For example, if one of your solr configuration (web_index) has a crawler which points to the Web database and the instance can't access it, then the task will fail when initialising.

Update

Further to comments it seems indexing sub role was introduced in sitecore 9.2. In 9.1 I believe task is picked up by any available instance.

You have two options, either disable the worker that performs rebuild task on the processing server. Or add the necessary connection strings to the processing server.

Please ensure master and Web conn strings are available in connectionstrings.config on processing instance and see if the error stops.

Update

Further to your recent comments. In order to disable indexing job on provessing server, i believe you should just be able to set the update strategy to manual.

Please try adding patch for all indexes that includes line as below:

<strategy ref="contentSearch/indexConfigurations/indexUpdateStrategies/manual" />

Your patch files should sit in a sub folder of: <root>/app_config/includes/. I normally put all in folder call "z.custom".

4
  • Thanks @Dean OBrien for the response. However, according to comments on CM web.config, supported roles are ContentDelivery, ContentManagement, Processing, Reporting and Standalone only. There is no Indexing role. Will it still support, if we update? Also, as this is happening only in Prod Processing server, any idea why it is not happening on lower envs like QA / DEV? Note: QA has same set of servers and configurations similar to Prod. Few more details might help in convincing the team for making such change on prod. Any help is much appreciated.
    – GVK
    Commented Jan 2, 2023 at 17:01
  • Apologies it seems the indexing sub role was only introduced in sitecore 9.2 (and you are on 9 1) doc.sitecore.com/xp/en/developers/92/… that being the case, n previous versions I think the rebuild index task can therefore be picked up by any available (Ie CM or processing). This would explain why you didn't see erro in other environment, just luck that in those environments the CM picked up task. See update above for recommendation Commented Jan 2, 2023 at 17:28
  • Apologies for the delayed response. Master conn string was already present, added Web conn string but the error still persists. Can you please let me know how to disable to worker in Processing server? Also, I created a temporary ShowConfig.aspx and placed under root, up on accessing it, I could see that patch files from root\Sitecore\App_Config are not appearing (as role:require is set to Standalone or ContentManagement or ContentDelivery) in ShowConfig and hence it is not able to find contentSearch\Configuration node.
    – GVK
    Commented Jan 13, 2023 at 12:27
  • Think you should be able to just set update strategy to manual. See update Commented Jan 13, 2023 at 13:42
0

Thanks @Dean OBrien for your responses.

We raised a ticket with Sitecore and got the below response. To resolve the issue, please edit the /App_Config/Sitecore/CMS.Core/Sitecore.Processing.config file and change the following line

from:

<sitecore role:require="Standalone or ContentManagement or Processing">

to:

<sitecore role:require="Standalone or ContentManagement">

This seems to me that on processing servers the agents are being disabled. Once we changed that, we are no more seeing the error in the log file.

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.