I have both Solr 7.2.1 with port 8983 and Solr 6.6.2 with port 8984 on my machine. My 9.1 instance is using solr 7.2.1 and working fine. But my Solr 6.6.2 for Sitecore 9.0.2, is showing this error.

enter image description here

Server Error in '/' Application.

Data at the root level is invalid. Line 1, position 1.
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.Xml.XmlException: Data at the root level is invalid. Line 1, position 1.

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: 

[XmlException: Data at the root level is invalid. Line 1, position 1.]
   System.Xml.XmlTextReaderImpl.Throw(Exception e) +91
   System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace() +408
   System.Xml.XmlTextReaderImpl.ParseDocumentContent() +487
   System.Xml.Linq.XDocument.Load(XmlReader reader, LoadOptions options) +60
   System.Xml.Linq.XDocument.Parse(String text, LoadOptions options) +156
   SolrNet.Impl.SolrCoreAdmin.SendAndParseHeader(ISolrCommand cmd) +40
   Sitecore.ContentSearch.SolrProvider.SolrNetIntegration.SolrPinger.Ping() +32
   Sitecore.ContentSearch.SolrProvider.SolrConnectors.SolrConnector.TestConnection() +70
   Sitecore.ContentSearch.SolrProvider.SolrStatus.OkSolrStatus() +99
   Sitecore.ContentSearch.SolrProvider.SolrStatus..cctor() +72

[TypeInitializationException: The type initializer for 'Sitecore.ContentSearch.SolrProvider.SolrStatus' threw an exception.]
   Sitecore.ContentSearch.SolrProvider.SolrStatus.SetIndexForInitialization(ISearchIndex solrIndex) +0
   Sitecore.ContentSearch.SolrProvider.SolrSearchIndex.SetForReinitialization() +202
   Sitecore.ContentSearch.SolrProvider.SolrSearchIndex.InitializeSolr() +190
   Sitecore.ContentSearch.SolrProvider.SolrSearchIndex.Initialize() +46
   Sitecore.ContentSearch.SolrProvider.SolrContentSearchManager.Initialize() +169
   (Object , Object ) +9
   Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +484
   Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain, Boolean failIfNotExists) +236
   Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain) +22
   Sitecore.Nexus.Web.HttpModule.Application_Start() +161
   Sitecore.Nexus.Web.HttpModule.Init(HttpApplication app) +767
   System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +581
   System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +168
   System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +277
   System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +369

[HttpException (0x80004005): The type initializer for 'Sitecore.ContentSearch.SolrProvider.SolrStatus' threw an exception.]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +532
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +111
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +714
  • 1
    I'm not sure it's very clear, so you moved your Solr6.6.2 cores to another instance of Solr with version 7.2.1, and now Sitecore is not working with Solr 7.2.1??? – TamerM Dec 2 '18 at 12:12
  • Sitecore 9.0.x is behaving strange and showing that issue. however Sitecore 9.1 works good with 7.2.1. You can assume that the issue is backward compatibility – Sitecore Sam Dec 2 '18 at 12:28
  • 1
    Regardless of the Sitecore version you're using, I don't think you can moving cores between Solr version. Each version has its differences and new properties/elements that other versions may not understand. I think there are upgrade articles to help you edit the cores before you can move them – TamerM Dec 2 '18 at 16:20
  • 2
    OK but you said you manually moved the cores from Solr6.6.2 to Solr7.2.1, right? If that's the case I don't think that is the correct way of doing it? By the way, when you open Solr dashboard, do you see all the cores loaded and do you see any errors? – TamerM Dec 2 '18 at 16:48
  • 1
    I am fairly confident the schema definition changed in 7. Can't copy core data between versions. I would recommend just rebuilding the indexes. – Pete Navarra Dec 2 '18 at 17:29

Solr 6.6.2 and Solr 7.2.1 schema definitions are not compatible. There were some breaking changes introduced in Solr 7 -> more details here.

Second problem was that you were trying to run both Solr servers on same 8983 port. This is not supported. You need to have one on port 8983 (default) and the other on other port e.g. 8984. Or to distinguish them better you can use 8622 port for Solr 6.2.2 and 8721 port for Solr 7.2.1

I recommend to have both Solr versions installed on your machine and create for each separate Windows service also to run it.

Then for each Sitecore version you will configure different Solr server: - For Sitecore 9 Update 2 instance you will use Solr 6.6.2 - For Sitecore 9.1 instance you will use Solr 7.2.1

This is perfectly fine setup and shouldn't be a problem to configure it with below scripts.

Jeremy Davis created really nice low effort Powershell script to install, configure SSL and create also windows service for Solr. You can find it here -> https://jermdavis.wordpress.com/2017/10/30/low-effort-solr-installs/ . By default it will install Solr 6.6.2 but you can easily modified that script to install also 7.2.1 version. I have already prepared that kind of script (for Solr 7.2.1 for Sitecore 9.1) here -> https://tothecore.sk/2018/11/28/sitecore-9-1-initial-release-installation-guide-for-development-machine

Just make sure that you have specified correct path to JRE before running script:

enter image description here

Also specify solrVersion, installFolder and solrPort parameters in that script.

After all these changes, just rebuild indexes on both instances and you should be fine.

  • 1
    You are right, the schemas are different in both versions of Solr, got it working on separate ports now. – Sitecore Sam Dec 5 '18 at 7:58

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.