Rebuild client libraries error | Community
Skip to main content
New Participant
November 8, 2016
Solved

Rebuild client libraries error

  • November 8, 2016
  • 15 replies
  • 16957 views

I'm having trouble rebuilding the client libraries in our AEM author instance when using this URL: /libs/granite/ui/content/dumplibs.rebuild.html

I am following the same process I have always done which is to invalidate the caches first then rebuild them.

I've attached a screenshot of the errors I am getting.

The only thing that has changed configuration-wise on this AEM server since this process last worked was the installation of Communities Feature Pack 5 1.8.448.

Has anyone seen this before and potentially give advice on how to resolve it?

Alistair

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by donwalling

Hi,

We've confirmed that there is an incompatibility between Communities FP5 and FP6 and the Invalidate Caches function.  Communities FP5 requires com.adobe.granite.ui.clientlibs.content-1.0.4.zip for some of the admin ui screens. That package introduces a serviceuser "clientlibs-service" for manipulating the /var/clientlibs directory. The dumplibs.rebuild.html script in 6.1 which is in a different package does not use the serviceuser, and is coded to remove the /var/clientlibs directory during invalidation. When rebuild is triggered, the serviceuser does not have sufficient privileges to recreate the /var/clientlibs directory. A workaround is as follows:

1. Confirm the system does still have the /var/clientlibs folder intact. If it does not have that folder, recreate it and grant the clientlibs-service principal the jcr:read and rep:write privileges. This returns the system to the correct initial condition

2. Prevent future deletions of the folder by modifying /libs/granite/ui/components/dumplibs/rebuild.jsp as follows:

a) delete the following 2 lines of code, which should currently be lines 85 and 86 in the file:  

s.getNode(TMP_LOCATION).remove(); s.save();

b) add the following code in its place:

NodeIterator nodeIt = s.getNode(TMP_LOCATION).getNodes(); while (nodeIt.hasNext()) { Node child = (Node) nodeIt.next(); if (!"rep:policy".equals(child.getName())) { child.remove(); } } if (s.hasPendingChanges()) { s.save(); }

 

This is the approach being used in AEM 6.2 and later with the clientlibs-service user

HTH,

Don

15 replies

JK_Kendall
New Participant
November 10, 2016

Hi Alistair,

For AEM 6.1, the most recent service pack is SP2.

Information about SP2 and a subsequent cumulative fix pack (CFP) is on AEM Help hotfix page.

Notice - you no longer need to explicitly install 6640 and 6680.  And even though Communities FP5 will indicate they're missing, they're not.  The code is contained in the service pack, but the actual HF packages are not present.  It is necessary to retain this warning in case AEM 6.1 is installed without service packs.

- JK

Employee
November 10, 2016

The only step i missed is installing the service pack 1. So let me try and respond back.

Thanks

New Participant
November 10, 2016

Hey, thanks for the reply.

For my own sanity I've gone back to try and reproduce the error myself from scratch starting with a completely new AEM 6.1 installation. To be certain that it was the FP5 package causing the problem I installed all additional packages we have on our server in increments. After each installation, I restarted the server then ran the invalidate / rebuild clientlibs steps. These are the packages I installed:

  • 6.1 service pack 1
  • 6640 & 6680
  • Communities FP3
  • Communities FP5

After each installation the invalidate caches step worked fine. The rebuild libs step also worked fine except for FP5. Once I got to that package, I started getting the same errors I had in the screenshot.

I'm not sure if it is a permissions problem on /var/clientlibs because this folder gets removed during the first step to invalidate the caches. On two of our systems, my local one and our dev server, I can see that when I install FP5 the rebuild libraries step conks out.

Employee
November 9, 2016

Sorry for the delay, I was try to set up a system with 1.8.448 Uber. I couldnt reproduce the issue.

After seeing the screenshot, my bet would be to double check the ACLs on /var/clientlibs or ACLs at /apps/acs-commons

Thanks

Employee
November 8, 2016

Hi Alistair,

Its highly possible one of the JS/CSS files is not able to minify when you build the client libraries using the /libs/granite/ui/content/dumplibs.rebuild.html

I will try on 1.8.448 and respond back.

Thanks