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

Fix missing JAR base-version in packages registry

    XMLWordPrintable

    Details

      Description

      When a JAR is installed with another method than the update package command (ie manually, from a configuration template or with a copy command), it is considered in the registry as the "base-version".
      However, that base-version is missing in the registry if a package providing the same JAR (in any version) with upgradeOnly="true" was previously installed.
      As a consequence, the original JAR will be lost if a package upgrading that JAR is uninstalled.

      working case
      # Manual install of nuxeo-elasticsearch-seqgen-6.0.jar
      $ touch nxserver/bundles/nuxeo-elasticsearch-seqgen-6.0.jar
      $ find . -name nuxeo-elasticsearch-seqgen*
      ./nxserver/bundles/nuxeo-elasticsearch-seqgen-6.0.jar
      ./packages/store/nuxeo-6.0-HF12-1.0.1/install/bundles/nuxeo-elasticsearch-seqgen-6.0-HF12.jar
      ./packages/store/nuxeo-6.0-HF10-1.0.0/install/bundles/nuxeo-elasticsearch-seqgen-6.0-HF10.jar
      
      $ ./bin/nuxeoctl mp-install nuxeo-6.0-HF10 --accept y -q
      $ find . -name nuxeo-elasticsearch-seqgen*
      ./nxserver/bundles/nuxeo-elasticsearch-seqgen-6.0-HF10.jar
      ./packages/backup/nxserver/bundles/nuxeo-elasticsearch-seqgen-6.0.jar
      ./packages/backup/nxserver/bundles/nuxeo-elasticsearch-seqgen-6.0-HF10.jar
      ./packages/store/nuxeo-6.0-HF12-1.0.1/install/bundles/nuxeo-elasticsearch-seqgen-6.0-HF12.jar
      ./packages/store/nuxeo-6.0-HF10-1.0.0/install/bundles/nuxeo-elasticsearch-seqgen-6.0-HF10.jar
      
      $ grep seqgen -A3 packages/registry.xml 
        <entry key="nxserver/bundles/nuxeo-elasticsearch-seqgen">
          <base-version name="6.0" path="nxserver/bundles/nuxeo-elasticsearch-seqgen-6.0.jar"/>
          <version name="6.0-HF10" path="nxserver/bundles/nuxeo-elasticsearch-seqgen-6.0-HF10.jar">
            <package upgradeOnly="true">nuxeo-6.0-HF10-1.0.0</package>
          </version>
        </entry>
      
      $ ./bin/nuxeoctl mp-uninstall nuxeo-6.0-HF10 --accept y -q
      $ find . -name nuxeo-elasticsearch-seqgen*
      ./nxserver/bundles/nuxeo-elasticsearch-seqgen-6.0.jar
      ./packages/store/nuxeo-6.0-HF12-1.0.1/install/bundles/nuxeo-elasticsearch-seqgen-6.0-HF12.jar
      ./packages/store/nuxeo-6.0-HF10-1.0.0/install/bundles/nuxeo-elasticsearch-seqgen-6.0-HF10.jar
      NOT working case 1) JAR is removed whereas the current version is not provided by 6.0-HF10
      $ ./bin/nuxeoctl mp-install nuxeo-6.0-HF10 --accept y -q
      $ find . -name nuxeo-elasticsearch-seqgen*
      ./packages/backup/nxserver/bundles/nuxeo-elasticsearch-seqgen-6.0-HF10.jar
      ./packages/store/nuxeo-6.0-HF12-1.0.1/install/bundles/nuxeo-elasticsearch-seqgen-6.0-HF12.jar
      ./packages/store/nuxeo-6.0-HF10-1.0.0/install/bundles/nuxeo-elasticsearch-seqgen-6.0-HF10.jar
      $ grep seqgen -A3 packages/registry.xml 
        <entry key="nxserver/bundles/nuxeo-elasticsearch-seqgen">
          <version name="6.0-HF10" path="nxserver/bundles/nuxeo-elasticsearch-seqgen-6.0-HF10.jar">
            <package upgradeOnly="true">nuxeo-6.0-HF10-1.0.0</package>
          </version>
        </entry>
      
      # Manual install of nuxeo-elasticsearch-seqgen-6.0.jar
      $ touch nxserver/bundles/nuxeo-elasticsearch-seqgen-6.0.jar
      $ find . -name nuxeo-elasticsearch-seqgen*
      ./nxserver/bundles/nuxeo-elasticsearch-seqgen-6.0.jar
      ./packages/backup/nxserver/bundles/nuxeo-elasticsearch-seqgen-6.0-HF10.jar
      ./packages/store/nuxeo-6.0-HF12-1.0.1/install/bundles/nuxeo-elasticsearch-seqgen-6.0-HF12.jar
      ./packages/store/nuxeo-6.0-HF10-1.0.0/install/bundles/nuxeo-elasticsearch-seqgen-6.0-HF10.jar
      
      $ ./bin/nuxeoctl mp-uninstall nuxeo-6.0-HF10 --accept y -q
      $ find . -name nuxeo-elasticsearch-seqgen*
      ./packages/store/nuxeo-6.0-HF12-1.0.1/install/bundles/nuxeo-elasticsearch-seqgen-6.0-HF12.jar
      ./packages/store/nuxeo-6.0-HF10-1.0.0/install/bundles/nuxeo-elasticsearch-seqgen-6.0-HF10.jar
      NOT working case 2) JAR is upgraded but no base-version is registered
      $ ./bin/nuxeoctl mp-install nuxeo-6.0-HF10 --accept y -q
      $ find . -name nuxeo-elasticsearch-seqgen*
      ./packages/backup/nxserver/bundles/nuxeo-elasticsearch-seqgen-6.0-HF10.jar
      ./packages/store/nuxeo-6.0-HF12-1.0.1/install/bundles/nuxeo-elasticsearch-seqgen-6.0-HF12.jar
      ./packages/store/nuxeo-6.0-HF10-1.0.0/install/bundles/nuxeo-elasticsearch-seqgen-6.0-HF10.jar
      
      $ # Manual install of nuxeo-elasticsearch-seqgen-6.0.jar
      $ touch nxserver/bundles/nuxeo-elasticsearch-seqgen-6.0.jar
      $ ./bin/nuxeoctl mp-install nuxeo-6.0-HF12 --accept y -q
      $ find . -name nuxeo-elasticsearch-seqgen*
      ./nxserver/bundles/nuxeo-elasticsearch-seqgen-6.0-HF12.jar
      ./packages/backup/nxserver/bundles/nuxeo-elasticsearch-seqgen-6.0-HF10.jar
      ./packages/backup/nxserver/bundles/nuxeo-elasticsearch-seqgen-6.0-HF12.jar
      ./packages/store/nuxeo-6.0-HF12-1.0.1/install/bundles/nuxeo-elasticsearch-seqgen-6.0-HF12.jar
      ./packages/store/nuxeo-6.0-HF10-1.0.0/install/bundles/nuxeo-elasticsearch-seqgen-6.0-HF10.jar
      $ grep seqgen -A3 packages/registry.xml 
        <entry key="nxserver/bundles/nuxeo-elasticsearch-seqgen">
          <version name="6.0-HF10" path="nxserver/bundles/nuxeo-elasticsearch-seqgen-6.0-HF10.jar">
            <package upgradeOnly="true">nuxeo-6.0-HF10-1.0.0</package>
          </version>
          <version name="6.0-HF12" path="nxserver/bundles/nuxeo-elasticsearch-seqgen-6.0-HF12.jar">
            <package upgradeOnly="true">nuxeo-6.0-HF12-1.0.1</package>
          </version>
        </entry>
        
      $ ./bin/nuxeoctl mp-uninstall nuxeo-6.0-HF12 --accept y -q
      $ find . -name nuxeo-elasticsearch-seqgen*
      ./packages/backup/nxserver/bundles/nuxeo-elasticsearch-seqgen-6.0-HF10.jar
      ./packages/store/nuxeo-6.0-HF12-1.0.1/install/bundles/nuxeo-elasticsearch-seqgen-6.0-HF12.jar
      ./packages/store/nuxeo-6.0-HF10-1.0.0/install/bundles/nuxeo-elasticsearch-seqgen-6.0-HF10.jar
      $ ./bin/nuxeoctl mp-uninstall nuxeo-6.0-HF10 --accept y -q
      $ find . -name nuxeo-elasticsearch-seqgen*
      ./packages/store/nuxeo-6.0-HF12-1.0.1/install/bundles/nuxeo-elasticsearch-seqgen-6.0-HF12.jar
      ./packages/store/nuxeo-6.0-HF10-1.0.0/install/bundles/nuxeo-elasticsearch-seqgen-6.0-HF10.jar
      

      Case 1) JAR was not installed by the package nuxeo-6.0-HF10, it should not be removed even if the base version is missing.
      Case 2) Install of nuxeo-6.0-HF12 should detect that the installed JAR is unknown to the registry (it does not come from nuxeo-6.0-HF10), so a base-version should be created and the JAR backed up.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: