4

When I try to re-index my Sitecore 7 site using Solr. I get the following errors in the Solr log.

10232 09:10:03 WARN  Crawler : AddRecursive DoItemAdd failed - {550B5CEF-242C-463F-8ED5-983922A39863}
Exception: System.IO.IOException
Message: Unable to write data to the transport connection: An existing connection was forcibly closed by the remote host.
Source: System
   at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size)
   at System.Net.ConnectStream.InternalWrite(Boolean async, Byte[] buffer, Int32 offset, Int32 size, AsyncCallback callback, Object state)
   at System.Net.ConnectStream.Write(Byte[] buffer, Int32 offset, Int32 size)
   at SolrNet.Impl.SolrConnection.CopyTo(Stream input, Stream output)
   at SolrNet.Impl.SolrConnection.PostStream(String relativeUrl, String contentType, Stream content, IEnumerable`1 parameters)
   at SolrNet.Impl.SolrConnection.Post(String relativeUrl, String s)
   at SolrNet.Impl.SolrBasicServer`1.SendAndParseHeader(ISolrCommand cmd)
   at Sitecore.ContentSearch.SolrProvider.SolrBatchUpdateContext.AddRange(IEnumerable`1 group, Int32 groupSize)
   at Sitecore.ContentSearch.SolrProvider.SolrBatchUpdateContext.AddDocument(Object itemToAdd, IExecutionContext[] executionContexts)
   at Sitecore.ContentSearch.SitecoreItemCrawler.DoAdd(IProviderUpdateContext context, SitecoreIndexableItem indexable)
   at Sitecore.ContentSearch.HierarchicalDataCrawler`1.CrawlItem(Tuple`3 tuple)

Nested Exception

Exception: System.Net.Sockets.SocketException
Message: An existing connection was forcibly closed by the remote host
Source: System
   at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size)

Any ideas why this would be happening?

Wesley Lomax
  • 2,067
  • 2
  • 20
  • 34
Corey Burnett
  • 7,312
  • 10
  • 56
  • 93
  • The exception you pasted is from the Sitecore logs. Do you see anything in Solr logs? – Marek Musielak Feb 18 '15 at 15:11
  • 1
    Check your Solr instance is running on the correct port. Also check your URL to the Solr instance is configured properly in the Sitecore.ContentSearch.Solr.Indexes.config. Any leading slashes should be removed from the URL. – Ian Graham Feb 18 '15 at 20:00
  • From what I can tell the URL to the Solr instance is configured properly. It is set to http://localhost:8983/solr. And the strange thing is that I am able to index most of my content. I can index thousands of items, but I get like 5 of these errors in my Sitecore logs. – Corey Burnett Feb 27 '15 at 18:48
  • @MarekMusielak - where can I find the Solr logs? In the Solr web interface there is a logging screen. All I see there is about 6 exceptions that are complaingin about an unknown field. It's strange, each of those 6 exceptions are talking about an unknown field in the Chinese language. Very strange. – Corey Burnett Feb 27 '15 at 18:52
  • Looking at your solr server port number (8983), I'm guessing you're running it on jetty, just by starting 'java -jar ...' command. If you don't pipe the output to log file, you can see logs on the console only. If you pipe all the results to the text file, you should see the location of the file in the script which is used to start solr. – Marek Musielak Feb 27 '15 at 18:56
  • I have no idea what jetty is. I think I am running it on Tomcat. – Corey Burnett Feb 27 '15 at 19:26
  • Jetty is a web server like Tomcat. I suspect this exception might indicate throttling on the part of Sitecore or SOLR. – Kenny Evitt Apr 21 '15 at 20:02
  • have you got any solution for this Corey? I am also facing the same issue with index-rebuilding using solr. – Gaurav Agarwal Jun 03 '15 at 10:36
  • No, I have not figured out any solution for this. I continue to see a few of these errors in the logs. – Corey Burnett Jun 03 '15 at 10:38

1 Answers1

3

Try loooking at your solr logs for any Errors coming from the SolrCore by browsing - http://yoursolrinstance/solr/#/~logging

I found that Solr was having an issue with fields generated from the dynamicField type.

Solr in my instance was looking for 'myfieldname_t_cs' and throwing and 'unknown field' exception for items in the cs-CZ language.

The dynamic field defination in the solr schema.xml has a field defined <dynamicField name="*_t_cz" type="text_cz" indexed="true" stored="true" />but not one with mapping the _cs suffix so I added that <dynamicField name="*_t_cs" type="text_cz" indexed="true" stored="true" /> restarted Tomcat and rebuilt my indexes and that error cleared.

I also have Solr errors about Polish content as this is language region information is not defined at all and Norway where the field is defined in the schema.xml as <dynamicField name="*_t_no" type="text_no" indexed="true" stored="true" />but solr is searching for the suffix '*_nb' eg unknown field 'id_t_nb' and throwing a unknown field exception.

There seems to be a problem with the way Sitecore and Solr are mapping languages for using the Region Info I will raise a ticket with Sitecore support and update the answer when I get a response.

You mention Chinese in your errors could be that Chinese is not defined in Solr but you have some content in Sitecore in that language.

Update

Sitecore have confirmed this behaviour as a bug

I have found that when generating search schema and updating indexes different attributes are used (the name of language and culture). I will register this behavior as a bug and register a wish to implement a full support of the languages that are supported in SOLR by default.

Wesley Lomax
  • 2,067
  • 2
  • 20
  • 34
  • Do you have a link to the bug report, so I could track this? Any way this can be fixed in a managed schema situation? – wensveen Nov 01 '18 at 12:51