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

[timebox] Document remains checked out if nuxeo drive fails to open file

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Cannot Reproduce
    • Affects Version/s: 9.10-HF24
    • Fix Version/s: None
    • Component/s: Nuxeo Drive
    • Environment:
      windows, fedora 26
    • Tags:
    • Backlog priority:
      500
    • Sprint:
      nxDrive 11.1.3
    • Story Points:
      2

      Description

      In circumstances where the local system does not have a default program to open a specific filetype, nuxeo drive seems to fail and leave the document checked out.

      Upload a .srt file and try to edit via nuxeo drive
      if local system does not have a default program to open .srt files, nuxeo drive will not open the file
      trigger an operation that will copy the document, exception occurs

      Stack Trace:
      Failed to invoke operation: Document.CreateDerivativeFromCurrentDocument, Failed to invoke operation Document.CreateDerivativeFromCurrentDocument, Already checked out
      stacktraceorg.nuxeo.ecm.core.api.NuxeoException: Failed to invoke operation: Document.CreateDerivativeFromCurrentDocument, Failed to invoke operation Document.CreateDerivativeFromCurrentDocument, Already checked out
      at org.nuxeo.ecm.core.storage.dbs.DBSSession.checkOut(DBSSession.java:536)
      at org.nuxeo.ecm.core.storage.dbs.DBSDocument.checkOut(DBSDocument.java:534)
      at org.nuxeo.ecm.core.versioning.StandardVersioningService.doCheckOut(StandardVersioningService.java:372)
      at org.nuxeo.ecm.core.versioning.VersioningComponent.doCheckOut(VersioningComponent.java:436)
      at org.nuxeo.ecm.core.api.AbstractSession.checkOut(AbstractSession.java:1864)
      at org.nuxeo.ecm.core.api.impl.DocumentModelImpl.checkOut(DocumentModelImpl.java:665)
      at org.nuxeo.ecm.core.versioning.StandardVersioningService.doAutomaticVersioning(StandardVersioningService.java:505)
      at org.nuxeo.ecm.core.versioning.VersioningComponent.doAutomaticVersioning(VersioningComponent.java:441)
      at org.nuxeo.ecm.core.api.AbstractSession.saveDocument(AbstractSession.java:1568)
      at com.sai.global.core.operation.CreateDerivativeFromCurrentDocument.run(CreateDerivativeFromCurrentDocument.java:63)
      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.nuxeo.ecm.automation.core.impl.InvokableMethod.doInvoke(InvokableMethod.java:173)
      at org.nuxeo.ecm.automation.core.impl.InvokableMethod.invoke(InvokableMethod.java:178)
      at org.nuxeo.ecm.automation.core.impl.OperationChainCompiler$OperationMethod.invoke(OperationChainCompiler.java:151)
      at org.nuxeo.ecm.automation.core.impl.OperationChainCompiler$CompiledChainImpl.lambda$invoke$0(OperationChainCompiler.java:218)
      at org.nuxeo.ecm.automation.OperationContext.call(OperationContext.java:328)
      at org.nuxeo.ecm.automation.OperationContext.callWithChainParameters(OperationContext.java:293)
      at org.nuxeo.ecm.automation.core.impl.OperationChainCompiler$CompiledChainImpl.invoke(OperationChainCompiler.java:215)
      at org.nuxeo.ecm.automation.core.impl.OperationServiceImpl.run(OperationServiceImpl.java:115)
      at org.nuxeo.ecm.automation.core.impl.OperationServiceImpl.lambda$run$0(OperationServiceImpl.java:105)
      at org.nuxeo.ecm.automation.OperationContext.call(OperationContext.java:328)
      at org.nuxeo.ecm.automation.OperationContext.callWithChainParameters(OperationContext.java:293)
      at org.nuxeo.ecm.automation.core.impl.OperationServiceImpl.run(OperationServiceImpl.java:105)
      at org.nuxeo.ecm.automation.server.jaxrs.OperationResource.execute(OperationResource.java:58)
      at org.nuxeo.ecm.automation.server.jaxrs.ExecutableResource.doPost(ExecutableResource.java:70)
      at sun.reflect.GeneratedMethodAccessor228.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
      at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ObjectOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:258)
      at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
      at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:302)
      at com.sun.jersey.server.impl.uri.rules.SubLocatorRule.accept(SubLocatorRule.java:137)
      at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
      at com.sun.jersey.server.impl.uri.rules.SubLocatorRule.accept(SubLocatorRule.java:137)
      at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
      at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)
      at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
      at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)
      at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1542)
      at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1473)
      at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1419)
      at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1409)
      at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:409)
      at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:558)
      at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:733)
      at org.nuxeo.ecm.webengine.app.jersey.WebEngineServlet.containerService(WebEngineServlet.java:72)
      at org.nuxeo.ecm.webengine.app.jersey.WebEngineServlet.service(WebEngineServlet.java:56)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      at org.nuxeo.elasticsearch.ElasticSearchFilter.doFilter(ElasticSearchFilter.java:55)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      at org.nuxeo.ecm.webengine.jaxrs.session.SessionCleanupFilter.run(SessionCleanupFilter.java:50)
      at org.nuxeo.ecm.webengine.jaxrs.HttpFilter.doFilter(HttpFilter.java:49)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      at org.nuxeo.ecm.webengine.app.WebEngineFilter$UnitOfWork.doFilter(WebEngineFilter.java:102)
      at org.nuxeo.ecm.webengine.app.WebEngineFilter$UnitOfWork.access$100(WebEngineFilter.java:79)
      at org.nuxeo.ecm.webengine.app.WebEngineFilter.doFilter(WebEngineFilter.java:76)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      at org.nuxeo.ecm.webengine.jaxrs.context.RequestContextFilter.run(RequestContextFilter.java:48)
      at org.nuxeo.ecm.webengine.jaxrs.HttpFilter.doFilter(HttpFilter.java:49)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      at org.nuxeo.ecm.webengine.app.HeaderFixFilter.run(HeaderFixFilter.java:62)
      at org.nuxeo.ecm.webengine.ja
      

      Operation for Copy:

      @OperationMethod
          public DocumentModel run(DocumentModel doc) throws OperationException {
      
              if (doc.getType().equals(DOC_ANSWER) || doc.getType().equals(DOC_FEEDBACK)) {
                  logger.warn("Cannot create derivative document from this document type.");
                  return null;
              }
      
              UuidBuilder uuidBuilder = Framework.getService(UuidBuilder.class);
      
              String parentLifecycle = doc.getCurrentLifeCycleState();
      
              path = doc.getPathAsString();
              PathRef pathRef = new PathRef(path.substring(0, path.lastIndexOf("/")));
      
              DocumentModel newDoc = session.copy(doc.getRef(), pathRef, doc.getTitle() + CHILD_NAME_EXTENSION);
              newDoc.setPropertyValue(DC_TITLE, doc.getPropertyValue(DC_TITLE) + CHILD_NAME_EXTENSION);
              newDoc.setPropertyValue(DERIVATIVE_PARENT, uuidBuilder.buildAssetUUID(doc));
      
              // Move the document back to draft
              if (parentLifecycle.equals(SAIConstants.APPROVED)) {
                  newDoc.followTransition(SAIConstants.TO_DRAFT);
              }
      
              session.saveDocument(newDoc);
              session.save();
      
              return newDoc;
          }
      

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 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 - 4 hours
                4h