2

Im currently working on getting a existing Sitecore 8.2 Habitat solution running on my system locally.

Anytime I go to routes like "/sitecore" or "/sitecore/admin/showconfig.aspx" I get the following error.

An index with the name "sitecore_analytics_index" have already been added.

Additional Information:

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.InvalidOperationException: An index with the name "sitecore_analytics_index" have already been added.

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: 


[InvalidOperationException: An index with the name "sitecore_analytics_index" have already been added.]
   Sitecore.Diagnostics.Assert.IsFalse(Boolean condition, String message) +81
   Sitecore.ContentSearch.ContentSearchConfiguration.AddIndex(ISearchIndex index) +182

[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) +210
   System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +146
   Sitecore.Configuration.DefaultFactory.AssignProperties(Object obj, Object[] properties) +836
   Sitecore.Configuration.DefaultFactory.AssignProperties(XmlNode configNode, String[] parameters, Object obj, Boolean assert, Boolean deferred, IFactoryHelper helper) +622
   Sitecore.Configuration.DefaultFactory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper) +320
   Sitecore.Configuration.DefaultFactory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert) +72
   Sitecore.Configuration.DefaultFactory.CreateObject(String configPath, String[] parameters, Boolean assert) +615
   Sitecore.ContentSearch.ContentSearchManager.get_SearchConfiguration() +262
   Sitecore.ContentSearch.SolrProvider.SolrContentSearchManager.get_Cores() +91
   Sitecore.ContentSearch.SolrProvider.SolrNetIntegration.DefaultSolrStartUp.Initialize() +251
   (Object , Object[] ) +71
   Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +469
   Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain) +22
   Sitecore.Nexus.Web.HttpModule.Application_Start() +255
   Sitecore.Nexus.Web.HttpModule.Init(HttpApplication app) +670
   System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +570
   System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +169
   System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +372
   System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +329

[HttpException (0x80004005): Exception has been thrown by the target of an invocation.]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +525
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +118
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +708

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

I'm running Sitecore 8.2 160729 with Solr 6.2.1

  • Find all the files in App_Config folder which contains sitecore_analytics_index content. There must be a duplicate definition somewhere – Marek Musielak Feb 8 at 19:13
  • Don’t forget that you can use the config generator present on SIM tool. It has saved my life several times... – Hugo Santos Feb 8 at 21:17
2

There were some Lucene files in my "~\Website\App_Config\Include" folder that needed to be disabled with disable files.

Disabled Lucene files

After disabling these files I was able to run the project locally.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.