cancel
Showing results for 
Search instead for 
Did you mean: 

Script to restart libreoffice when it freeze

boiss007
Champ on-the-rise
Champ on-the-rise
Hello all,
I administer a 4.2.e community instance of alfresco, on a debian server (tomcat/postgre). It works great but some of the documents in the repository were created with office 2003 and throw error when alfresco try to transform them for the preview; It is not a big problem except that sometimes it freeze alfresco.
The tomcat web interface is accessible but the share and alfresco interfaces are frozen.
Here is the error that share.log shows

08:31:13,887 INFO  [org.springframework.extensions.webscripts.connector.RemoteClient] Exception calling (GET) http://localhost:8080/alfresco/s/api/node/workspace/SpacesStore/5f16e0c2-d9d0-4078-bc91-214f252ee51c...
08:31:13,890 INFO  [org.springframework.extensions.webscripts.connector.RemoteClient] Error status 408 Read timed out
java.net.SocketTimeoutException: Read timed out
   at java.net.SocketInputStream.socketRead0(Native Method)
   at java.net.SocketInputStream.read(SocketInputStream.java:150)
   at java.net.SocketInputStream.read(SocketInputStream.java:121)
   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.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.springframework.extensions.webscripts.connector.RemoteClient.service(RemoteClient.java:1054)
   at org.springframework.extensions.webscripts.connector.RemoteClient.call(RemoteClient.java:708)
   at org.springframework.extensions.webscripts.connector.HttpConnector.call(HttpConnector.java:143)
   at org.springframework.extensions.webscripts.connector.AuthenticatingConnector.call(AuthenticatingConnector.java:293)
   at org.springframework.extensions.webscripts.servlet.mvc.EndPointProxyController.handleRequestInternal(EndPointProxyController.java:326)
   at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
   at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
   at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:790)
   at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
   at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
   at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
   at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:749)
   at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:487)
   at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:412)
   at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:339)
   at org.tuckey.web.filters.urlrewrite.NormalRewrittenUrl.doRewrite(NormalRewrittenUrl.java:213)
   at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:171)
   at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:145)
   at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:92)
   at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:389)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
   at org.alfresco.web.site.servlet.SecurityHeadersFilter.doFilter(SecurityHeadersFilter.java:168)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
   at org.alfresco.web.site.servlet.CSRFFilter.doFilter(CSRFFilter.java:320)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
   at org.alfresco.web.site.servlet.SSOAuthenticationFilter.doFilter(SSOAuthenticationFilter.java:378)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
   at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
   at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
   at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
   at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
   at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1852)
   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
   at java.lang.Thread.run(Thread.java:724)


I join the share.log (the code tag only shows me 1 line…)
and some javamelody graphs are uploaded to show the problem : Share's threads count explodes, and the error above keep repeating.



I fix it by restarting libreoffice with

sudo service alfresco restart libreoffice

but i would like to use a automated script to check for a crash and restart libreoffice by itself.

if someone is using this approach, or something similar, i'd appreciate any and all advice. i'm not sure what to monitor, and what is the best way to implement this solution.

Thanks in advance

Edit : And if it is the wrong approach, please tell me. i need to restart the libreoffice service twice a day because of this bug and i cant find anyone who has fixed it…
4 REPLIES 4

sasquatch58
Champ in-the-making
Champ in-the-making
Have a look at loftux scripts in https://github.com/loftuxab/alfresco-ubuntu-install
That may give some pointers on monitoring/ restarting libreoffice

Cheers, Sasquatch

boiss007
Champ on-the-rise
Champ on-the-rise
thank you, it helped to see i am not the only one with this problem. Or that someone wants to help. But it is not really my solution. I know how to crontab or how to use alfresco scripts, i want to find a way to activate the script when and only when libreoffice crash alfresco. But I will use temporary fixes for now - I reduced the max size of doc files to preview, I had already a crontab to restart libreoffice twice a day… It helps but my clients hate to have to call me because "the alfresco is broken again"…

scouil
Star Contributor
Star Contributor
Hi,

With the enterprise version you can use the jodconverter for openoffice.
http://docs.alfresco.com/4.1/index.jsp?topic=%2Fcom.alfresco.enterprise.doc%2Fconcepts%2FOOo-subsyst...
It usually solves most of the problems you have with the default openoffice connector.

boiss007
Champ on-the-rise
Champ on-the-rise
thanks a lot scouil, but that's not helping.
First because everybody know that jodconverter is presented as the solution to libreoffice problems, and is only accessible through the enterprise edition.
Second because it has nothing to do with my question, and my problem… I like the libreoffice transformer and the community edition, and what i need to find is why for some transformation libreoffice will use all the thread tomcat can handle, or how to do a restart of alfresco/libreoffice when it does