• RDA

Coveo V5 Analytics Error

David Ruckman, Senior Consultant


If you get a 500 error on calls to /coveo/rest/v6/analytics/searches, then this post is for you. Here's a quick fix for this obscure Coveo Analytics Events error.


THE PROBLEM:


I ran into this with a Sitecore 9.1 project using Coveo V5. I was using the "Coveo Send Analytics to Sitecore" Hive component on my search pages.


When I browsed to a search page on the Content Delivery I noticed an error when inspecting with Chrome developer tools:


1/coveo/rest/v6/analytics/searches - 500 application error


...and also several instances of...


1Uncaught (in promise) Cancelling current pending query


After enabling debugging I browsed directly to the "searches" API to get a more detailed error message:


Server Error in '/' Application. Precondition failed: The parameter 'p_SearchEvents' must not be null Parameter name: p_SearchEvents Description: An unhandled exception occurred.


Exception Details: System.ArgumentNullException: Precondition failed: The parameter 'p_SearchEvents' must not be null Parameter name: p_SearchEvents


Source Error:


An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace:

[ArgumentNullException: Precondition failed: The parameter 'p_SearchEvents' must not be null Parameter name: p_SearchEvents] Coveo.Framework.CNL.Precondition.NotNull(Object p_Parameter, String p_ParameterName) +208 Coveo.Framework.CNL.Precondition.NotEmpty(String p_Parameter, String p_ParameterName) +47 Coveo.UI.Rest.Controllers.AnalyticsController.Searches(String p_ApiVersion, String p_SearchEvents) +292 lambda_method(Closure , ControllerBase , Object[] ) +143 System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +35 System.Web.Mvc.Async.<>c.<BeginInvokeSynchronousActionMethod>b__9_0(IAsyncResult asyncResult, ActionInvocation innerInvokeState) +39 System.Web.Mvc.Async.WrappedAsyncResult`2.CallEndDelegate(IAsyncResult asyncResult) +77 System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) +42 System.Web.Mvc.Async.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__11_0() +72 System.Web.Mvc.Async.<>c__DisplayClass11_1.<InvokeActionMethodFilterAsynchronouslyRecursive>b__2() +387 System.Web.Mvc.Async.<>c__DisplayClass11_1.<InvokeActionMethodFilterAsynchronouslyRecursive>b__2() +387 System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) +42 System.Web.Mvc.Async.<>c__DisplayClass3_6.<BeginInvokeAction>b__3() +50 System.Web.Mvc.Async.<>c__DisplayClass3_1.<BeginInvokeAction>b__5(IAsyncResult asyncResult) +39


THE SOLUTION:


Analytics were clearly not working because of this error. I found this article on the Coveo support site which gave me something to try, and ultimately led me to a solution.


You can read the full article by clicking here.

RDA Corporation
NEW YORK NY | PHILADELPHIA PA |  BALTIMORE MD |  RESTON VA |  WASHINGTON DC 
 RICHMOND VA  |  WILMINGTON DE |  CHARLOTTE NC  |  RALEIGH NC  |  ATLANTA GA