Gravatar for naveen.simhadri467@gmail.com

Question by naveen, Aug 30, 2016 12:44 PM

Getting Error:Precondition failed: The parameter 'p_SearchIndex' must not be null Parameter name: p_SearchIndex from CD server

We are getting Precondition failed: The parameter 'pSearchIndex' must not be null Parameter name: pSearchIndex error on our CD server . We have indexed web database to coveo and from CD server we are using same index. However , we are getting exception. Any suggestions on how to get it resolved.

Stack trace:

[ArgumentNullException: Precondition failed: The parameter 'p_SearchIndex' must not be null
Parameter name: p_SearchIndex]
   Coveo.Framework.CNL.Precondition.NotNull(Object p_Parameter, String p_ParameterName) +286
   Coveo.UI.Expressions.ExpressionBuilderFactory.CreateBoostExpressionBuilder(ISearchIndex p_SearchIndex, IRulesHelper p_RulesHelper, ISitecoreHelper p_SitecoreHelper) +142
   Coveo.UI.Mvc.Models.SearchModel.get_BoostExpressions() +111
   Coveo.UI.Mvc.Models.SearchModelOptionsWriter.GetObjectToSerialize(ISearchModel p_Instance) +272
   Coveo.UI.Mvc.Models.BaseJavaScriptWriter`1.GetJavaScriptObject(T p_Instance) +234
   ASP._Page_Views_CoveoCustom_MyFeedView_cshtml.Execute() in e:\Website\Views\CoveoCustom\MyFeedView.cshtml:25
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +253
   System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +148
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +122
   System.Web.Mvc.Html.PartialExtensions.Partial(HtmlHelper htmlHelper, String partialViewName, Object model, ViewDataDictionary viewData) +137
   Sitecore.Mvc.Presentation.ViewRenderer.Render(TextWriter writer) +343

[InvalidOperationException: Error while rendering view: '/Views/CoveoCustom/MyFeedView.cshtml' (model: 'Coveo.UI.Mvc.Models.SearchModel, Coveo.UIBase').
]
   Sitecore.Mvc.Presentation.ViewRenderer.Render(TextWriter writer) +826
   Sitecore.Mvc.Pipelines.Response.RenderRendering.ExecuteRenderer.Render(Renderer renderer, TextWriter writer, RenderRenderingArgs args) +30
   Sitecore.Mvc.Pipelines.Response.RenderRendering.ExecuteRenderer.Process(RenderRenderingArgs args) +75
   (Object , Object[] ) +74
   Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +484
   Sitecore.Mvc.Pipelines.PipelineService.RunPipeline(String pipelineName, TArgs args) +184
   Sitecore.Mvc.Pipelines.Response.RenderPlaceholder.PerformRendering.Render(String placeholderName, TextWriter writer, RenderPlaceholderArgs args) +216
   (Object , Object[] ) +74
   Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +484
   Sitecore.Mvc.Pipelines.PipelineService.RunPipeline(String pipelineName, TArgs args) +184
   Sitecore.Mvc.Helpers.SitecoreHelper.Placeholder(String placeholderName) +259
   ASP._Page_Views_Common_TwoColumnPageSection_cshtml.Execute() in e:\Website\Views\Common\TwoColumnPageSection.cshtml:4
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +253
   System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +148
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +107
   System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +375
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +90
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +833
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +833
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +81
   System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +710
1 Reply
Gravatar for dberube@coveo.com

Answer by Dominic Berube, Aug 30, 2016 12:50 PM

Hi Naveen,

Make sure all Coveo for Sitecore items are correctly published.

Gravatar for naveen.simhadri467@gmail.com

Comment by naveen, Aug 30, 2016 2:49 PM

hello dberube,

Issue got solved. However I have added one more index representing publishing target of CM server (CD server web database). I am still wondering how coveo search provider picks index name during search operation among available indexes?

Gravatar for naveen.simhadri467@gmail.com

Comment by naveen, Oct 6, 2016 11:17 PM

I found my answer, coveo fetches first index that it was able to resolve based on Sitecontext.

Ask a question