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

Scripting Command PlatformHelper does not work

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 8.10-HF46, 9.10-HF34
    • Fix Version/s: 11.1, 2021.0
    • Component/s: Launcher

      Description

      If in the install section of a Marketplace package I use this command:

      <copy dir="${package.root}/install/templates" todir="${env.templates}" overwrite="true"
            if="Version.isGreater(Platform.getVersion(), '8.10')"/> 

      Then it ends up in a NPE:

      nuxeo@8e4e22427740:~$ /docker-entrypoint.sh nuxeoctl mp-install /deploy/target/nco-cloud-1.4.3-SNAPSHOT.zip
      Detected Tomcat server.
      Nuxeo home:          /opt/nuxeo/server
      Nuxeo configuration: /opt/nuxeo/server/bin/nuxeo.conf
      Include template: /opt/nuxeo/server/templates/common-base
      Include template: /opt/nuxeo/server/templates/common
      Include template: /opt/nuxeo/server/templates/default
      Added /opt/nuxeo/server/setupWizardDownloads/4a20ab58964ad2a83ee4278df456793b
      Added /opt/nuxeo/server/setupWizardDownloads/f74404db187e4f2ed4dcb0b4041d6c1d
      Added /opt/nuxeo/server/setupWizardDownloads/303a6a96f3b0f8612ea54ce95df28aa5
      Added /opt/nuxeo/server/setupWizardDownloads/bd31cd502972487faf50aecc18a2aed2
      Added /opt/nuxeo/server/setupWizardDownloads/9d92822910db0e0f6c8f060e10f6dab4
      Added /opt/nuxeo/server/setupWizardDownloads/6f98a1891068b5144c03e85fcadd079a
      Added /opt/nuxeo/server/setupWizardDownloads/939c56a289c34ca4ab737d2d34e88125
      Added /opt/nuxeo/server/setupWizardDownloads/e4741619df48c0036925fee404043c3f
      /docker-entrypoint.sh: ignoring /docker-entrypoint-initnuxeo.d/nuxeo.conf
      
      Detected Tomcat server.
      Nuxeo home:          /opt/nuxeo/server
      Nuxeo configuration: /opt/nuxeo/server/bin/nuxeo.conf
      Include template: /opt/nuxeo/server/templates/common-base
      Include template: /opt/nuxeo/server/templates/common
      Include template: /opt/nuxeo/server/templates/default
      Added /deploy/target/nco-cloud-1.4.3-SNAPSHOT.zip
      
      Dependency resolution:
          Installation order (1):        nco-cloud-1.4.3-SNAPSHOT
          Local packages to install (1): nco-cloud:1.4.3-SNAPSHOT
      
      Do you want to continue (yes/no)? [yes]
      Installing nco-cloud-1.4.3-SNAPSHOT
      Detected Tomcat server.
      Cannot execute command. null
      java.lang.NullPointerException
          at org.nuxeo.connect.update.task.guards.VersionHelper.isEqual(VersionHelper.java:29)
          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.apache.commons.jexl.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:231)
          at org.apache.commons.jexl.parser.ASTMethod.execute(ASTMethod.java:104)
          at org.apache.commons.jexl.parser.ASTReference.execute(ASTReference.java:82)
          at org.apache.commons.jexl.parser.ASTReference.value(ASTReference.java:56)
          at org.apache.commons.jexl.parser.ASTExpression.value(ASTExpression.java:53)
          at org.apache.commons.jexl.parser.ASTNotNode.value(ASTNotNode.java:55)
          at org.apache.commons.jexl.parser.ASTExpression.value(ASTExpression.java:53)
          at org.apache.commons.jexl.parser.ASTExpressionExpression.value(ASTExpressionExpression.java:55)
          at org.apache.commons.jexl.ExpressionImpl.evaluate(ExpressionImpl.java:79)
          at org.nuxeo.connect.update.task.guards.Guard.evaluate(Guard.java:68)
          at org.nuxeo.connect.update.task.standalone.commands.AbstractCommand.ignore(AbstractCommand.java:133)
          at org.nuxeo.connect.update.task.standalone.commands.AbstractCommand.run(AbstractCommand.java:112)
          at org.nuxeo.connect.update.task.standalone.CommandsTask.doRun(CommandsTask.java:119)
          at org.nuxeo.connect.update.task.standalone.InstallTask.doRun(InstallTask.java:51)
          at org.nuxeo.connect.update.task.standalone.AbstractTask.run(AbstractTask.java:247)
          at org.nuxeo.launcher.connect.ConnectBroker.performTask(ConnectBroker.java:517)
          at org.nuxeo.launcher.connect.ConnectBroker.pkgInstall(ConnectBroker.java:919)
          at org.nuxeo.launcher.connect.ConnectBroker.pkgInstall(ConnectBroker.java:852)
          at org.nuxeo.launcher.connect.ConnectBroker.pkgRequest(ConnectBroker.java:1417)
          at org.nuxeo.launcher.connect.ConnectBroker.pkgRequest(ConnectBroker.java:1226)
          at org.nuxeo.launcher.NuxeoLauncher.pkgRequest(NuxeoLauncher.java:2890)
          at org.nuxeo.launcher.NuxeoLauncher.launch(NuxeoLauncher.java:1215)
          at org.nuxeo.launcher.NuxeoLauncher.main(NuxeoLauncher.java:1103)
      

      This seems due to the fact that it is evaluated by two configuration vars in [PlatformHelper|https://github.com/nuxeo/nuxeo/blob/master/nuxeo-runtime/nuxeo-connect-standalone/src/main/java/org/nuxeo/connect/update/task/guards/PlatformHelper.java]:

       

      name = cg.getUserConfig().getProperty(Environment.DISTRIBUTION_NAME);
              version = cg.getUserConfig().getProperty(Environment.DISTRIBUTION_VERSION); 

      That evaluates to null.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: