You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@sling.apache.org by "Dr. Hans-Peter Störr" <sp...@planet.ms> on 2022/03/17 16:57:33 UTC
Sling feature launcher: how to upgrade packages?
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. How would I do that? 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." Am I doing something wrong, or is this a bug?
BTW: the same thing happens if I copy a package into launcher/install and then remove it to replace it with a new version.
Thank you!
Best regards,
Hans-Peter
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)
Aw: Re: Sling feature launcher: how to upgrade packages?
Posted by "Dr. Hans-Peter Störr" <ha...@email.de>.
Hi Konrad!
I created https://issues.apache.org/jira/browse/SLING-11221 for that.
I'm not quite sure, but it's probably a sensible thing to just delete the package if the uninstall fails. Otherwise it did interfere in the installation process for us. Thank you!
Best regards,
Hans-Peter
> Gesendet: Donnerstag, 17. März 2022 um 18:01 Uhr
> Von: "Konrad Windszus" <ko...@gmx.de>
> An: users@sling.apache.org
> Betreff: Re: Sling feature launcher: how to upgrade packages?
>
> Sounds like a bug to me, please create a JIRA ticket. Not sure what to do though when no snapshot is present, probably just removing the package itself without trying to revert any contained content is the most reasonable action here. What would you expect to happen when content packages are removed?
>
> Thanks,
> Konrad
Re: Sling feature launcher: how to upgrade packages?
Posted by Konrad Windszus <ko...@gmx.de>.
Sounds like a bug to me, please create a JIRA ticket. Not sure what to do though when no snapshot is present, probably just removing the package itself without trying to revert any contained content is the most reasonable action here. What would you expect to happen when content packages are removed?
Thanks,
Konrad
> On 17. Mar 2022, at 17:57, Dr. Hans-Peter Störr <sp...@planet.ms> wrote:
>
> 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. How would I do that? 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." Am I doing something wrong, or is this a bug?
> BTW: the same thing happens if I copy a package into launcher/install and then remove it to replace it with a new version.
> Thank you!
>
> Best regards,
>
> Hans-Peter
>
> 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)
>
>
>
>