How to debug the User and Group synchro from LDAP ?

March 13, 2009

Trying to debug the User and Group synchronization process (from LDAP) might be a complex task.
Here are some tips and tricks to better understand how it works:

Basically, you should know this process is based on the following principles:
– A first Alfresco process connects to the source LDAP, and then creates 2 XML output files (list of Users and list of Groups),
– Then a second process runs to parse the XML file and perform the corresponding import tasks into the Alfresco repository.

1/ Of course the first task is to enable LDAP synchronization. To do so you will have to configure the following files:

I will not detail this part here. You can find more info here.
So for the next section of this post, I will assume LDAP synchro has been enabled.


2/ Disable the temporary file cleaner task to be able to see the result of the User/Group export tasks:

This operation is mandatory, because without it you will not be able to see what is the output result of the export process. This is because Alfresco consider daily export files as temporary files and deletes them.

Edit the file : scheduled-jobs-context.xml
(should be here : “/home/alfresco/tomcat/webapps/alfresco/WEB-INF/classes/alfresco”)

And comment the following bean:

 <bean id=”tempFileCleanerTrigger” class=”org.alfresco.util.TriggerBean”>


Then restart the server, and wait for the LDAP synchro to run.
At the end of the User/Group export, you should see 2 new files in:




One is for Users, the other is for Groups.


3/ Check the consistency of export files:

In some cases, especially if the export files are too big, they might not be properly terminated (xml file is not complete).
So it is important to verify that the output files are properly formated (valid XML file).

– Open the Group export file, and verify that it ends properly with the “</view:view>” tag, as follows:

<?xml version=”1.0″ encoding=”UTF-8″?>
<view:view xmlns:view=(list of namespace here)>
   <usr:authorityContainer view:childName=”usr:GROUP_APP_ALFRESCO_EUROPE” view:id=”08af8a56-0f6c-11de-a3e9-4d545cfc49d0″>



– Open the Users export file, and verify that it ends properly with the “</view:view>” tag, as follows:

<?xml version=”1.0″ encoding=”UTF-8″?>
<view:view xmlns:view=”” xmlns:d=”” xmlns:alf=”” xmlns:nt=”” xmlns:act=”” xmlns:wf=”” xmlns:app=”” xmlns:usr=”” xmlns:ver=”” xmlns:cm=”” xmlns:sv=”” xmlns:mix=”” xmlns:jcr=”” xmlns:wcm=”” xmlns:wca=”” xmlns:sys=”” xmlns:wcmwf=”” xmlns:rule=”” xmlns:bpm=”” xmlns:fm=”” xmlns:custom=”custom.model” xmlns:reg=”” xmlns:module=”” xmlns=””>
   <cm:person view:childName=”cm:person”>

   <cm:person view:childName=”cm:person”>


4/ Enable log traces for the export/import process:

By default, there is no log traces of the export/import process.
So to know what happen exactly, you should enable at least the import traces.

Edit the file (which should be located here:

And add:

Then restart server, and wait for LDAP synchro. In the alfresco.log file you should see traces similar to:

Begin of import Group traces:
03:44:42,770 DEBUG [org.alfresco.repo.importer.view.ViewParser] Pushed ParentContext[parent=user://alfrescoUserStore/53644b61-e548-11dc-8708-09624679a589,assocType=null]
03:44:42,823 DEBUG [org.alfresco.repo.importer.view.ViewParser] Pushed NodeContext[childName=usr:GROUP_APP_ALFRESCO_EUROPE,type={}authorityContainer,nodeRef=null,aspects=[],parentContext=ParentContext[parent=user://alfrescoUserStore/53644b61-e548-11dc-8708-09624679a589,assocType=null]]
03:44:42,823 DEBUG [org.alfresco.repo.importer.view.ViewParser] Processed property {}authorityName

Begin of import Users traces:
19:06:17,984 DEBUG [org.alfresco.repo.importer.view.ViewParser] Popped NodeContext[childName=cm:person,type={}person,nodeRef=null,aspects=[ClassDef[name={}ownable]],parentContext=ParentContext[parent=workspace://SpacesStore/56404266-e548-11dc-8708-09624679a589,assocType=null]]
19:06:18,153 DEBUG [org.alfresco.repo.importer.view.ViewParser] Pushed NodeContext[childName=cm:person,type={}person,nodeRef=null,aspects=[],parentContext=ParentContext[parent=workspace://SpacesStore/56404266-e548-11dc-8708-09624679a589,assocType=null]]
19:06:18,153 DEBUG [org.alfresco.repo.importer.view.ViewParser] Processed aspect {}ownable
19:06:18,153 DEBUG [org.alfresco.repo.importer.view.ViewParser] Processed property {}owner
19:06:18,153 DEBUG [org.alfresco.repo.importer.view.ViewParser] Processed property {}userName
19:06:18,153 DEBUG [org.alfresco.repo.importer.view.ViewParser] Processed property {}firstName
19:06:18,154 DEBUG [org.alfresco.repo.importer.view.ViewParser] Processed property {}lastName
19:06:18,154 DEBUG [org.alfresco.repo.importer.view.ViewParser] Processed property {}email
19:06:18,154 DEBUG [org.alfresco.repo.importer.view.ViewParser] Processed property {}organizationId
19:06:18,154 DEBUG [org.alfresco.repo.importer.view.ViewParser] Processed property {}homeFolderProvider
19:06:18,154 DEBUG [org.alfresco.repo.importer.view.ViewParser] Processed property {}node-uuid

IMPORTANT: Please note that it might be required to customize or override the out-of-the-box Alfresco exporter/importer classes, especially to add more log traces (the default classes does not provide a lot of traces even with debug mode).

To know what classes are involved, look at the file ldap-synchronisation-context.xml. These 2 beans manage the export
and import process: