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

Stop chained converter if the previous sub-converter returns an empty result

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2021.47, 2023.5
    • Component/s: Convert
    • Release Notes Summary:
      Chain conversions are stopped and return null when one of the subconverters returns empty, null main blob or null result.
    • Backlog priority:
      600
    • Sprint:
      nxplatform #102
    • Story Points:
      5

      Description

      The use case is :

      1. import a mal-formed HTML file to Nuxeo with a File document
      2. Nuxeo triggers the generation of the thumbnail thanks to the anyToPdfToThumbnail converter
            <converter name="anyToPdfToThumbnail">
              <conversionSteps>
                <subconverter>any2pdf</subconverter>
                <subconverter>pdfAndImageToThumbnail</subconverter>
              </conversionSteps>
            </converter>
        
      3. first, it's the subconverter any2pdf which is called => because of the mal-formed HTML, LibreOfficeConverter will build a result (blobHolder) with an empty blob list
      4. then, the subconverter pdfAndImageToThumbnail is called on this result but because of the empty blobHolder, it will throw this exception
      2023-10-23T08:56:06,806 ERROR [AbstractWork] Exception during work: ListenerWork(Listener updateThumbListener [scheduleThumbnailUpdate/431990b4-ea0d-456f-9bca-ae47ba827c08], Progress(?%, ?/0), null)
      java.lang.NullPointerException: null
      	at org.nuxeo.ecm.core.convert.service.ConversionServiceImpl.convert(ConversionServiceImpl.java:322) ~[nuxeo-core-convert-2021.40.11.jar:?]
      	at org.nuxeo.ecm.core.convert.extension.ChainedConverter.convertBasedSubConverters(ChainedConverter.java:84) ~[nuxeo-core-convert-2021.40.11.jar:?]
      	at org.nuxeo.ecm.core.convert.extension.ChainedConverter.convert(ChainedConverter.java:73) ~[nuxeo-core-convert-2021.40.11.jar:?]
      	at org.nuxeo.ecm.core.convert.service.ConversionServiceImpl.convert(ConversionServiceImpl.java:340) ~[nuxeo-core-convert-2021.40.11.jar:?]
      	at org.nuxeo.ecm.platform.thumbnail.converter.AnyToThumbnailConverter.convert(AnyToThumbnailConverter.java:91) ~[nuxeo-thumbnail-2021.40.11.jar:?]
      	at org.nuxeo.ecm.core.convert.service.ConversionServiceImpl.convert(ConversionServiceImpl.java:340) ~[nuxeo-core-convert-2021.40.11.jar:?]
      	at org.nuxeo.ecm.platform.thumbnail.factories.ThumbnailDocumentFactory.computeThumbnail(ThumbnailDocumentFactory.java:92) ~[nuxeo-thumbnail-2021.40.11.jar:?]
      	at org.nuxeo.ecm.core.api.thumbnail.ThumbnailServiceImpl.computeThumbnail(ThumbnailServiceImpl.java:99) ~[nuxeo-core-api-2021.40.11.jar:?]
      	at org.nuxeo.ecm.core.api.thumbnail.ThumbnailAdapter.computeThumbnail(ThumbnailAdapter.java:58) ~[nuxeo-core-api-2021.40.11.jar:?]
      	at org.nuxeo.ecm.platform.thumbnail.listener.ThumbnailHelper.createThumbnailIfNeeded(ThumbnailHelper.java:81) ~[nuxeo-thumbnail-2021.40.11.jar:?]
      	at org.nuxeo.ecm.platform.thumbnail.listener.UpdateThumbnailListener.processDoc(UpdateThumbnailListener.java:54) ~[nuxeo-thumbnail-2021.40.11.jar:?]
      	at org.nuxeo.ecm.platform.thumbnail.listener.UpdateThumbnailListener.handleEvent(UpdateThumbnailListener.java:84) ~[nuxeo-thumbnail-2021.40.11.jar:?]
      	at org.nuxeo.ecm.core.event.impl.AsyncEventExecutor$ListenerWork.work(AsyncEventExecutor.java:209) [nuxeo-core-event-2021.40.11.jar:?]
      	at org.nuxeo.ecm.core.work.AbstractWork.runWorkWithTransaction(AbstractWork.java:524) [nuxeo-core-event-2021.40.11.jar:?]
      	at org.nuxeo.ecm.core.work.AbstractWork.run(AbstractWork.java:387) [nuxeo-core-event-2021.40.11.jar:?]
      	at org.nuxeo.ecm.core.work.WorkHolder.run(WorkHolder.java:57) [nuxeo-core-event-2021.40.11.jar:?]
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
      	at java.lang.Thread.run(Thread.java:829) [?:?]
      2023-10-23T08:56:06,810 ERROR [AsyncEventExecutor] Failed to execute async event default on listener updateThumbListener
      java.lang.NullPointerException: null
      	at org.nuxeo.ecm.core.convert.service.ConversionServiceImpl.convert(ConversionServiceImpl.java:322) ~[nuxeo-core-convert-2021.40.11.jar:?]
      	at org.nuxeo.ecm.core.convert.extension.ChainedConverter.convertBasedSubConverters(ChainedConverter.java:84) ~[nuxeo-core-convert-2021.40.11.jar:?]
      	at org.nuxeo.ecm.core.convert.extension.ChainedConverter.convert(ChainedConverter.java:73) ~[nuxeo-core-convert-2021.40.11.jar:?]
      	at org.nuxeo.ecm.core.convert.service.ConversionServiceImpl.convert(ConversionServiceImpl.java:340) ~[nuxeo-core-convert-2021.40.11.jar:?]
      	at org.nuxeo.ecm.platform.thumbnail.converter.AnyToThumbnailConverter.convert(AnyToThumbnailConverter.java:91) ~[nuxeo-thumbnail-2021.40.11.jar:?]
      	at org.nuxeo.ecm.core.convert.service.ConversionServiceImpl.convert(ConversionServiceImpl.java:340) ~[nuxeo-core-convert-2021.40.11.jar:?]
      	at org.nuxeo.ecm.platform.thumbnail.factories.ThumbnailDocumentFactory.computeThumbnail(ThumbnailDocumentFactory.java:92) ~[nuxeo-thumbnail-2021.40.11.jar:?]
      	at org.nuxeo.ecm.core.api.thumbnail.ThumbnailServiceImpl.computeThumbnail(ThumbnailServiceImpl.java:99) ~[nuxeo-core-api-2021.40.11.jar:?]
      

      The ChainedConverter#convert method should stop the chain if the result of the previous conversion is empty and return null
      Then the Nuxeo code handles correctly a "null" value returned by a converter.

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: