You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Konrad Windszus (Jira)" <ji...@apache.org> on 2022/03/24 19:15:00 UTC

[jira] [Updated] (SLING-11221) Trouble upgrading packages in Sling Feature Launcher

     [ https://issues.apache.org/jira/browse/SLING-11221?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Konrad Windszus updated SLING-11221:
------------------------------------
    Affects Version/s: Installer Packages Factory 1.0.4

> Trouble upgrading packages in Sling Feature Launcher
> ----------------------------------------------------
>
>                 Key: SLING-11221
>                 URL: https://issues.apache.org/jira/browse/SLING-11221
>             Project: Sling
>          Issue Type: Bug
>          Components: Starter
>    Affects Versions: Installer Packages Factory 1.0.4, Feature Model Launcher 1.1.26
>            Reporter: Hans-Peter Stoerr
>            Priority: Major
>
> 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:
> {code:json}
> {
>   "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"
>     }
>   ]
> }
> {code}
> 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:
> {code}
> 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)
> {code}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)