Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-11221

Trouble upgrading packages in Sling Feature Launcher

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • Installer Packages Factory 1.0.4, Feature Model Launcher 1.1.26
    • None
    • Starter
    • None

    Description

      Hi!

      I'm currently exploring how to use the Sling feature launcher in practice, and stumble over the following problem. It is nicely possible to install content and application packages by using a feature like e.g. this:

      {
        "id": "com.composum.platform:composum-startup-featurelauncher:slingosgifeature:somewildtry:1.0.0-SNAPSHOT",
        "title": "install a package",
        "content-packages:ARTIFACTS|required": [
          {
            "id": "com.composum.platform:composum-platform-commons-package:zip:1.4.0"
          }
        ]
      }
      

      Now suppose I have run the application for a while and want to upgrade that package to version 1.5.0. If I just change the version number of the package (and the feature id), I actually see both versions of the package installed in the package manager. When I look into the logfile, there was actually an attempt to deinstall the package, but that fails due to "Unable to uninstall package. No snapshot present." (full stacktrace below).

      BTW: the same thing happens if I copy a package into launcher/install and then remove it to replace it with a new version.

      I'm not quite sure what should happen here, but I think the old package should be gone when given in a feature. That could mean creating a snapshot when installing the package (which likely has doubtful value), or just deleting the old package.

      Stacktrace:

      17.03.2022 17:44:03.787 *ERROR* [OsgiInstallerImpl] org.apache.sling.installer.factory.packages.impl.PackageTransformer Error while processing uninstall content package task of TaskResource(url=cloudlauncher:/Users/hps/dev/composum/sling/sling starter/target/launcher/cache/com/composum/platform/composum-platform-commons-package/1.4.0/composum-platform-commons-package-1.4.0.zip, entity=content package:com/composum/platform:composum-platform-commons-package, state=UNINSTALL, attributes=[Bundle-Version=1.4.0, org.apache.sling.installer.api.tasks.ResourceTransformer=:24:28:655:, package-id=com/composum/platform:composum-platform-commons-package:1.4.0], digest=/Users/hps/dev/composum/sling/sling-starter/target/launcher/cache/com/composum/platform/composum-platform-commons-package/1.4.0/composum-platform-commons-package-1.4.0.zip) due to Unable to uninstall package. No snapshot present., no retry. org.apache.jackrabbit.vault.packaging.PackageException: Unable to uninstall package. No snapshot present.
      at org.apache.jackrabbit.vault.packaging.impl.JcrPackageImpl.uninstall(JcrPackageImpl.java:1004) [org.apache.jackrabbit.vault:3.5.6]
      at org.apache.jackrabbit.vault.packaging.impl.JcrPackageImpl.uninstall(JcrPackageImpl.java:982) [org.apache.jackrabbit.vault:3.5.6]
      at org.apache.sling.installer.factory.packages.impl.PackageTransformer$UninstallPackageTask.doExecute(PackageTransformer.java:405) [org.apac he.sling.installer.factory.packages:1.0.4]
      at org.apache.sling.installer.factory.packages.impl.PackageTransformer$AbstractPackageInstallTask.execute(PackageTransformer.java:269) [org. apache.sling.installer.factory.packages:1.0.4]
      at org.apache.sling.installer.core.impl.OsgiInstallerImpl.doExecuteTasks(OsgiInstallerImpl.java:918) [org.apache.sling.installer.core:3.12.0 ]
      at org.apache.sling.installer.core.impl.OsgiInstallerImpl.executeTasks(OsgiInstallerImpl.java:755) [org.apache.sling.installer.core:3.12.0]
      at org.apache.sling.installer.core.impl.OsgiInstallerImpl.run(OsgiInstallerImpl.java:304) [org.apache.sling.installer.core:3.12.0]
      at java.base/java.lang.Thread.run(Thread.java:834)
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            hanspeterstoerr Hans-Peter Stoerr
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: