cancel
Showing results for 
Search instead for 
Did you mean: 

Preview of Word/Excel/PowerPoint files doesn't work

marius_dumitrac
Confirmed Champ
Confirmed Champ

Hi,

I have installed Alfresco Community 5.2 on a CentOS 7, with Tomcat 7, PostgreSQL 9.6, LibreOffice 5.4, ImageMagick 7 and GhostScript 9.07 and it's working fine with one exception - the preview of MS Office files.

In the Web Interface I get the message "The document can't be previewed. Click here to download it" and in the logs I get the errors from below.

Here is the alfresco-global.properties section dealing with LibreOffice and ImageMagick

ooo.exe=/opt/libreoffice5.4/program/soffice
ooo.enabled=true
jodconverter.officeHome=/opt/libreoffice5.4
jodconverter.portNumbers=8101
jodconverter.enabled=true
img.root=/usr/local
img.dyn=${img.root}/lib64
img.exe=${img.root}/bin/convert
img.gslib=/usr/share/ghostscript/9.07/lib

And here is the error from the log:

 2017-10-24 00:57:01,699 ERROR [repo.action.AsynchronousActionExecutionQueueImpl] [defaultAsyncAction4] Failed to execute asynchronous action: Action[ id=ef275282-5cb6-4568-bfb7-431a5aa34366, node=null ]: 09240026 No thumbnail present in file, unable to generate image/jpeg
org.alfresco.error.AlfrescoRuntimeException: 09240045 Creation of thumbnail 'doclib' failed
at org.alfresco.repo.thumbnail.CreateThumbnailActionExecuter.executeImpl(CreateThumbnailActionExecuter.java:213)
at org.alfresco.repo.action.executer.ActionExecuterAbstractBase.execute(ActionExecuterAbstractBase.java:273)
at org.alfresco.repo.action.ActionServiceImpl.directActionExecution(ActionServiceImpl.java:856)
at org.alfresco.repo.action.ActionServiceImpl.executeActionImpl(ActionServiceImpl.java:757)
at org.alfresco.repo.action.AsynchronousActionExecutionQueueImpl$ActionExecutionWrapper$1$1.execute(AsynchronousActionExecutionQueueImpl.java:430)
at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:464)
at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:333)
at org.alfresco.repo.action.AsynchronousActionExecutionQueueImpl$ActionExecutionWrapper$1.doWork(AsynchronousActionExecutionQueueImpl.java:439)
at org.alfresco.repo.tenant.TenantUtil.runAsWork(TenantUtil.java:126)
at org.alfresco.repo.tenant.TenantUtil.runAsTenant(TenantUtil.java:95)
at org.alfresco.repo.tenant.TenantUtil$1.doWork(TenantUtil.java:69)
at org.alfresco.repo.security.authentication.AuthenticationUtil.runAs(AuthenticationUtil.java:555)
at org.alfresco.repo.tenant.TenantUtil.runAsUserTenant(TenantUtil.java:65)
at org.alfresco.repo.action.AsynchronousActionExecutionQueueImpl$ActionExecutionWrapper.run(AsynchronousActionExecutionQueueImpl.java:442)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.alfresco.service.cmr.repository.ContentIOException: 09240033 Content conversion failed:
reader: ContentAccessor[ contentUrl=store://2017/10/23/19/14/2c0bee93-558f-49cb-9dee-94c756c10aab.bin, mimetype=application/vnd.openxmlformats-officedocument.wordprocessingml.document, size=362502, encoding=UTF-8, locale=en_US]
writer: ContentAccessor[ contentUrl=store://2017/10/24/0/56/d90c9ee7-c3c6-479d-9b76-f7b02bb06001.bin, mimetype=image/png, size=0, encoding=UTF-8, locale=en_US]
options: {use=doclib, contentReaderNodeRef=workspace://SpacesStore/7a49aab7-4e17-45c5-b7e7-e40110c30c0e, contentWriterNodeRef=null, sourceContentProperty=null, imageAutoOrient=true, targetContentProperty=null, commandOptions=, imageResizeOptions=ImageResizeOptions [width=100, height=100, maintainAspectRatio=true, percentResize=false, resizeToThumbnail=false, allowEnlargement=false], includeEmbedded=null}
limits: {timeoutMs=120000, pageLimit=1}
at org.alfresco.repo.content.transform.AbstractContentTransformer2.transform(AbstractContentTransformer2.java:350)
at org.alfresco.repo.content.ContentServiceImpl.transform(ContentServiceImpl.java:613)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
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.model.ml.MLContentInterceptor.invoke(MLContentInterceptor.java:136)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:53)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:166)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:96)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:260)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at com.sun.proxy.$Proxy54.transform(Unknown Source)
at org.alfresco.repo.rendition.executer.AbstractTransformationRenderingEngine$TransformationCallable$1.doWork(AbstractTransformationRenderingEngine.java:447)
at org.alfresco.repo.rendition.executer.AbstractTransformationRenderingEngine$TransformationCallable$1.doWork(AbstractTransformationRenderingEngine.java:1)
at org.alfresco.repo.security.authentication.AuthenticationUtil.runAs(AuthenticationUtil.java:555)
at org.alfresco.repo.rendition.executer.AbstractTransformationRenderingEngine$TransformationCallable.call(AbstractTransformationRenderingEngine.java:437)
at org.alfresco.repo.rendition.executer.AbstractTransformationRenderingEngine$TransformationCallable.call(AbstractTransformationRenderingEngine.java:1)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
... 3 more
Caused by: org.alfresco.service.cmr.repository.ContentIOException: 09240032 Content conversion failed:
reader: ContentAccessor[ contentUrl=store://2017/10/23/19/14/2c0bee93-558f-49cb-9dee-94c756c10aab.bin, mimetype=application/vnd.openxmlformats-officedocument.wordprocessingml.document, size=362502, encoding=UTF-8, locale=en_US]
writer: ContentAccessor[ contentUrl=store:///opt/tomcat-7/temp/Alfresco/ComplextTransformer_intermediate_docx_4174977320652050331.jpg, mimetype=image/jpeg, size=0, encoding=UTF-8, locale=en_US]
options: {use=doclib, contentReaderNodeRef=workspace://SpacesStore/7a49aab7-4e17-45c5-b7e7-e40110c30c0e, contentWriterNodeRef=null, sourceContentProperty=null, imageAutoOrient=true, targetContentProperty=null, commandOptions=, imageResizeOptions=ImageResizeOptions [width=100, height=100, maintainAspectRatio=true, percentResize=false, resizeToThumbnail=false, allowEnlargement=false], includeEmbedded=null}
limits: {timeoutMs=120000, pageLimit=1}
at org.alfresco.repo.content.transform.AbstractContentTransformer2.transform(AbstractContentTransformer2.java:350)
at org.alfresco.repo.content.ContentServiceImpl.transform(ContentServiceImpl.java:613)
at org.alfresco.repo.content.transform.ComplexContentTransformer.transformInternal(ComplexContentTransformer.java:483)
at org.alfresco.repo.content.transform.AbstractContentTransformer2.transform(AbstractContentTransformer2.java:272)
... 31 more
Caused by: org.alfresco.repo.content.transform.UnimportantTransformException: 09240026 No thumbnail present in file, unable to generate image/jpeg
at org.alfresco.repo.content.transform.OOXMLThumbnailContentTransformer.transformInternal(OOXMLThumbnailContentTransformer.java:146)
at org.alfresco.repo.content.transform.AbstractContentTransformer2.transform(AbstractContentTransformer2.java:272)
... 34 more


 

1 ACCEPTED ANSWER

Hi,

I've solved the problem. Here is a short tutorial on how to fix this problem.

First a small typo in my alfresco-global.properties file: 

jodconverter.portNumbers=8101 should be jodconverter.portNumbers=8100

 

The root cause was the absence of libcairo.so.2 library and because of this, the openoffice could not be started.

I found out by executing the ./soffice command in the folder where LibreOffice is installed (in my case this was in /opt/libreoffice5.4)

If the response is something like:

/path/to/libreoffice/program/soffice.bin: Error while loading shared libraries: libcairo.so.2 ....

Then you have to install the missing library.

In my case (CentOS 7) I've executed the following command:

yum install cairo -y

After that, running ./soffice the result was: Failed to open display

After that, I've restarted tomcat, and that was it. 

Now the MS Office files are opened in preview.

 

View answer in original post

3 REPLIES 3

afaust
Legendary Innovator
Legendary Innovator

The error message states that one transformer fails because it cannot find a prepared thumbnail already present in the Office file. This is an "optimisation" transformer which aims to avoid generating a (potentially inaccurate) thumbnail when the file contains one. The question in your case is, why is this transformer picked instead of the OpenOffice one, when no thumbnail is embedded. Looking at the implementation, I can see no logic that actually does any checks if a thumbnail exists before chosing this transformer, which at the look of it might be a bug in Alfresco., though I have not noticed it in current customer systems.

One option you have is to de-prioritise the OOXML transformer, so that the OpenOffice one is always tried first (as long as it supports the transformation). You should be able to do this by setting

content.transformer.OOXMLThumbnail.priority=500

in alfresco-global.properties. With this setting, only specific transformations that have been prioritised explicitly (by default only dotx=>jpg and potx=>jpg) should be transformed via this transformer first.

Hi Axel,

I've done the modification you send me and restart Tomcat (also I've erased the alfresco and share folders from webapps tomcat folder) and the problems is still there.

Also, I've managed to isolate the error when preview the office docs. Here it is:

2017-10-24 14:15:27,277 ERROR [extensions.webscripts.AbstractRuntime] [http-bio-8080-exec-6] Exception from executeScript: 09240002 The content node was not specified so the content cannot be streamed to the client: classpath*:alfresco/templates/webscripts/org/alfresco/repository/thumbnail/thumbnail.get.js
org.springframework.extensions.webscripts.WebScriptException: 09240002 The content node was not specified so the content cannot be streamed to the client: classpath*:alfresco/templates/webscripts/org/alfresco/repository/thumbnail/thumbnail.get.js
at org.alfresco.repo.web.scripts.content.StreamContent.execute(StreamContent.java:176)
at org.alfresco.repo.web.scripts.RepositoryContainer$3.execute(RepositoryContainer.java:512)
at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:464)
at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:587)
at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContainer.java:656)
at org.alfresco.repo.web.scripts.RepositoryContainer.executeScriptInternal(RepositoryContainer.java:428)
at org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:308)
at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:399)
at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:210)
at org.springframework.extensions.webscripts.servlet.WebScriptServlet.service(WebScriptServlet.java:132)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.alfresco.module.aosmodule.service.ContextRootFilter.doFilter(ContextRootFilter.java:93)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.alfresco.web.app.servlet.GlobalLocalizationFilter.doFilter(GlobalLocalizationFilter.java:68)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:110)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:506)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:962)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:445)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1115)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)

Thanks,

Marius

Hi,

I've solved the problem. Here is a short tutorial on how to fix this problem.

First a small typo in my alfresco-global.properties file: 

jodconverter.portNumbers=8101 should be jodconverter.portNumbers=8100

 

The root cause was the absence of libcairo.so.2 library and because of this, the openoffice could not be started.

I found out by executing the ./soffice command in the folder where LibreOffice is installed (in my case this was in /opt/libreoffice5.4)

If the response is something like:

/path/to/libreoffice/program/soffice.bin: Error while loading shared libraries: libcairo.so.2 ....

Then you have to install the missing library.

In my case (CentOS 7) I've executed the following command:

yum install cairo -y

After that, running ./soffice the result was: Failed to open display

After that, I've restarted tomcat, and that was it. 

Now the MS Office files are opened in preview.