Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Cleaning up of Orphan Pages/Nodes

teamu33465496
Level 2
Level 2

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
teamu33465496
Level 2
Level 2

Hey Donald,

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

smacdonald2008
Level 10
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

smacdonald2008
Level 10
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/

Jörg_Hoh
Employee
Employee

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

teamu33465496
Level 2
Level 2

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.

Gaurav-Behl
Community Advisor
Community Advisor

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

Jörg_Hoh
Employee
Employee

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