Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.

Cleaning up of Orphan Pages/Nodes

Avatar

Former Community Member

We have lot of below errors in our environment which are basically Orphan Nodes. Is there a way to clean up all the Orphan Nodes in our environment(not manually)?

We can write a script for that but I am not sure How to find all the orphan Nodes, do we have any similar property for identifying them?

No renderer for extension html, cannot render resource JcrNodeResource, type=nt:unstructured, superType=null, path=/content/envNode/www/en-us/banner-repository/banners/jcr:content/root/responsivegrid/custom_wrapper_58983/par/banner_container_cop_1825745486/par/par_copy/responsivegrid/spacer_copy_9611926

org.apache.sling.servlets.get.impl.DefaultGetServlet

9 Replies

Avatar

Level 10

See this AEM Docs topic - it will help you -- Revision Cleanup

Avatar

Former Community Member

Hey Donald,

We have been doing the online revision clean up but we still have the nodes which were orphan.

Avatar

Level 10

I checked with customer support - they have replied:

They need to create a groovy script with some logic that they can use to run and delete it

Avatar

Level 10

Team replied:

The script needs to have a logic to fin nodes that they are considering as orphan.

Like it’s orphan because of a location, or name or type of node…

There are a lot of sample on the net. For example: https://hashimkhan.in/aem-adobecq5-code-templates/groovy-script/

Avatar

Employee Advisor

Hi,

First of all, these are not orphaned nodes ...

No renderer for extension html, cannot render resource JcrNodeResource, type=nt:unstructured, superType=null, path=/content/envNode/www/en-us/banner-repository/banners/jcr:content/root/responsivegrid /custom_wrapper_58983/par/banner_container_cop_1825745486/par/par_copy/responsivegrid/spac er_copy_9611926

This means, that you have a resource which has no rendering information attached to it (most likely it is missing a resource type), but it is included in the rendering process. Use the "Recent Requests" page in the OSGI webconsole to find out which component in the hierarchy is including it. In your case I assume that you have a responsivegrid which iterates over its child resources and includes them (which is failing here).

So its not a really orphaned node but it served some purpose.

You should fix it, and I don't know if it's the right way just to delete them. You should define detailled criteria how to identify these resources. And then you should implement a custom cleanup process, maybe sling pipes might be a good framework to implement it.

Jörg

Avatar

Former Community Member

Hi Jorg,

We have decide that they are Orphan because they have no property  attached to it. It is difficult to manually go through all the nodes and check which node has no property attached to it. We want to run a script which deletes the Orphan Nodes on a regular basis.

Avatar

Level 10

If you really want to go down this route then use this -- On-Deploy Scripts​.  Provide a custom implementation using some business logic and execute it after understanding pros/cons. Take a backup, just in case if you happen to delete something that is a required functionality.

If you want to run it periodically, then create it as a service, attach a handler and run it via cron/jenkins/sling scheduler or similar at specified intervals.

HTH

Avatar

Employee Advisor

You should not need to run this on a regular basis; in that case you would create constantly new nodes, which means your templates and components add "orphans" when they are inserted. And this would mean that your templates and components are not well maintained in the first place.

Jörg