cancel
Showing results for 
Search instead for 
Did you mean: 

Preview of huge pptx and docx documents is failing

kriton
Champ in-the-making
Champ in-the-making
According to this wiki page http://wiki.alfresco.com/wiki/Content_Transformation_Limits there is a limit on the size of documents that can be previewed. I followed the guidelines in it to increase the limits but still not anything is working alright.

The thing is that the webscript that was calling the transformer was timing out I guess, because the transformation is taking too long. If I refresh the document details page after the preview was generated, the preview is now displayed with almost no delay as the preview already exists this time. I have to note that the machine running alfresco is quite slow and generating the preview according to the logs takes about 5minutes.
This is the exception that I was getting after I tried to preview a document of 20MBs that I just uploaded:

11:36:48,533 INFO  [org.springframework.extensions.webscripts.connector.RemoteClient] Error status 499 Read timed out
java.net.SocketTimeoutException: Read timed out
        at java.net.SocketInputStream.socketRead0(Native Method)
        at java.net.SocketInputStream.read(SocketInputStream.java:129)
        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.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:966)
        at org.springframework.extensions.webscripts.connector.RemoteClient.call(RemoteClient.java:629)
        at org.springframework.extensions.webscripts.connector.HttpConnector.call(HttpConnector.java:143)
        at org.springframework.extensions.webscripts.connector.AuthenticatingConnector.call(AuthenticatingConnector.java:290)
        at org.springframework.extensions.webscripts.servlet.mvc.EndPointProxyController.handleRequestInternal(EndPointProxyController.java:279)
        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:617)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
        at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)
        at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
        at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
        at org.tuckey.web.filters.urlrewrite.NormalRewrittenUrl.doRewrite(NormalRewrittenUrl.java:195)
        at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:159)
        at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:141)
        at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:90)
        at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:417)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.alfresco.web.site.servlet.SSOAuthenticationFilter.doFilter(SSOAuthenticationFilter.java:307)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:470)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
        at java.lang.Thread.run(Thread.java:662)


Now, according to this jira ticket https://issues.alfresco.com/jira/browse/ALF-10737 this can be configured as of 4.0. I have to note that the code listed under this ticket does not exist in 4.0.d and the bean configuration was pointing to a different class than the one listed under that ticket. Actually that ticket seems to have been created after the 4.0.d release so I guess the fix might come in 4.1.a? Anyway I added the code listed in that ticket in slingshot-application-context.xml and set the timeout to 10mins up from 2. This worked fine….

But now I faced another problem. Apparently the swf that displays the preview has a separate timeout field…. So even though the webscript does not timeout…. the swf still displays a timeout message and does not display the preview. The logs print this error:
2012-05-21 13:07:46,935 WARN [webscripts.connector.RemoteClient] [http-8080-32] Exception during close() of HTTP API connection
ClientAbortException: java.net.SocketException: Broken pipe

… which I guess makes perfect sense and can verify that this is what is indeed happening?

Now the problem is that I cannot find how to increase the timeout of the swf. Is that even possible ? I am also open to other suggestions if you have any for solving my problem.

Thanks.
2 REPLIES 2

zaizi
Champ in-the-making
Champ in-the-making
Generate the preview on document upload / creation using content rules and not when viewed.

Ainga

pmverma
Champ in-the-making
Champ in-the-making
Hello,
          I also add the spring bean defined https://issues.alfresco.com/jira/browse/ALF-10737 to my custom-slingshot-application-context.xml but it does not work   Smiley Sad

Kriton, you say,
Anyway I added the code listed in that ticket in slingshot-application-context.xml and set the timeout to 10mins up from 2. This worked fine….

could you plz to tell how to add and configure it in detail  :?:

Thanks in advance.
pmverma