Issue 7107 - cn=config syncrepl fails with "controls require LDAPv3" on bound v3 connection
Summary: cn=config syncrepl fails with "controls require LDAPv3" on bound v3 connection
Status: VERIFIED FIXED
Alias: None
Product: OpenLDAP
Classification: Unclassified
Component: slapd (show other issues)
Version: 2.4.28
Hardware: All All
: --- normal
Target Milestone: ---
Assignee: OpenLDAP project
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-08 13:47 UTC by brandon.hume@dal.ca
Modified: 2014-08-01 21:04 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description brandon.hume@dal.ca 2011-12-08 13:47:42 UTC
Full_Name: Brandon Hume
Version: 2.4.28
OS: RHEL EL6.1, kernel 2.6.32-131.12.1.el6.x86_64
URL: http://den.bofh.ca/~hume/ol_v3_fail_syslog.txt
Submission from: (NULL) (2001:410:a010:2:223:aeff:fe74:400e)


OpenLDAP 2.4.28 compiled with BerkeleyDB 5.2.36, attempting to configure for
multi-master replication.  Problems occurred with the second server complaining
about operations errors while attempting to replicate the cn=config tree; I've
been able to reproduce the problem from the command line using ldapsearch from
the same compile.

The host is RHEL 6.1 running inside VMWare.  Version of OpenLDAP is 2.4.28,
compiled with BerkeleyDB 5.2.36 (no patches available from Oracle at the time I
downloaded).  Configuration options used are visible in
http://den.bofh.ca/~hume/config_ol_sh.txt

The problem does *not* seem to be consistent, as *sometimes* it will work but
most of the time not.  I've run the example query once, had it fail, run it
again immediately and had it succeed, and then again fail a dozen times in a
row.  Wireshark traces showed the connection was established using LDAPv3;
putting the server in debug "Any" mode also confirms the same.  The syslogs
generated are viewable at http://den.bofh.ca/~hume/ol_v3_fail_syslog.txt

I've compiled 2.4.27 with the same options and it *seemed* to behave, though I
may have merely gotten lucky.

Example ldapsearch invocation:

$ /appl/ldap/bin/ldapsearch -x -D 'cn=config' -h kil-ds-3.its.dal.ca -b
cn=config -w bindpass -s sub -E sync=rp -e manageDSAit 'objectclass=*'
# extended LDIF
#
# LDAPv3
# base <cn=config> with scope subtree
# filter: objectclass=*
# requesting: ALL
# with manageDSAit control
#

# search result
search: 2
result: 2 Protocol error
text: controls require LDAPv3

# numResponses: 1
ldap_result: Can't contact LDAP server (-1)


These servers are not yet in production and I have ~two weeks to play and tweak
to generate more debugging information if you'd find it useful.
Comment 1 Howard Chu 2011-12-08 20:51:28 UTC
hume-ol@bofh.ca wrote:
> Full_Name: Brandon Hume
> Version: 2.4.28
> OS: RHEL EL6.1, kernel 2.6.32-131.12.1.el6.x86_64
> URL: http://den.bofh.ca/~hume/ol_v3_fail_syslog.txt
> Submission from: (NULL) (2001:410:a010:2:223:aeff:fe74:400e)
>
>
> OpenLDAP 2.4.28 compiled with BerkeleyDB 5.2.36, attempting to configure for
> multi-master replication.  Problems occurred with the second server complaining
> about operations errors while attempting to replicate the cn=config tree; I've
> been able to reproduce the problem from the command line using ldapsearch from
> the same compile.
>
> The host is RHEL 6.1 running inside VMWare.  Version of OpenLDAP is 2.4.28,
> compiled with BerkeleyDB 5.2.36 (no patches available from Oracle at the time I
> downloaded).  Configuration options used are visible in
> http://den.bofh.ca/~hume/config_ol_sh.txt
>
> The problem does *not* seem to be consistent, as *sometimes* it will work but
> most of the time not.  I've run the example query once, had it fail, run it
> again immediately and had it succeed, and then again fail a dozen times in a
> row.  Wireshark traces showed the connection was established using LDAPv3;
> putting the server in debug "Any" mode also confirms the same.  The syslogs
> generated are viewable at http://den.bofh.ca/~hume/ol_v3_fail_syslog.txt
>
> I've compiled 2.4.27 with the same options and it *seemed* to behave, though I
> may have merely gotten lucky.

Only two source files are changed between 2.4.27 and 2.4.28, and neither of 
the changes affect cn=config, syncrepl, or Bind operations. If you're seeing a 
difference in behavior here then I can only conclude that your build 
environment is corrupted.

> Example ldapsearch invocation:
>
> $ /appl/ldap/bin/ldapsearch -x -D 'cn=config' -h kil-ds-3.its.dal.ca -b
> cn=config -w bindpass -s sub -E sync=rp -e manageDSAit 'objectclass=*'
> # extended LDIF
> #
> # LDAPv3
> # base<cn=config>  with scope subtree
> # filter: objectclass=*
> # requesting: ALL
> # with manageDSAit control
> #
>
> # search result
> search: 2
> result: 2 Protocol error
> text: controls require LDAPv3
>
> # numResponses: 1
> ldap_result: Can't contact LDAP server (-1)
>
>
> These servers are not yet in production and I have ~two weeks to play and tweak
> to generate more debugging information if you'd find it useful.
>
>


-- 
   -- Howard Chu
   CTO, Symas Corp.           http://www.symas.com
   Director, Highland Sun     http://highlandsun.com/hyc/
   Chief Architect, OpenLDAP  http://www.openldap.org/project/

Comment 2 Howard Chu 2011-12-08 21:33:44 UTC
changed state Open to Feedback
Comment 3 brandon.hume@dal.ca 2011-12-09 13:54:55 UTC
I have reproduced the problem on 2.4.27.  The mentioned ldapsearch query 
seems to have a high probability of success if run immediately after 
server start, which also seems true on 2.4.28.

I threw in an extra Debug() line and op->op_protocol == 2 at the check.

I'm rebuilding with as many debugging symbols enabled as possible to try 
to figure out what's going on.

Comment 4 Howard Chu 2011-12-15 03:34:29 UTC
changed notes
changed state Feedback to Test
moved from Incoming to Software Bugs
Comment 5 Howard Chu 2011-12-16 03:14:26 UTC
hume-ol@bofh.ca wrote:
> I have reproduced the problem on 2.4.27.  The mentioned ldapsearch query
> seems to have a high probability of success if run immediately after
> server start, which also seems true on 2.4.28.
>
> I threw in an extra Debug() line and op->op_protocol == 2 at the check.
>
> I'm rebuilding with as many debugging symbols enabled as possible to try
> to figure out what's going on.

A fix for this is in git master, please test.

-- 
   -- Howard Chu
   CTO, Symas Corp.           http://www.symas.com
   Director, Highland Sun     http://highlandsun.com/hyc/
   Chief Architect, OpenLDAP  http://www.openldap.org/project/

Comment 6 brandon.hume@dal.ca 2011-12-19 19:21:04 UTC
On 12/15/11 11:14 PM, Howard Chu wrote:
>
> A fix for this is in git master, please test.
>

Built and deployed, I've allowed to run for 72h and problem has yet to 
show.  I believe this particular bug has been squashed.

Comment 7 Quanah Gibson-Mount 2012-01-23 22:02:41 UTC
changed notes
changed state Test to Release
Comment 8 Quanah Gibson-Mount 2012-02-13 19:05:59 UTC
changed notes
changed state Release to Closed
Comment 9 OpenLDAP project 2014-08-01 21:04:40 UTC
fixed in master
fixed in RE24