Menu

Bug in debug logging?

JMB
2013-10-18
2013-10-18
  • JMB

    JMB - 2013-10-18

    Hi

    Apologies if this is the wrong forum to raise this issue but there seems to be a small bug in debugLDAPResult, the value of the entriesReturned variable always seems to be -1.

    The log excerpt below shows a seach which returns 2 entries but the debugLDAPResult shows entriesReturned=-1.

    Is this something that could be fixed in the next release?

    2013-10-03 10:54:51,070 ERROR [STDERR] 03-Oct-2013 10:54:51 com.unboundid.util.Debug debugLDAPRequest
    INFO: level="INFO" threadID=48 threadName="http-0.0.0.0-8081-1" revision=10784 sendingLDAPRequest="SearchRequest(baseDN='cn=Authenticators,dc=xxx,dc=xxxxxx,dc=com', scope=ONE, deref=NEVER, sizeLimit=0, timeLimit=0, filter='(objectClass=authenticator)', attrs={*})"
    2013-10-03 10:54:51,070 ERROR [STDERR] 03-Oct-2013 10:54:51 com.unboundid.util.Debug debugASN1Write
    INFO: level="INFO" threadID=48 threadName="http-0.0.0.0-8081-1" revision=10784 writingASN1Element="30680201196363042b636e3d41757468656e74696361746f72732c64633d69646d2c64633d766f6461666f6e652c64633d636f6d0a01010a0100020100020100010100a320040b6f626a656374436c617373041169646d2d61757468656e74696361746f72300304012a"
    2013-10-03 10:54:51,071 ERROR [STDERR] 03-Oct-2013 10:54:51 com.unboundid.util.Debug debugLDAPResult
    INFO: level="INFO" threadID=53 threadName="Connection reader for connection to localhost:3389" revision=10784 connectionID=1 connectedTo="localhost:3389" readLDAPResult="SearchResultEntry(dn='cn=xxxxxx,cn=Authenticators,dc=xxx,dc=xxxxxx,dc=com', messageID=25, attributes={Attribute(name=objectClass, values={'authenticator', 'top'}), Attribute(name=key, values={'xxxx'}), Attribute(name=ui-label, values={'xxxx'}), Attribute(name=required-param, values={'aaa:email', 'aaa:role'}), Attribute(name=optional-param, values={'aaa:firstname', 'aaa:lastname', 'aaa:phone'}), Attribute(name=cn, values={'xxxxxx'})}, controls={})"
    2013-10-03 10:54:51,072 ERROR [STDERR] 03-Oct-2013 10:54:51 com.unboundid.util.Debug debugLDAPResult
    INFO: level="INFO" threadID=53 threadName="Connection reader for connection to localhost:3389" revision=10784 connectionID=1 connectedTo="localhost:3389" readLDAPResult="SearchResultEntry(dn='cn=xxxxxx,cn=Authenticators,dc=xxx,dc=xxxxxx,dc=com', messageID=25, attributes={Attribute(name=objectClass, values={'authenticator', 'top'}), Attribute(name=key, values={'V4eq5CPyfhd4'}), Attribute(name=ui-label, values={'xxxx'}), Attribute(name=required-param, values={'aaa:firstname', 'aaa:lastname', 'aaa:role'}), Attribute(name=optional-param, values={'aaa:phone'}), Attribute(name=cn, values={'xxxxxx'})}, controls={})"
    2013-10-03 10:54:51,072 ERROR [STDERR] 03-Oct-2013 10:54:51 com.unboundid.util.Debug debugLDAPResult
    INFO: level="INFO" threadID=53 threadName="Connection reader for connection to localhost:3389" revision=10784 connectionID=1 connectedTo="localhost:3389" readLDAPResult="SearchResult(resultCode=0 (success), messageID=25, entriesReturned=-1, referencesReturned=-1)"

     
  • Neil Wilson

    Neil Wilson - 2013-10-18

    This is unfortunately something that isn't really feasible to address by placing the correct number of search result entries in that field. This debug call is made at a point in which the LDAP SDK doesn't really have access to anything except the LDAP "search result done" protocol op, and that doesn't include any information about the number of entries or references returned earlier for that search operation. In this case, the "-1" value is a placeholder indicating that this information isn't known.

    The output could potentially be cleaned up by removing the entriesReturned and referencesReturned elements from the output if they aren't known, but it would not be a simple matter to include the correct values in the result at that particular point in the processing.

     
  • JMB

    JMB - 2013-10-18

    Thanks Neil. The bug was raised by a customer of ours. I will explain the reason behind it to them but it would be great if you could remove those elements when the values aren't known.

     
  • Neil Wilson

    Neil Wilson - 2013-10-18

    I have just committed a change that updates the message to exclude the entriesReturned and referencesReturned elements if their values are not known. This change also improved support for response debugging for connections operating in synchronous mode.

     

Log in to post a comment.