Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

AEM - package garbage collection not working for me

Avatar

Level 7

hi folks,

I want to delete old packages so I created this osgi configuration for my server

com.adobe.acs.commons.packagegarbagecollector.PackageGarbageCollectionConfig.xml

 

I entered the following XML, intending to delete the packages in my_packages group older than 30 days every hour.

<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
          jcr:primaryType="sling:OsgiConfig"
          scheduler="0 0 0/1 1/1 * ? *"
         maxAgeInDays="30"
          groupName="my_packages
          removeNotInstalledPackages="false"/>

However, after the code is deployed, the hour has come and gone and no sign of any INFO statements in the logs indicating that it has deleted the packages.

(https://adobe-consulting-services.github.io/acs-aem-commons/features/package-garbage-collector/inde...)

 

All I see is this.

*INFO* [JcrInstaller.1] org.apache.sling.installer.provider.jcr.impl.JcrInstaller Registering resource with OSGi installer: [InstallableResource, priority=202, id=/apps/zzz/config.author.dev/com.adobe.acs.commons.packagegarbagecollector.PackageGarbageCollectionConfig, InstallableResource, priority=202, id=/apps/zzz/config.author.dev/com.day.cq.commons.impl.ExternalizerImpl, InstallableResource, priority=202, id=/apps/zzz/config.author.dev/com.adobe.acs.commons.wcm.impl.SiteMapServlet-sample, InstallableResource, priority=202, id=/apps/zzz/config.author.dev/com.zzz.filter.zzzRequestFilter]

 

any ideas anyone?

thanks

Fiona

 

 

 

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

I assume it’s not for AAEMaaCS. After code deployment do you this service being registered at Felix console?

 

View solution in original post

5 Replies

Avatar

Correct answer by
Community Advisor

I assume it’s not for AAEMaaCS. After code deployment do you this service being registered at Felix console?

 

Avatar

Level 7

Thanks for replying. No it is an AMS installation, 6.5.x

After code deployment, I see this service in "bundles" and it is active. I also see the config in configMgr as I configured it.

thanks

Fiona

Avatar

Community Advisor

Can you change the configuration to run every 9:30 am and delete the package age of 1 day to see if the utility is working:

<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
          jcr:primaryType="sling:OsgiConfig"
          scheduler="0 30 9 ? * * *"
         maxAgeInDays="1"
          groupName="my_packages
          removeNotInstalledPackages="false"/>

 

Please note that the garbage collector will not remove the currently installed version of any packages that meet the age and group name criteria. Also, it is not compatible in AEM as cloud.

Avatar

Level 7

Thanks for your response!,

My AEM installation is not Cloud Service, it is AMS  AEM 6.5.

I updated the configuration as you suggested but nothing happened at 9.30

(time according to the server 'date' command. )

 

I do see the configuration in  system/console/configMgr.

I also  see it in system/console/bundles and it is active.

Is there a way to kick it off without having to schedule it I wonder , just to test it works?

Most of the packages in the group are just random content that I took to test things..

the code is in another group.


	PackageGarbagecollector.core
Version	1.1.0
Bundle Location	jcrinstall:/apps/ams_performance-packages/application/install/PackageGarbagecollector.core-1.1.0.jar
Last Modification	Wed May 24 15:37:03 UTC 2023
Description	AMS Package Purge Package Garbage Collector
Start Level	20
Exported Packages	com.adobe.aem.ams.performance.packagegarbagecollector,version=1.1.0
Imported Packages	javax.annotation,version=1.3.0 from org.apache.geronimo.specs.geronimo-annotation_1.3_spec (608)
javax.jcr,version=2.0.0 from org.apache.sling.jcr.jcr-wrapper (118)
javax.jcr,version=1.1.0 from org.apache.sling.jcr.jcr-wrapper (118)
org.apache.jackrabbit.vault.packaging,version=2.8.0 from org.apache.jackrabbit.vault (126)
org.apache.sling.api.resource,version=2.12.1 from org.apache.sling.api (584)
org.apache.sling.event.jobs,version=2.0.1 from org.apache.sling.event (478)
org.apache.sling.event.jobs.consumer,version=1.2.1 from org.apache.sling.event (478)
org.slf4j,version=1.7.25 from slf4j.api (12)
Service ID 31789	Types: org.apache.sling.event.jobs.consumer.JobConsumer
Component Name: com.adobe.aem.ams.performance.packagegarbagecollector.PackageGarbageCo

 

Avatar

Level 7

Thanks. Actually I think my problem was that I configured the package garbage collector via a OSGi config file. When i ran it manually from system/console/configMgr it worked o.k.