Symptoms
- LDAP groups synchronization is enabled.
- Example
ldap-config.propertiescontents:java.naming.provider.url=ldap://<...>:389/dc=<...>,dc=localjava.naming.security.principal=cn=<...>,ou=People,dc=<...>,dc=localjava.naming.security.credentials=<...>teamcity.users.base=ou=Peopleteamcity.users.login.filter=(&(objectClass=posixAccount)(!(businessCategory=disabled))(uid=$capturedLogin$))teamcity.users.username=uidteamcity.options.users.synchronize=trueteamcity.users.filter=(&(objectClass=posixAccount)(!(businessCategory=disabled)))teamcity.options.groups.synchronize=trueteamcity.groups.base=ou=Groupsteamcity.groups.filter=(objectClass=posixGroup)teamcity.options.createUsers=trueteamcity.options.deleteUsers=trueteamcity.options.syncTimeout=60000teamcity.groups.property.member=memberUidteamcity.property.distinguishedName=dnteamcity.users.property.memberId=uidteamcity.users.property.displayName=cnteamcity.users.property.email=mailteamcity.groups.fetchOnlyMappedGroups=true -
teamcity.groups.fetchOnlyMappedGroups=trueis used in theldap-config.propertiesfile to sync only selected groups. - Example mapping in the
ldap-mapping.xmlfile:<group-mapping teamcityGroupKey="TEST" ldapGroupDn="cn=grp_teamcity_test,ou=Groups,dc=<...>,dc=local"/> - The groups synchronization doesn't work. The TeamCity groups are not synchronizing with the LDAP server.
-
teamcity-ldap.logincludes the messages like:Found 0 search results for search base='ou=Groups', filter='(&(objectClass=posixGroup)(dn=CN=grp_teamcity_test,OU=Groups,DC=<...>,DC=local))', scope=2, attributes=[uid, mail, memberUid, dn, cn]Could not find LDAP entry by DN 'CN=grp_teamcity_test,OU=Groups,DC=<...>,DC=local' during fetching mapped groups from LDAP, ignoring
Cause
When TeamCity runs LDAP groups synchronization with teamcity.groups.fetchOnlyMappedGroups=true, it looks up the mapped groups via the DN.
OpenLDAP doesn't support such lookups. Related issue: Do not require LDAP entry to contain attribute(distiguishedName) with DN when fetchOnlyMappedGroups is used (openLDAP case).
Resolution
- Set
teamcity.groups.fetchOnlyMappedGroups=false. - To sync only the selected groups, do one of the following:
- On OpenLDAP's side, place the groups that need to be synchronized inside another group. Use this group as
teamcity.groups.base. - Use
teamcity.groups.filterto filter out the groups that need to be synchronized.
- On OpenLDAP's side, place the groups that need to be synchronized inside another group. Use this group as
The above will synchronize filtered-out groups.
However, the group membership synchronization still may not work correctly, as described in LDAP group membership synchronization with OpenLDAP.
Additional information
A working example of ldap-config.properties file to synchronize TeamCity users and groups with OpenLDAP is available in Configuring TeamCity to synchronize users and groups with OpenLDAP.
Comments
0 comments
Please sign in to leave a comment.