Uploaded image for project: 'Nuxeo Enhanced Viewer'
  1. Nuxeo Enhanced Viewer
  2. NEV-71

Fix NPE on ARender document comparison

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Blocker
    • Resolution: Not A Bug
    • Affects Version/s: None
    • Fix Version/s: 1.0.2
    • Component/s: Nuxeo Connector
    • Environment:
      nuxeo-server-10.3-I20181203_2333-tomcat
      arender-rendition:1.0.1-I20181204_1154
      nuxeo-arender:1.0.1-I20181204_1154

      Description

      Calling the Document.ARenderGetDiffUrl operation throws an NPE.

      Steps to reproduce:

      • Set up date-based arender rendtion docker image:
        docker run -p 8761:8761 --name arender_rendition -it dockerin-arender.nuxeo.com:443/arender-rendition:1.0.1-I20181204_1154
        
      • nuxeo.conf:
        org.nuxeo.connect.url=https://nos-preprod-connect.nuxeocloud.com/nuxeo/site/
        arender.server.rendition.hosts=http://localhost:8761
        arender.server.previewer.host=http://localhost:8080
        nuxeo.jwt.secret=test
        
      • Create a File document with a Word (.docx) file as the main blob.
      • Create another File document with the same Word (.docx) file (only with a few small differences for comparison) as the main blob.
      • Open a terminal and run the following cURL command (replacing the doc IDs with the UUIDs of the documents created and including an authentication token):
        curl -X POST 'http://localhost:8080/nuxeo/site/automation/Document.ARenderGetDiffUrl' -H 'X-Authentication-Token: <AUTHENTICATION_TOKEN>' -H 'Nuxeo-Transaction-Timeout: 3' -H 'X-NXproperties: *' -H 'X-NXRepository: default' -H 'X-NXVoidOperation: false' -d '{"params":{"leftDocId":"<DOC_UUID_1>","rightDocId":"<DOC_UUID_2>"},"context":{}}'
        

      => Returns error:

      {"entity-type":"exception","status":500,"message":"java.lang.NullPointerException"}
      

      => HTTP response:

      {
        "previewerUrl": "http://localhost:8080/ARender/?uuid=Not Found"
      }
      

      => server.log:

      018-12-04T16:10:18,849 WARN  [Nuxeo-Work-default-4:3321788132627.2112594601] [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) ~[nuxeo-thumbnail-10.3-I20181203_2333.jar:?]
      	at org.nuxeo.ecm.core.convert.extension.ChainedConverter.convertBasedSubConverters(ChainedConverter.java:87) ~[nuxeo-core-convert-10.3-I20181203_2333.jar:?]
      	at org.nuxeo.ecm.core.convert.extension.ChainedConverter.convert(ChainedConverter.java:71) ~[nuxeo-core-convert-10.3-I20181203_2333.jar:?]
      	at org.nuxeo.ecm.core.convert.service.ConversionServiceImpl.convert(ConversionServiceImpl.java:332) ~[nuxeo-core-convert-10.3-I20181203_2333.jar:?]
      	at org.nuxeo.ecm.platform.thumbnail.converter.AnyToThumbnailConverter.convert(AnyToThumbnailConverter.java:77) ~[nuxeo-thumbnail-10.3-I20181203_2333.jar:?]
      	at org.nuxeo.ecm.core.convert.service.ConversionServiceImpl.convert(ConversionServiceImpl.java:332) ~[nuxeo-core-convert-10.3-I20181203_2333.jar:?]
      	at org.nuxeo.ecm.platform.thumbnail.factories.ThumbnailDocumentFactory.computeThumbnail(ThumbnailDocumentFactory.java:92) [nuxeo-thumbnail-10.3-I20181203_2333.jar:?]
      	at org.nuxeo.ecm.core.api.thumbnail.ThumbnailServiceImpl.computeThumbnail(ThumbnailServiceImpl.java:99) [nuxeo-core-api-10.3-I20181203_2333.jar:?]
      	at org.nuxeo.ecm.core.api.thumbnail.ThumbnailAdapter.computeThumbnail(ThumbnailAdapter.java:58) [nuxeo-core-api-10.3-I20181203_2333.jar:?]
      	at org.nuxeo.ecm.platform.thumbnail.listener.UpdateThumbnailListener.processDoc(UpdateThumbnailListener.java:67) [nuxeo-thumbnail-10.3-I20181203_2333.jar:?]
      	at org.nuxeo.ecm.platform.thumbnail.listener.UpdateThumbnailListener.handleEvent(UpdateThumbnailListener.java:137) [nuxeo-thumbnail-10.3-I20181203_2333.jar:?]
      	at org.nuxeo.ecm.core.event.impl.AsyncEventExecutor$ListenerWork.work(AsyncEventExecutor.java:221) [nuxeo-core-event-10.3-I20181203_2333.jar:?]
      	at org.nuxeo.ecm.core.work.AbstractWork.runWorkWithTransaction(AbstractWork.java:437) [nuxeo-core-event-10.3-I20181203_2333.jar:?]
      	at org.nuxeo.ecm.core.work.AbstractWork.run(AbstractWork.java:357) [nuxeo-core-event-10.3-I20181203_2333.jar:?]
      	at org.nuxeo.ecm.core.work.WorkHolder.run(WorkHolder.java:57) [nuxeo-core-event-10.3-I20181203_2333.jar:?]
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_73]
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_73]
      	at java.lang.Thread.run(Thread.java:745) [?:1.8.0_73]
      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 `/home/karin/Nuxeo/distribution/date-based/nuxeo-server-10.3-I20181203_2333-tomcat/tmp/5476606559838676420/nxblob-88802558247896357.pdf' @ error/constitute.c/ReadImage/412.
        convert: no images defined `/home/karin/Nuxeo/distribution/date-based/nuxeo-server-10.3-I20181203_2333-tomcat/tmp/nxblob-6572660123537614133.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-I20181203_2333.jar:?]
      	at org.nuxeo.ecm.platform.commandline.executor.service.executors.ShellExecutor.exec(ShellExecutor.java:82) ~[nuxeo-platform-commandline-executor-10.3-I20181203_2333.jar:?]
      	at org.nuxeo.ecm.platform.commandline.executor.service.CommandLineExecutorComponent.execCommand(CommandLineExecutorComponent.java:173) ~[nuxeo-platform-commandline-executor-10.3-I20181203_2333.jar:?]
      	at org.nuxeo.ecm.platform.thumbnail.converter.ThumbnailDocumentConverter.convert(ThumbnailDocumentConverter.java:78) ~[nuxeo-thumbnail-10.3-I20181203_2333.jar:?]
      	... 17 more
      2018-12-04T16:10:42,221 WARN  [Nuxeo-Work-default-4:3344138156955.1461601509] [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) ~[nuxeo-thumbnail-10.3-I20181203_2333.jar:?]
      	at org.nuxeo.ecm.core.convert.extension.ChainedConverter.convertBasedSubConverters(ChainedConverter.java:87) ~[nuxeo-core-convert-10.3-I20181203_2333.jar:?]
      	at org.nuxeo.ecm.core.convert.extension.ChainedConverter.convert(ChainedConverter.java:71) ~[nuxeo-core-convert-10.3-I20181203_2333.jar:?]
      	at org.nuxeo.ecm.core.convert.service.ConversionServiceImpl.convert(ConversionServiceImpl.java:332) ~[nuxeo-core-convert-10.3-I20181203_2333.jar:?]
      	at org.nuxeo.ecm.platform.thumbnail.converter.AnyToThumbnailConverter.convert(AnyToThumbnailConverter.java:77) ~[nuxeo-thumbnail-10.3-I20181203_2333.jar:?]
      	at org.nuxeo.ecm.core.convert.service.ConversionServiceImpl.convert(ConversionServiceImpl.java:332) ~[nuxeo-core-convert-10.3-I20181203_2333.jar:?]
      	at org.nuxeo.ecm.platform.thumbnail.factories.ThumbnailDocumentFactory.computeThumbnail(ThumbnailDocumentFactory.java:92) [nuxeo-thumbnail-10.3-I20181203_2333.jar:?]
      	at org.nuxeo.ecm.core.api.thumbnail.ThumbnailServiceImpl.computeThumbnail(ThumbnailServiceImpl.java:99) [nuxeo-core-api-10.3-I20181203_2333.jar:?]
      	at org.nuxeo.ecm.core.api.thumbnail.ThumbnailAdapter.computeThumbnail(ThumbnailAdapter.java:58) [nuxeo-core-api-10.3-I20181203_2333.jar:?]
      	at org.nuxeo.ecm.platform.thumbnail.listener.UpdateThumbnailListener.processDoc(UpdateThumbnailListener.java:67) [nuxeo-thumbnail-10.3-I20181203_2333.jar:?]
      	at org.nuxeo.ecm.platform.thumbnail.listener.UpdateThumbnailListener.handleEvent(UpdateThumbnailListener.java:137) [nuxeo-thumbnail-10.3-I20181203_2333.jar:?]
      	at org.nuxeo.ecm.core.event.impl.AsyncEventExecutor$ListenerWork.work(AsyncEventExecutor.java:221) [nuxeo-core-event-10.3-I20181203_2333.jar:?]
      	at org.nuxeo.ecm.core.work.AbstractWork.runWorkWithTransaction(AbstractWork.java:437) [nuxeo-core-event-10.3-I20181203_2333.jar:?]
      	at org.nuxeo.ecm.core.work.AbstractWork.run(AbstractWork.java:357) [nuxeo-core-event-10.3-I20181203_2333.jar:?]
      	at org.nuxeo.ecm.core.work.WorkHolder.run(WorkHolder.java:57) [nuxeo-core-event-10.3-I20181203_2333.jar:?]
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_73]
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_73]
      	at java.lang.Thread.run(Thread.java:745) [?:1.8.0_73]
      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 `/home/karin/Nuxeo/distribution/date-based/nuxeo-server-10.3-I20181203_2333-tomcat/tmp/3251494251429362756/nxblob-6167896814876371370.pdf' @ error/constitute.c/ReadImage/412.
        convert: no images defined `/home/karin/Nuxeo/distribution/date-based/nuxeo-server-10.3-I20181203_2333-tomcat/tmp/nxblob-3498466779868695933.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-I20181203_2333.jar:?]
      	at org.nuxeo.ecm.platform.commandline.executor.service.executors.ShellExecutor.exec(ShellExecutor.java:82) ~[nuxeo-platform-commandline-executor-10.3-I20181203_2333.jar:?]
      	at org.nuxeo.ecm.platform.commandline.executor.service.CommandLineExecutorComponent.execCommand(CommandLineExecutorComponent.java:173) ~[nuxeo-platform-commandline-executor-10.3-I20181203_2333.jar:?]
      	at org.nuxeo.ecm.platform.thumbnail.converter.ThumbnailDocumentConverter.convert(ThumbnailDocumentConverter.java:78) ~[nuxeo-thumbnail-10.3-I20181203_2333.jar:?]
      	... 17 more
      2018-12-04T16:10:55,554 ERROR [http-nio-0.0.0.0-8080-exec-11] [org.nuxeo.ecm.webengine.app.WebEngineExceptionMapper] java.lang.NullPointerException
      java.lang.NullPointerException: null
      	at org.nuxeo.ecm.automation.server.jaxrs.ExecutableResource.createContext(ExecutableResource.java:60) ~[nuxeo-automation-server-10.3-I20181203_2333.jar:?]
      	at org.nuxeo.ecm.automation.server.jaxrs.OperationResource.execute(OperationResource.java:58) ~[nuxeo-automation-server-10.3-I20181203_2333.jar:?]
      	at org.nuxeo.ecm.automation.server.jaxrs.ExecutableResource.doPost(ExecutableResource.java:70) ~[nuxeo-automation-server-10.3-I20181203_2333.jar:?]
      	at sun.reflect.GeneratedMethodAccessor203.invoke(Unknown Source) ~[?:?]
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_73]
      	at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_73]
      	at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60) ~[jersey-server-1.19.4.jar:1.19.4]
      	at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ObjectOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:258) ~[jersey-server-1.19.4.jar:1.19.4]
      	at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75) ~[jersey-server-1.19.4.jar:1.19.4]
      	at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:302) ~[jersey-server-1.19.4.jar:1.19.4]
      	at com.sun.jersey.server.impl.uri.rules.SubLocatorRule.accept(SubLocatorRule.java:137) ~[jersey-server-1.19.4.jar:1.19.4]
      	at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147) ~[jersey-server-1.19.4.jar:1.19.4]
      	at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108) ~[jersey-server-1.19.4.jar:1.19.4]
      	at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147) ~[jersey-server-1.19.4.jar:1.19.4]
      	at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84) ~[jersey-server-1.19.4.jar:1.19.4]
      	at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1542) ~[jersey-server-1.19.4.jar:1.19.4]
      	at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1473) [jersey-server-1.19.4.jar:1.19.4]
      	at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1419) [jersey-server-1.19.4.jar:1.19.4]
      	at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1409) [jersey-server-1.19.4.jar:1.19.4]
      	at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:409) [jersey-servlet-1.19.4.jar:1.19.4]
      	at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:558) [jersey-servlet-1.19.4.jar:1.19.4]
      	at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:733) [jersey-servlet-1.19.4.jar:1.19.4]
      	at org.nuxeo.ecm.webengine.app.jersey.WebEngineServlet.containerService(WebEngineServlet.java:72) [nuxeo-webengine-core-10.3-I20181203_2333.jar:?]
      	at org.nuxeo.ecm.webengine.app.jersey.WebEngineServlet.service(WebEngineServlet.java:56) [nuxeo-webengine-core-10.3-I20181203_2333.jar:?]
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) [servlet-api.jar:?]
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) [catalina.jar:9.0.12]
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [catalina.jar:9.0.12]
      	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) [tomcat-websocket.jar:9.0.12]
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [catalina.jar:9.0.12]
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [catalina.jar:9.0.12]
      	at org.nuxeo.elasticsearch.ElasticSearchFilter.doFilter(ElasticSearchFilter.java:55) [nuxeo-elasticsearch-core-10.3-I20181203_2333.jar:?]
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [catalina.jar:9.0.12]
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [catalina.jar:9.0.12]
      	at org.nuxeo.ecm.webengine.jaxrs.session.SessionCleanupFilter.run(SessionCleanupFilter.java:50) [nuxeo-webengine-jaxrs-10.3-I20181203_2333.jar:?]
      	at...
      

        Attachments

          Issue Links

            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 hour
                  1h