Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-25914

Fix thumbnail generation for a PDF file on Ubuntu following ImageMagick updates

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Not A Bug
    • Affects Version/s: None
    • Fix Version/s: 11.1
    • Component/s: Convert
    • Backlog priority:
      800

      Description

      After installing the updates on my Ubuntu 16.04.5 LTS (4.4.0-137-generic), the ThumbnailDocumentFactory fails when importing a PDF file with:

      2018-10-08T15:59:55,291 WARN  [ThumbnailDocumentFactory] Cannot compute document thumbnail
      org.nuxeo.ecm.core.convert.api.ConversionException: Thumbnail conversion failed
      	at org.nuxeo.ecm.platform.thumbnail.converter.ThumbnailDocumentConverter.convert(ThumbnailDocumentConverter.java:92) ~[nuxeo-thumbnail-10.3-SNAPSHOT.jar:?]
      	at org.nuxeo.ecm.core.convert.service.ConversionServiceImpl.convert(ConversionServiceImpl.java:319) ~[nuxeo-core-convert-10.3-SNAPSHOT.jar:?]
      	at org.nuxeo.ecm.platform.thumbnail.converter.AnyToThumbnailConverter.convert(AnyToThumbnailConverter.java:77) ~[nuxeo-thumbnail-10.3-SNAPSHOT.jar:?]
      	at org.nuxeo.ecm.core.convert.service.ConversionServiceImpl.convert(ConversionServiceImpl.java:319) ~[nuxeo-core-convert-10.3-SNAPSHOT.jar:?]
      	at org.nuxeo.ecm.platform.thumbnail.factories.ThumbnailDocumentFactory.computeThumbnail(ThumbnailDocumentFactory.java:92) [nuxeo-thumbnail-10.3-SNAPSHOT.jar:?]
      	at org.nuxeo.ecm.core.api.thumbnail.ThumbnailServiceImpl.computeThumbnail(ThumbnailServiceImpl.java:99) [nuxeo-core-api-10.3-SNAPSHOT.jar:?]
      	at org.nuxeo.ecm.core.api.thumbnail.ThumbnailAdapter.computeThumbnail(ThumbnailAdapter.java:58) [nuxeo-core-api-10.3-SNAPSHOT.jar:?]
      	at org.nuxeo.ecm.platform.thumbnail.listener.UpdateThumbnailListener.processDoc(UpdateThumbnailListener.java:67) [nuxeo-thumbnail-10.3-SNAPSHOT.jar:?]
      	at org.nuxeo.ecm.platform.thumbnail.listener.UpdateThumbnailListener.handleEvent(UpdateThumbnailListener.java:137) [nuxeo-thumbnail-10.3-SNAPSHOT.jar:?]
      	at org.nuxeo.ecm.core.event.impl.AsyncEventExecutor$ListenerWork.work(AsyncEventExecutor.java:221) [nuxeo-core-event-10.3-SNAPSHOT.jar:?]
      	at org.nuxeo.ecm.core.work.AbstractWork.runWorkWithTransaction(AbstractWork.java:437) [nuxeo-core-event-10.3-SNAPSHOT.jar:?]
      	at org.nuxeo.ecm.core.work.AbstractWork.run(AbstractWork.java:357) [nuxeo-core-event-10.3-SNAPSHOT.jar:?]
      	at org.nuxeo.ecm.core.work.WorkHolder.run(WorkHolder.java:57) [nuxeo-core-event-10.3-SNAPSHOT.jar:?]
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_172]
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_172]
      	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_172]
      Caused by: org.nuxeo.ecm.platform.commandline.executor.api.CommandException: Error code 1 return by command: convert -define registry:temporary-path=#{nuxeo.tmp.dir} -quiet -strip -thumbnail #{size} -background transparent -gravity center -format png -quality 75 #{inputFilePath}[0] #{outputFilePath}
      convert: not authorized `/var/lib/nuxeo/binaries/data/78/b6/78b657af5de8ccb1c9f76d5e207ae662' @ error/constitute.c/ReadImage/412.
        convert: pas d'images définies `/home/ataillefer/nuxeo/nuxeo-server-tomcat-10.3-SNAPSHOT/tmp/nxblob-7013750230183142175.png' @ error/convert.c/ConvertImageCommand/3210.
      	at org.nuxeo.ecm.platform.commandline.executor.api.ExecResult.<init>(ExecResult.java:62) ~[nuxeo-platform-commandline-executor-10.3-SNAPSHOT.jar:?]
      	at org.nuxeo.ecm.platform.commandline.executor.service.executors.ShellExecutor.exec(ShellExecutor.java:82) ~[nuxeo-platform-commandline-executor-10.3-SNAPSHOT.jar:?]
      	at org.nuxeo.ecm.platform.commandline.executor.service.CommandLineExecutorComponent.execCommand(CommandLineExecutorComponent.java:173) ~[nuxeo-platform-commandline-executor-10.3-SNAPSHOT.jar:?]
      	at org.nuxeo.ecm.platform.thumbnail.converter.ThumbnailDocumentConverter.convert(ThumbnailDocumentConverter.java:85) ~[nuxeo-thumbnail-10.3-SNAPSHOT.jar:?]
      	... 15 more
      

      ImageMagick packages:

      $ dpkg --list | grep imagemagick
      ii  imagemagick                                          8:6.8.9.9-7ubuntu5.13                        amd64        image manipulation programs -- binaries
      ii  imagemagick-6.q16                                    8:6.8.9.9-7ubuntu5.13                        amd64        image manipulation programs -- quantum depth Q16
      ii  imagemagick-common                                   8:6.8.9.9-7ubuntu5.13                        all          image manipulation programs -- infrastructure
      

      Fix:

      sudo vi /etc/ImageMagick-6/policy.xml
      
      <!--<policy domain="coder" rights="none" pattern="PDF" />-->
      <policy domain="coder" rights="read|write" pattern="PDF" />
      

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: