Bug #35

Cannot use different pivotAttrs between source and destination

Added by Clément Oudot over 1 year ago. Updated 5 months ago.

Status:New Start:23/02/2009
Priority:High Due date:
Assigned to:- % Done:

0%

Category:Core
Target version:1.2.x branch Estimated time:8.00 hours
Problem in version:

Description

Hello,

This configuration fails:

lsc.tasks.user.dstService = org.lsc.jndi.SimpleJndiDstService
lsc.tasks.user.dstService.attrs = uid cn sn givenName mail telephoneNumber sAMAccountName userPrincipalName userAccountControl unicodePwd displayName objectClass
lsc.tasks.user.dstService.baseDn = ou=users
lsc.tasks.user.dstService.filterAll = (objectClass=user)
lsc.tasks.user.dstService.filterId = (&(objectClass=user)(sAMAccountName={loginname}))
lsc.tasks.user.dstService.pivotAttrs = samaccountname

lsc.tasks.user.srcService = org.lsc.jndi.SimpleJndiSrcService
lsc.tasks.user.srcService.attrs = uid cn mail telephoneNumber loginName 
lsc.tasks.user.srcService.baseDn = ou=People
lsc.tasks.user.srcService.filterAll = (objectClass=Person)
lsc.tasks.user.srcService.filterId = (&(objectClass=Person)(loginName={samaccountname}))
lsc.tasks.user.srcService.pivotAttrs = loginname

LSC shows errors as:

     [java] 212  [main] ERROR  org.lsc.AbstractSynchronize.synchronize2Ldap(AbstractSynchronize.java:303)   - Unable to get object for id=uid=1A5AF9F102F8DB315D776F,ou=People,o=linagora=null
     [java] 219  [main] ERROR  org.lsc.AbstractSynchronize.synchronize2Ldap(AbstractSynchronize.java:303)   - Unable to get object for id=uid=1A5AF9F102F8DB315D776E,ou=People,o=linagora=null

And OpenLDAP (source) shows:

conn=21 op=33 SRCH base="ou=People,o=linagora" scope=2 deref=0 filter="(&(objectClass=Person)(loginName={samaccountname}))" 
conn=21 op=33 SRCH attr=uid cn mail telephonenumber loginname
<= bdb_equality_candidates: (loginName) not indexed
conn=21 op=33 SEARCH RESULT tag=101 err=0 nentries=0 text=

The synchronization works great with "uid" as source and destination pivotAttrs


Related issues

duplicated by Feature #15: Have different pivots for a specific action type, update/create and delete (filterId) Rejected 02/01/2009

History

Updated by Clément Oudot over 1 year ago

  • Category set to Core
  • Status changed from New to Assigned
  • Assigned to set to Jonathan Clarke
  • Priority changed from Normal to High

Hello,

I write a new connector (AD->OpenLDAP) and I face again this pb.

The search on the source directory succeed, but in AbstractSynchronize.java, line 298, this call returns empty result:

 LscObject lscObject = srcService.getObject(id);

So I get this error:

     [java] 140  [main] DEBUG  org.lsc.AbstractSynchronize.synchronize2Ldap(AbstractSynchronize.java:295)   - Synchronizing org.lsc.objects.user for CN=ta ta,OU=Users,OU=CIRRA,DC=dam,DC=local=null
     [java] 140  [main] ERROR  org.lsc.AbstractSynchronize.synchronize2Ldap(AbstractSynchronize.java:303)   - Unable to get object for id=CN=ta ta,OU=Users,OU=CIRRA,DC=dam,DC=local=null

The config is:

lsc.tasks = inetOrgPerson
lsc.tasks.inetOrgPerson.type = ldap2ldap
lsc.tasks.inetOrgPerson.bean = org.lsc.beans.inetOrgPersonBean
lsc.tasks.inetOrgPerson.object = org.lsc.objects.user

lsc.tasks.inetOrgPerson.dn = \"uid=\" + srcBean.getAttributeValueById(\"sAMAccountName\") + \",ou=users\" 

lsc.tasks.inetOrgPerson.srcService = org.lsc.jndi.SimpleJndiSrcService
lsc.tasks.inetOrgPerson.srcService.attrs = sn displayName mail sAMAccountName telephoneNumber
lsc.tasks.inetOrgPerson.srcService.pivotAttrs = sAMAccountName
lsc.tasks.inetOrgPerson.srcService.filterId = (&(objectClass=user)(sAMAccountName={uid}))
lsc.tasks.inetOrgPerson.srcService.filterAll = (objectClass=user)
lsc.tasks.inetOrgPerson.srcService.baseDn = ou=cirra

lsc.tasks.inetOrgPerson.dstService = org.lsc.jndi.SimpleJndiDstService
lsc.tasks.inetOrgPerson.dstService.attrs = uid cn sn mail userPassword objectClass telephoneNumber
lsc.tasks.inetOrgPerson.dstService.pivotAttrs = uid
lsc.tasks.inetOrgPerson.dstService.filterId = (&(objectClass=inetOrgPerson)(uid={sAMAccountName}))
lsc.tasks.inetOrgPerson.dstService.filterAll = (&(objectClass=inetOrgPerson)(employeeType=interne))
lsc.tasks.inetOrgPerson.dstService.baseDn = ou=users

Thanks for your help.

Updated by Clément Oudot over 1 year ago

Hello,

I spend time on this problem today.

The "bug" is that LSC use the source filterId just after searching all source entries, and so does not have any value for the distant pivot attribute, so the search does not success.

I can make it works by using an "OR" in filterId :

lsc.tasks.inetOrgPerson.srcService = org.lsc.jndi.SimpleJndiSrcService
lsc.tasks.inetOrgPerson.srcService.attrs = sn displayName mail sAMAccountName telephoneNumber
lsc.tasks.inetOrgPerson.srcService.pivotAttrs = sAMAccountName
lsc.tasks.inetOrgPerson.srcService.filterId = (&(objectClass=user)(|(sAMAccountName={samaccountname})(sAMAccountName={uid})))
lsc.tasks.inetOrgPerson.srcService.filterAll = (objectClass=user)
lsc.tasks.inetOrgPerson.srcService.baseDn = ou=cirra

lsc.tasks.inetOrgPerson.dstService = org.lsc.jndi.SimpleJndiDstService
lsc.tasks.inetOrgPerson.dstService.attrs = uid cn sn mail userPassword objectClass telephoneNumber
lsc.tasks.inetOrgPerson.dstService.pivotAttrs = uid
lsc.tasks.inetOrgPerson.dstService.filterId = (&(objectClass=inetOrgPerson)(|(uid={samaccountname})(uid={uid})))
lsc.tasks.inetOrgPerson.dstService.filterAll = (&(objectClass=inetOrgPerson)(employeeType=interne))
lsc.tasks.inetOrgPerson.dstService.baseDn = ou=users

So with this solution, we find the entry with any of the source or distant pivot attribute.

I don't know if we can consider that the bug is closed, because it not really a clean method. I let you examine this.

Thanks to Remy and Jonathan for their help.

Clément.

Updated by Sébastien Bahloul over 1 year ago

  • Estimated time set to 8.00

Target: must include a filterIdSync and filterIdClean if needed. Default to filterId

Updated by Jonathan Clarke about 1 year ago

  • Target version changed from 1.1.0 to 1.1.1

Since there is a workaround for this issue, retargeting for 1.1.1.

Just a reminder: the workaround is using a "OR" operator in broken filters, such as:

lsc.tasks.inetOrgPerson.srcService.pivotAttrs = sAMAccountName
lsc.tasks.inetOrgPerson.srcService.filterId = (&(objectClass=user)(|(sAMAccountName={samaccountname})(sAMAccountName={uid})))
lsc.tasks.inetOrgPerson.dstService.pivotAttrs = uid
lsc.tasks.inetOrgPerson.dstService.filterId = (&(objectClass=inetOrgPerson)(|(uid={samaccountname})(uid={uid})))

Updated by Jonathan Clarke 9 months ago

  • Target version changed from 1.1.1 to 1.1.x branch

Retargeting for a future release in 1.1 branch. 1.1.1 will be released without this, since a workaround exists. Patches welcome :)

Updated by Jonathan Clarke 5 months ago

  • Status changed from Assigned to New
  • Assigned to deleted (Jonathan Clarke)
  • Target version changed from 1.1.x branch to 1.2.x branch

This won't be implented in the 1.1 branch now, since all development focus is on 1.2 and future versions.

Retargeting for 1.2.x. Removing myself as "assigned", since I'm not working on this at the moment. Any contributions welcome :)

Also available in: Atom PDF