How to debug solr exceptions/warnings for Alfresco (Part 1)

There are two kinds of solr error / warnings that I’ve seen a few times but never really investigated further. Now when in the process of migrating a big Alfresco installation from Lucene to Solr we had alot of errors and warnings that needed to be investigated and fixed.

Error/warning 1:

2015-04-28 16:11:35,532 WARN  [org.alfresco.solr.tracker.CoreTracker] Node index failed and skipped for 4777625 in Tx 9223372036854775807
java.net.SocketTimeoutException: Read timed out
       at java.net.SocketInputStream.socketRead0(Native Method)
        at java.net.SocketInputStream.read(SocketInputStream.java:152)
        at java.net.SocketInputStream.read(SocketInputStream.java:122)
        at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)
        at java.io.BufferedInputStream.read(BufferedInputStream.java:254)
        at org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java:78)
        at org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:106)
        at org.apache.commons.httpclient.HttpConnection.readLine(HttpConnection.java:1116)
        at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.readLine(MultiThreadedHttpConnectionManager.java:1413)
        at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:1973)
        at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1735)
        at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1098)
        at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398)
        at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
        at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
        at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323)
        at org.alfresco.httpclient.AbstractHttpClient.executeMethod(AbstractHttpClient.java:135)
        at org.alfresco.httpclient.AbstractHttpClient.sendRemoteRequest(AbstractHttpClient.java:111)
        at org.alfresco.httpclient.HttpClientFactory$DefaultHttpClient.sendRequest(HttpClientFactory.java:393)
        at org.alfresco.solr.client.SOLRAPIClient.getTextContent(SOLRAPIClient.java:992)
        at org.alfresco.solr.tracker.CoreTracker.addContentPropertyToDoc(CoreTracker.java:2980)
        at org.alfresco.solr.tracker.CoreTracker.indexNode(CoreTracker.java:2568)
        at org.alfresco.solr.tracker.CoreTracker.reindexNodes(CoreTracker.java:1057)
        at org.alfresco.solr.tracker.CoreTracker.updateIndex(CoreTracker.java:566)
        at org.alfresco.solr.tracker.CoreTrackerJob.execute(CoreTrackerJob.java:45)
        at org.quartz.core.JobRunShell.run(JobRunShell.java:216)
        at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:563)

Error/warning 2:

2015-04-28 15:02:50,413 WARN  [org.alfresco.solr.tracker.CoreTracker] Node index failed and skipped for 6899573 in Tx 9223372036854775807
org.json.JSONException: Unterminated string at character 1866
        at org.json.JSONTokener.syntaxError(JSONTokener.java:413)
        at org.json.JSONTokener.nextString(JSONTokener.java:244)
        at org.json.JSONTokener.nextValue(JSONTokener.java:344)
        at org.json.JSONObject.(JSONObject.java:206)
        at org.json.JSONTokener.nextValue(JSONTokener.java:347)
        at org.json.JSONArray.(JSONArray.java:125)
        at org.json.JSONTokener.nextValue(JSONTokener.java:351)
        at org.json.JSONObject.(JSONObject.java:206)
        at org.alfresco.solr.client.SOLRAPIClient.getNodesMetaData(SOLRAPIClient.java:774)
        at org.alfresco.solr.tracker.CoreTracker.indexNode(CoreTracker.java:2376)
        at org.alfresco.solr.tracker.CoreTracker.reindexNodes(CoreTracker.java:1057)
        at org.alfresco.solr.tracker.CoreTracker.updateIndex(CoreTracker.java:566)
        at org.alfresco.solr.tracker.CoreTrackerJob.execute(CoreTrackerJob.java:45)
        at org.quartz.core.JobRunShell.run(JobRunShell.java:216)
        at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:563)

This first part of the guide will cover the first error/warning.

This particular error comes from a timeout when Alfresco is trying to extract text content from the document. Possible causes could be a slow transformation or high load on the system. So the place to start would be to just increase the timeout in solr so that it waits around a bit longer for a response. This is done by modifying the SOLR_HOME/workspace-SpacesStore/conf/solrcore.properties and SOLR_HOME/archive-SpacesStore/conf/solrcore.properties.

The setting to look for is: alfresco.socketTimeout. Default value is 60 seconds (60000). Increase it to a level suitable for your installation such as alfresco.socketTimeout=240000 for 4 minutes timeout.

Some times increasing the timeout does not help and you see that Alfresco is working hard to serve the request. Then you might have to do with a corrupt document or a document which is too large to effectively export text content from.

Part 2 of this guide will contain information about the other error/warning. In it you will also get some tips on how to get more information about a failed index request.

How to debug solr exceptions/warnings for Alfresco (Part 2)
How to debug solr exceptions/warnings for Alfresco (Part 3)

This entry was posted in Alfresco, Solr. Bookmark the permalink.

3 Responses to How to debug solr exceptions/warnings for Alfresco (Part 1)

  1. Lepsofts says:

    Fantastic website content. Just what I ended up being looking for!
    All the best,
    ps
    Check out your fresh SE position at type in google lepsoft RankChecker

  2. thanks for sharing bro

  3. Thomas says:

    Great post! Have nice day ! :) u1uix

Leave a Reply to Thomas Cancel reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>