Gravatar for nicolas.a.slavik@accenture.com

Question by yonico, Jan 8, 2015 8:39 AM

Coveo Search REST Endpoint () The remote server returned an error: (500) Internal Server Error.

Coveo is having the following error when loading the page. "Oops! Something went wrong on the server". I checked the diagnostic tool and says "Coveo Search REST Endpoint () The remote server returned an error: (500) Internal Server Error."

With the developer tool shows:

Server Error in '/' Application.


Object reference not set to an instance of an object. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

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: [NullReferenceException: Object reference not set to an instance of an object.] Coveo.Framework.Utils.SitecoreContextWrapper.GetCurrentDatabase() +115 Coveo.UI.Helpers.SitecoreHelper.GetSearchIndex() +127 Coveo.SearchProvider.Rest.SitecoreRestHttpHandler.GetSecurityProviderName() +69 Coveo.SearchProvider.Rest.SitecoreRestHttpHandler.OnInitializeSettings() +312 Coveo.Search.Api.Proxy.ProxyHttpHandler.OnInitialize() +57 Coveo.Search.Api.Proxy.ProxyHttpHandler.EnsureInitialized() +139 Coveo.Search.Api.Proxy.ProxyHttpHandler.ProcessRequest(HttpContext context) +77 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +912 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +164


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34009

What can I do with the error above?

2 Replies
Gravatar for nicolas.a.slavik@accenture.com

Answer by yonico, Jan 8, 2015 10:06 AM

I removed the /coveo and seems to remain the error. -->

Server Error in '/' Application.

Value cannot be null. Parameter name: key

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentNullException: Value cannot be null. Parameter name: key

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: Value cannot be null. Parameter name: key] System.Collections.Generic.Dictionary`2.FindEntry(TKey key) +14370237 Sitecore.ContentSearch.ContentSearchManager.GetIndex(String name) +51 Sitecore.ContentSearch.Client.Pipelines.Search.SearchContentSearchIndex.Process(SearchArgs args) +394 (Object , Object[] ) +83 Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +291 Sitecore.Search.XpathQuerySearcher.SelectItems(String query, Database database) +294 Sitecore.Data.Database.SelectItems(String query) +124 Sitecore.Shell.Applications.WebEdit.Commands.OpenMyItems.GetHeader(CommandContext context, String header) +189 Sitecore.Web.UI.WebControls.Ribbons.Ribbon.FillParamsFromCommand(CommandContext commandContext, RibbonCommandParams ribbonCommandParams) +166 Sitecore.Web.UI.WebControls.Ribbons.Ribbon.GetCommandParameters(Item controlItem, CommandContext commandContext) +83 Sitecore.Web.UI.WebControls.Ribbons.Ribbon.RenderSmallButton(HtmlTextWriter output, Item button, CommandContext commandContext) +82 Sitecore.Web.UI.WebControls.Ribbons.Ribbon.RenderButton(HtmlTextWriter output, Item button, CommandContext commandContext) +709 Sitecore.Web.UI.WebControls.Ribbons.Ribbon.RenderChunk(HtmlTextWriter output, Item chunk, CommandContext commandContext) +331 Sitecore.Web.UI.WebControls.Ribbons.Ribbon.RenderChunk(HtmlTextWriter output, Item chunk, CommandContext commandContext, Boolean isContextual, String id) +205 Sitecore.Web.UI.WebControls.Ribbons.Ribbon.RenderChunk(HtmlTextWriter output, Item chunk, CommandContext commandContext, Boolean isContextual) +237 Sitecore.Web.UI.WebControls.Ribbons.Ribbon.RenderChunks(HtmlTextWriter output, Item strip, CommandContext commandContext, Boolean isContextual) +437 Sitecore.Web.UI.WebControls.Ribbons.Ribbon.RenderStrips(HtmlTextWriter output, Item ribbon, Boolean isContextual, ListString visibleStripList) +801 Sitecore.Web.UI.WebControls.Ribbons.Ribbon.RenderStrips(HtmlTextWriter output, Item defaultRibbon, Item contextualRibbon, ListString visibleStripList) +213 Sitecore.Web.UI.WebControls.Ribbons.Ribbon.Render(HtmlTextWriter output) +608 System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +150 Sitecore.Web.HtmlUtil.RenderControl(Control ctl) +75 Sitecore.Shell.Applications.WebEdit.WebEditRibbonForm.RenderRibbon(Item item) +604 Sitecore.Shell.Applications.WebEdit.WebEditRibbonForm.OnLoad(EventArgs e) +1236

[TargetInvocationException: Exception has been thrown by the target of an invocation.] System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0 System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) +76 System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +211 System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) +35 Sitecore.Web.UI.Sheer.ClientPage.OnLoad(EventArgs e) +337 System.Web.UI.Control.LoadRecursive() +71 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3178

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34009

Gravatar for lbergeron@coveo.com

Comment by Luc Bergeron, Jan 8, 2015 10:16 AM

From what I see, Sitecore cannot find the search index it is looking for. I would suggest to run the "ShowConfig.aspx" page (http://yourSitecoreInstance/sitecore/admin/showconfig.aspx) and check the element "/sitecore/contentSearch/configuration/indexes" to see which search indexes are configured. It may gives you a hint on what's going on. If Coveo for Sitecore is enabled, you should find these 3 indexes:

  • sitecoremasterindex
  • Coveowebindex
  • Coveocodeindex

Hope this helps.

Gravatar for nicolas.a.slavik@accenture.com

Comment by yonico, Jan 8, 2015 11:42 AM

I found the 3 of them. I also see this tag with Lucene. Lucene_30 This is odd because I renamed all config files that has lucene and left the one of coveo without example. Something else that called my attention is that was working and suddenly started with issues.

Gravatar for lbergeron@coveo.com

Comment by Luc Bergeron, Jan 8, 2015 11:57 AM

It is strange indeed. In the "ShowConfig" output, you can see from which include file the settings are patched. I suggest to compare the output of the "ShowConfig.aspx" with the content of the "Coveo.SearchProvider.config" file. Try to see if some include file is altering the search index configuration.

Did you try to rebuild the indexes from Sitecore? Does the "Indexing Manager" shows the expected search indexes?

Gravatar for jflheureux@coveo.com

Comment by Jean-François L'Heureux, Jan 9, 2015 11:33 AM

The Lucene analyzer is from the web.config itself and is not harmful. It should be left there. This issue has the same root cause as your other question : https://answers.coveo.com/questions/1853/oops-something-went-wrong-on-the-server-server-error-in-application?page=1&focusedAnswerId=1861#1861

We'll continue the troubleshooting in the other question.

Gravatar for lbergeron@coveo.com

Answer by Luc Bergeron, Jan 8, 2015 9:02 AM

Hi,

It looks like the Sitecore.Context.Database is null for some reason. You can check the value of the "IgnoreUrlPrefixes" in the "web.config". It MUST NOT contain "/coveo" or "/coveo/rest" paths.

You can also call the "ShowConfig.aspx" page to make sure that this setting is not patched by an include file somewhere.

Hope this helps.

Gravatar for jflheureux@coveo.com

Comment by Jean-François L'Heureux, Jan 8, 2015 9:23 AM

https://developers.coveo.com/display/SC201501/Internal+Server+Error+When+Querying+the+REST+Service

Ask a question