cancel
Showing results for 
Search instead for 
Did you mean: 

ConnectException from Solr

nobby
Champ on-the-rise
Champ on-the-rise
Hi all,

this exception fills catalina.out since it is thrown by a scheduled job:


java.net.ConnectException: Connection refused
   at java.net.PlainSocketImpl.socketConnect(Native Method)
   at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
   at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
   at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
   at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
   at java.net.Socket.connect(Socket.java:525)
   at com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:550)
   at com.sun.net.ssl.internal.ssl.SSLSocketImpl.<init>(SSLSocketImpl.java:394)
   at com.sun.net.ssl.internal.ssl.SSLSocketFactoryImpl.createSocket(SSLSocketFactoryImpl.java:123)
   at org.alfresco.encryption.ssl.AuthSSLProtocolSocketFactory.createSocket(AuthSSLProtocolSocketFactory.java:168)
   at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707)
   at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.open(MultiThreadedHttpConnectionManager.java:1361)
   at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387)
   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:133)
   at org.alfresco.httpclient.AbstractHttpClient.sendRemoteRequest(AbstractHttpClient.java:85)
   at org.alfresco.httpclient.HttpClientFactory$HttpsClient.sendRequest(HttpClientFactory.java:307)
   at org.alfresco.solr.client.SOLRAPIClient.getModelsDiff(SOLRAPIClient.java:982)
   at org.alfresco.solr.tracker.CoreTracker.trackModels(CoreTracker.java:1405)
   at org.alfresco.solr.tracker.CoreTracker.trackRepository(CoreTracker.java:1127)
   at org.alfresco.solr.tracker.CoreTracker.updateIndex(CoreTracker.java:481)
   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:549)

Any ideas how to resolve it? I run a Tomcat SSL connector on port 18443, the SSL connection works.

I updated the solr port in alfesco-global.properties, no idea if this makes sense though:


### Solr indexing ###
index.subsystem.name=solr
dir.keystore=${dir.root}/keystore
solr.port=18443

Thanks in advance for any suggestions!

Best regards,
Andreas
15 REPLIES 15

fstnboy
Champ on-the-rise
Champ on-the-rise
Not sure if this has anything to do with the issue but if I connect via JMX and go to Alfresco–>Configuration–>Search, I can see that all the attributes corresponding to tracker.alfresco.* and tracker.archive.* say Unavailable

fstnboy
Champ on-the-rise
Champ on-the-rise
Moving up!

Anyone with the same problem with the Enterprise Beta version?
Any help?

Thanks?

janv
Employee
Employee
Have you tried contacting Alfresco Support (since you're using Enterprise 4.0 Beta) ?

Regards,
Jan

fstnboy
Champ on-the-rise
Champ on-the-rise
I did but still waiting….

imisan
Champ in-the-making
Champ in-the-making
It seems that we have same problem. Using Alfresco Enterprise 4.0.0 wtih default SOLR enabled. We found that if there is more than 5 min delay between two search queries SOLR throws org.alfresco.repo.search.impl.lucene.LuceneQueryParserException which is caused by some SocketException. Partial stack trace is here:
   … 30 more
Caused by: org.alfresco.repo.search.impl.lucene.LuceneQueryParserException: 02110073
   at org.alfresco.repo.search.impl.solr.SolrQueryHTTPClient.executeQuery(SolrQueryHTTPClient.java:364)
   at org.alfresco.repo.search.impl.solr.SolrQueryLanguage.executeQuery(SolrQueryLanguage.java:49)
   at org.alfresco.repo.search.impl.solr.SolrSearchService.query(SolrSearchService.java:348)
   at org.alfresco.repo.search.SearcherComponent.query(SearcherComponent.java:78)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.alfresco.repo.management.subsystems.SubsystemProxyFactory$1.invoke(SubsystemProxyFactory.java:65)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
   at $Proxy14.query(Unknown Source)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
   at net.sf.acegisecurity.intercept.method.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:80)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:46)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   at com.agilent.datastore.audit.intrecept.DataStoreAuditMethodInterceptor.proceedWithAudit(DataStoreAuditMethodInterceptor.java:271)
   at com.agilent.datastore.audit.intrecept.DataStoreAuditMethodInterceptor.proceed(DataStoreAuditMethodInterceptor.java:182)
   at com.agilent.datastore.audit.intrecept.DataStoreAuditMethodInterceptor.invoke(DataStoreAuditMethodInterceptor.java:135)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
   at $Proxy14.query(Unknown Source)
   at org.alfresco.repo.jscript.Search.query(Search.java:801)
   … 49 more
Caused by: java.net.SocketException: Software caused connection abort: recv failed
   at java.net.SocketInputStream.socketRead0(Native Method)
   at java.net.SocketInputStream.read(SocketInputStream.java:129)
   at com.sun.net.ssl.internal.ssl.InputRecord.readFully(InputRecord.java:293)
   at com.sun.net.ssl.internal.ssl.InputRecord.read(InputRecord.java:331)
   at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:798)
   at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:755)
   at com.sun.net.ssl.internal.ssl.AppInputStream.read(AppInputStream.java:75)
   at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
   at java.io.BufferedInputStream.read(BufferedInputStream.java:237)
   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.repo.search.impl.solr.SolrQueryHTTPClient.executeQuery(SolrQueryHTTPClient.java:318)
   … 80 more

This is stably reproduced issue. Any of following queries (like first one) works good without any exceptions. We use Tomcat 6 and MS SQL Server 2008. Also it is fresh installation.

ebrenes
Champ on-the-rise
Champ on-the-rise

I had this problem in my local environment and I solved it running solr without SSL.

This is from the Alfresco official documentation:

I only followed the steps 1,2 and 3, as I didn't have the web.xml config it asks to remove.

Alfresco uses SSL to secure communication between the repository server and the Solr 4 server. In this communication, SSL not only provides encryption, it is also used for authentication. This topic describes how to turn-off SSL and deactivate authentication between Alfresco repository and the Solr server.
  1. Set the solr.secureComms property to none in the alfresco-global.properties file.
  2. Ensure that the solr.port property is set to the correct non-SSL port of the application server in which Solr is running.
  3. In the <solrRootDir>/archive-SpacesStore/conf/solrcore.properties file and <solrRootDir>/workspace-SpacesStore/conf/solrcore.properties file, do the following:
    1. Set the property alfresco.secureComms property to none.
    2. Ensure that the alfresco.port property is set to the correct non-SSL port of the application server in which your repository is running.
  4. In the repository <TOMCAT_HOME>/webapps/alfresco/WEB-INF/web.xml, remove the following configuration:
    <security-constraint>   <web-resource-collection>       <web-resource-name>SOLR</web-resource-name>       <url-pattern>/service/api/solr/*</url-pattern>   </web-resource-collection>    <auth-constraint>       <role-name>repoclient</role-name>   </auth-constraint>    <user-data-constraint>       <transport-guarantee>CONFIDENTIAL</transport-guarantee>   </user-data-constraint></security-constraint><security-constraint>   <web-resource-collection>       <web-resource-name>SOLR</web-resource-name>       <url-pattern>/s/api/solr/*</url-pattern>   </web-resource-collection>    <auth-constraint>       <role-name>repoclient</role-name>   </auth-constraint>    <user-data-constraint>       <transport-guarantee>CONFIDENTIAL</transport-guarantee>   </user-data-constraint></security-constraint><security-constraint>    <web-resource-collection>       <web-resource-name>SOLR</web-resource-name>       <url-pattern>/wcservice/api/solr/*</url-pattern>    </web-resource-collection>     <auth-constraint>       <role-name>repoclient</role-name>    </auth-constraint>     <user-data-constraint>       <transport-guarantee>CONFIDENTIAL</transport-guarantee>    </user-data-constraint></security-constraint><security-constraint>    <web-resource-collection>       <web-resource-name>SOLR</web-resource-name>       <url-pattern>/wcs/api/solr/*</url-pattern>    </web-resource-collection>     <auth-constraint>       <role-name>repoclient</role-name>    </auth-constraint>     <user-data-constraint>       <transport-guarantee>CONFIDENTIAL</transport-guarantee>    </user-data-constraint></security-constraint><login-config>    <auth-method>CLIENT-CERT</auth-method>    <realm-name>Repository</realm-name></login-config><security-role>    <role-name>repoclient</role-name></security-role>
  5. In the Solr <TOMCAT_HOME>/webapps/solr4/WEB-INF/web.xml, remove the following configuration:
    <security-constraint>   <web-resource-collection>      <url-pattern>/*</url-pattern>   </web-resource-collection>   <auth-constraint>      <role-name>repository</role-name>   </auth-constraint>      <user-data-constraint>         <transport-guarantee>CONFIDENTIAL</transport-guarantee>      </user-data-constraint></security-constraint><login-config>   <auth-method>CLIENT-CERT</auth-method>      <realm-name>Solr</realm-name></login-config><security-role>   <role-name>repository</role-name></security-role>
If you decide to turn-off SSL and deactivate authentication between Alfresco repository and the Solr server, you need to protect your environment. For more information, see Configuring SSL for a production environment.

From solr web.xml (tomcat/webapps/solr4/WEB-INF/web.xml) I removed this filter:

<filter-name>X509AuthFilter</filter-name>

and the filter mapping

<filter-mapping>
<filter-name>X509AuthFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>