Insights

The Mysterious p_Communication Error In Coveo

What Is It And How Do I Fix It?

What's The Error About?

If you're in a multi-developer environment or using the base admin user as the account for connecting to Coveo, you've likely encountered this error message before. It certainly comes across as a nasty error and one that doesn't describe the issue too terribly well, unfortunately. What error am I referring to? Let's have a look.


    Job started: Index_Update_IndexName=Coveo_master_index|#Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentNullException: Precondition failed: The parameter 'p_Communication' must not be null
Parameter name: p_Communication
    at Coveo.Framework.CNL.Precondition.NotNull(Object p_Parameter, String p_ParameterName)
    at Coveo.SearchProvider.AbstractProviderUpdateContext..ctor(ISearchIndexSummary p_IndexSummary, IIndexCommunication p_Communication)
    at Coveo.SearchProvider.ProviderUpdateContext..ctor(ISearchIndex p_Index, IIndexCommunication p_Communication)
    at Coveo.SearchProvider.ProviderIndex.CreateUpdateContext()
    at Coveo.SearchProvider.ProviderIndex.<Rebuild>b__83_0()
    at Coveo.SearchProvider.ProviderIndex.TryPerformIndexingOperation(IndexingOptions p_IndexingOptions, Action p_Action)
    at Coveo.SearchProvider.ProviderIndex.Rebuild()
    --- End of inner exception stack trace ---
    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.Jobs.JobRunner.RunMethod(JobArgs 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.Jobs.DefaultJob.DoExecute()
    at Sitecore.Abstractions.BaseJob.ThreadEntry(Object state)

When Does This Happen?

This error will generally show up in one of the following scenarios:

Rebuilding a Coveo index - You will find it either in your Sitecore logs or in Sitecore itself during a manual rebuild or re-index.

Publishing an item in Sitecore - Likely finding this in the logs when you don't see your item in the Coveo Index.

Pushing Security identities via Coveo Index Manager located within the Sitecore Control Panel

Field Cleanup via Coveo Index Manager located within the Sitecore Control Panel

How Do I Know This Is Happening?

Until you check the logs or see the error in question as part of a manual rebuild, you may not be aware of it. One symptom though, is when items fail to appear in the Coveo Cloud Index after an extended period of time. When this happens it's either due to errors in the indexing pipeline for the item in question or something related to configuration. Locating the most recent logs, forcing a re-index or publishing an item should show an error and point you in the right direction.

Ok, so how do I fix it?

The Solution

This error is quite simple to tackle. The key is identifying the Parameter that is having the issue p_Communication. It's not immediately obvious that a password is wrong or an account being locked that is the issue. But that is indeed what's happened. There are a couple of things we can do to resolve the issue in question.

Update Password Or Unlock The Administrator Account

It's never a good idea to use the sitecore/admin account but rather create a new account, e.g. sitecore/coveoadmin, that has Administrator rights. One of the reasons for this error is the Administrator account has been locked out by a user trying to log in with it. Once it's locked and Coveo uses it to push an item, the error will continue happening. It could also be that the account had it's password changed as part of routine maintenance, it was forgotten and reset and then was not updated within the Coveo Index Manager.

Accessing The Administrator Account In The Coveo Index Manager

Warning: If you go down this route keep in mind that by updating this password your instance will restart and you will have to copy the password stored in Coveo.SearchProvider.Custom.config located in App_Config/Include/Coveo and update any source code that you have it used. The lines in question being <sitecoreUsername> and <sitecorePassword>.

Setup For Multi-Developer Environment

One of the challenges of working in a multi-developer environment is ensuring when an account is used every developer is using the same account and password. When it comes to Coveo, though, it's not enough that the account and password are the same. The issue can also stem from having a different encryption key in each environment. We actually covered how to take this into account a few years back and routinely find ourselves setting this up. You can read it here: Deploying Coveo for Sitecore Cloud In Multiple Developer Environment.

Prevention

Don't take it personally. This issue is bound to happen to every developer or Sitecore Administrator at one point. It can be prevented through good practices such as using a different admin account for Coveo, synching developer environment encryption keys, and understanding what to do when you have to change passwords associated with Coveo.

👋 Hey Sitecore Enthusiasts!

Sign up to our bi-weekly newsletter for a bite-sized curation of valuable insight from the Sitecore community.

What’s in it for you?

  • Stay up-to-date with the latest Sitecore news
  • New to Sitecore? Learn tips and tricks to help you navigate this powerful tool
  • Sitecore pro? Expand your skill set and discover troubleshooting tips
  • Browse open careers and opportunities
  • Get a chance to be featured in upcoming editions
  • Learn our secret handshake
  • And more!
Sitecore Snack a newsletter by Fishtank Consulting
 

Meet David Austin

Development Team Lead | Sitecore Technology MVP x 3

📷🕹️👪

David is a decorated Development Team Lead with Sitecore Technology MVP and Coveo MVP awards, as well as Sitecore CDP & Personalize Certified. He's worked in IT for 25 years; everything ranging from Developer to Business Analyst to Group Lead helping manage everything from Intranet and Internet sites to facility management and application support. David is a dedicated family man who loves to spend time with his girls. He's also an avid photographer and loves to explore new places.

Connect with David