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

Fix java.io.tmpdir value when generating thumbnail on windows

    XMLWordPrintable

    Details

      Description

      1. install Nuxeo 7.10-HF18
      2. startup and up head over to {{ Admin / System Information / Setup / Advanced Setup }}
      3. check the paramters nuxeo.tmp.dir and java.io.tmpdir they both contain a value matching the default tmp folder with backslashes
      4. set nuxeo.tmp.dir to some existing folder value, for example E:\Nuxeo\Tmp
      5. after starting up head over to {{ Admin / System Information / Setup / Advanced Setup }}
      6. check the paramters nuxeo.tmp.dir and java.io.tmpdir, they are both rewritten with forward slashes
      7. also when trying to create a file with a picture attached, the thumbnail generation echoes the following:
        2016-11-23 16:43:36,287 WARN  [Nuxeo-Work-default-3] [org.nuxeo.ecm.platform.thumbnail.factories.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:85)
        	at org.nuxeo.ecm.core.convert.extension.ChainedConverter.convertBasedSubConverters(ChainedConverter.java:80)
        	at org.nuxeo.ecm.core.convert.extension.ChainedConverter.convert(ChainedConverter.java:64)
        	at org.nuxeo.ecm.core.convert.service.ConversionServiceImpl.convert(ConversionServiceImpl.java:198)
        	at org.nuxeo.ecm.platform.thumbnail.converter.AnyToThumbnailConverter.convert(AnyToThumbnailConverter.java:75)
        	at org.nuxeo.ecm.core.convert.service.ConversionServiceImpl.convert(ConversionServiceImpl.java:198)
        	at org.nuxeo.ecm.platform.thumbnail.factories.ThumbnailDocumentFactory.computeThumbnail(ThumbnailDocumentFactory.java:87)
        	at org.nuxeo.ecm.core.api.thumbnail.ThumbnailServiceImpl.computeThumbnail(ThumbnailServiceImpl.java:92)
        	at org.nuxeo.ecm.core.api.thumbnail.ThumbnailAdapter.computeThumbnail(ThumbnailAdapter.java:56)
        	at org.nuxeo.ecm.platform.thumbnail.listener.UpdateThumbnailListener.processDoc(UpdateThumbnailListener.java:60)
        	at org.nuxeo.ecm.platform.thumbnail.listener.UpdateThumbnailListener.handleEvent(UpdateThumbnailListener.java:130)
        	at org.nuxeo.ecm.core.event.impl.AsyncEventExecutor$ListenerWork.work(AsyncEventExecutor.java:173)
        	at org.nuxeo.ecm.core.work.AbstractWork.runWorkWithTransaction(AbstractWork.java:396)
        	at org.nuxeo.ecm.core.work.AbstractWork.runWorkWithTransactionAndCheckExceptions(AbstractWork.java:357)
        	at org.nuxeo.ecm.core.work.AbstractWork.run(AbstractWork.java:328)
        	at org.nuxeo.ecm.core.work.WorkHolder.run(WorkHolder.java:52)
        	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        	at java.lang.Thread.run(Thread.java:745)
        Caused by: org.nuxeo.ecm.platform.commandline.executor.api.CommandException: Error code 4 return by command: convert -define registry:temporary-path=#{java.io.tmpdir} -quiet -strip -thumbnail #{size} -background transparent -gravity center -format png -quality 75 #{inputFilePath}[0] #{outputFilePath}
        Param?tre non valide - registry:temporary-path=D:
        	at org.nuxeo.ecm.platform.commandline.executor.api.ExecResult.<init>(ExecResult.java:60)
        	at org.nuxeo.ecm.platform.commandline.executor.service.executors.ShellExecutor.exec(ShellExecutor.java:80)
        	at org.nuxeo.ecm.platform.commandline.executor.service.CommandLineExecutorComponent.execCommand(CommandLineExecutorComponent.java:172)
        	at org.nuxeo.ecm.platform.thumbnail.converter.ThumbnailDocumentConverter.convert(ThumbnailDocumentConverter.java:78)
        	... 18 more
        
      8. It seems the path is truncated into D:
      9. after a debugging session, the complete path is provided as is to the ProcessBuilder class in the ShellExecutor but it seems not to handle this correctly when forward slashes are involved

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 day, 4 hours
                1d 4h