Ticket #388 (closed defect: fixed)

Opened 2 years ago

Last modified 23 months ago

Improve replication agreement status messages

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

Description

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.

Attachments

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

Change History

comment:1 Changed 23 months ago by nkinder

  • Milestone changed from 0.0 NEEDS_TRIAGE to 1.2.11.5

comment:2 Changed 23 months 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 23 months ago by mreynolds

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

comment:4 Changed 23 months ago by mreynolds

  • Review set to review?

comment:5 Changed 23 months 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 23 months ago by rmeggins

  • Cc rmeggins added

comment:7 Changed 23 months ago by mreynolds

In replication, the error code can come from:

conn_get_error()
conn_push_schema()
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 23 months ago by nhosoi

  • Review changed from review? to ack

comment:9 Changed 23 months ago by mreynolds

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

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

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 20 months ago by nkinder

  • screened set to 1

Added initial screened field value.

Note: See TracTickets for help on using tickets.