Ticket #388 (closed defect: fixed)

Opened 5 years ago

Last modified 5 years ago

Improve replication agreement status messages

Reported by: nkinder Owned by: mreynolds
Priority: minor Milestone:
Component: Replication - General Version:
Keywords: Cc: rmeggins
Blocked By: Blocking:
Review: ack Ticket origin:
Red Hat Bugzilla: 830344


When setting the value for the replication status attributes in replication agreements, we only call ldap_err2string() if the return code is greater than 0. If the return code is negative, we hard code the error description as "System error".

When using OpenLDAP client libraries, you can get a textual error string for negative LDAP return codes, as demonstrated by this test program output:

[nkinder@localhost test]$ ./ldaperr
rc: -1, "Can't contact LDAP server"
rc: -2, "Local error"
rc: -3, "Encoding error"
rc: -4, "Decoding error"
rc: -5, "Timed out"
rc: -6, "Unknown authentication method"
rc: -7, "Bad search filter"
rc: -8, "User cancelled operation"
rc: -9, "Bad parameter to an ldap routine"
rc: -10, "Out of memory"
rc: -11, "Connect error"
rc: -12, "Not Supported"
rc: -13, "Control not found"
rc: -14, "No results returned"
rc: -15, "More results to return"
rc: -16, "Client Loop"
rc: -17, "Referral Limit Exceeded"

I believe we avoid calling ldap_err2string() for negative return codes due to a limitation in MozLDAP. We should get the more informative error strings for negative return codes when using OpenLDAP.


0001-Ticket-388-Improve-replication-agreement-status-mess.patch (6.2 KB) - added by mreynolds 5 years ago.

Change History

comment:1 Changed 5 years ago by nkinder

  • Milestone changed from 0.0 NEEDS_TRIAGE to

comment:2 Changed 5 years ago by nkinder

  • Red Hat Bugzilla set to [https://bugzilla.redhat.com/show_bug.cgi?id=830344 830344]

Ticket has been cloned to Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=830344

comment:3 Changed 5 years ago by mreynolds

  • Owner changed from rmeggins to mreynolds
  • Status changed from new to assigned

comment:4 Changed 5 years ago by mreynolds

  • Review set to review?

comment:5 Changed 5 years ago by rmeggins

About slapi_err2string(int result) - if we are using mozldap instead of openldap, when will result be negative? Does mozldap return negative error codes?

comment:6 Changed 5 years ago by rmeggins

  • Cc rmeggins added

comment:7 Changed 5 years ago by mreynolds

In replication, the error code can come from:

callback_data (repl5_tot_protocol.c)

I don't think mozldap is returning negative result codes, but some replication functions are returning negative result codes. If we are using mozldap, then ldap_err2string will not work for negative results codes, and we have to give a generic/useless error string.

This fix is just a guarantee, that any result code(positive or negative), will return a useful error string regardless of the ldap library.

comment:8 Changed 5 years ago by nhosoi

  • Review changed from review? to ack

comment:9 Changed 5 years ago by mreynolds

  • Status changed from assigned to closed
  • Resolution set to fixed

[mareynol@localhost servers]$ git merge ticket388
Updating 4d564ef..8f21ac8

ldap/servers/plugins/replication/repl5_agmt.c | 34 +++-----------
ldap/servers/slapd/libglobs.c | 58 +++++++++++++++++++++++++
ldap/servers/slapd/slapi-plugin.h | 9 ++++
3 files changed, 75 insertions(+), 26 deletions(-)

[mareynol@localhost servers]$ git push origin master
Counting objects: 19, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (10/10), done.
Writing objects: 100% (10/10), 1.84 KiB, done.
Total 10 (delta 8), reused 0 (delta 0)
To ssh://git.fedorahosted.org/git/389/ds.git

4d564ef..8f21ac8 master -> master

comment:10 Changed 4 years ago by nkinder

  • screened set to 1

Added initial screened field value.

Note: See TracTickets for help on using tickets.