LDAP_ERROR(3)

πŸ’– LDAP_ERROR(3) β€” the error-handling glow-up πŸ’–

okay bestie, welcome to LDAP_ERROR(3) from the Library Functions Manual β€” this is the page that tells you what all those cryptic LDAP error numbers are actually saying to you. Let's get into it 🫢


✨ NAME ✨

ldap_perror, ld_errno, ldap_result2error, ldap_errlist, ldap_err2string β€” the LDAP protocol error handling routines. yes, all of them. one page. iconic behavior honestly.


πŸŽ€ LIBRARY πŸŽ€

OpenLDAP LDAP β€” that's libldap, link it with -lldap and you're so back.


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <ldap.h>

char *ldap_err2string( int err );

that's it. one function in the synopsis. she's lowkey minimal and i respect it.


🌸 DESCRIPTION 🌸

so ldap_err2string() gives you a short description of the various codes that routines in this library hand back to you. like a little translator bestie for your error codes πŸ’…

the string it returns is a pointer to a static area β€” so do not modify it, okay? hands off. she's not yours.

these codes are either:

  • negative β†’ meaning it's an API error code,
  • positive β†’ meaning it's an LDAP resultCode that isn't success (0), or
  • zero β†’ meaning both that the API call was successful and the LDAP resultCode is success (0). double slay.

the code associated with an LDAP session is accessible using ldap_get_option(3) and ldap_set_option(3) with the LDAP_OPT_RESULT_CODE option (previously called LDAP_OPT_ERROR_NUMBER). vintage name, still cute πŸŽ€


πŸ”₯ PROTOCOL RESULT CODES πŸ”₯

heads up: this section is a partial list of protocol codes recognized by the library. because LDAP is extensible, additional values may be returned β€” so don't come for her when you see a code that isn't here πŸ™ˆ a complete listing of registered LDAP result codes can be obtained from the Internet Assigned Numbers Authority <http://www.iana.org>.

  • LDAP_SUCCESS β€” the request was successful. we love a win πŸ’–
  • LDAP_OPERATIONS_ERROR β€” an operations error occurred. mysterious. vague. she contains multitudes.
  • LDAP_PROTOCOL_ERROR β€” a protocol violation was detected. rude!
  • LDAP_TIMELIMIT_EXCEEDED β€” an LDAP time limit was exceeded. time's up bestie ⏰
  • LDAP_SIZELIMIT_EXCEEDED β€” an LDAP size limit was exceeded. too much of a good thing ngl
  • LDAP_COMPARE_FALSE β€” a compare operation returned false.
  • LDAP_COMPARE_TRUE β€” a compare operation returned true.
  • LDAP_STRONG_AUTH_NOT_SUPPORTED β€” the LDAP server does not support strong authentication. it's giving "we don't do that here"
  • LDAP_STRONG_AUTH_REQUIRED β€” strong authentication is required for the operation.
  • LDAP_PARTIAL_RESULTS β€” partial results only returned.
  • LDAP_NO_SUCH_ATTRIBUTE β€” the attribute type specified does not exist in the entry. gone. never was. πŸ’€
  • LDAP_UNDEFINED_TYPE β€” the attribute type specified is invalid.
  • LDAP_INAPPROPRIATE_MATCHING β€” filter type not supported for the specified attribute.
  • LDAP_CONSTRAINT_VIOLATION β€” an attribute value specified violates some constraint (e.g., a postalAddress has too many lines, or a line that is too long). ma'am, that's too much address.
  • LDAP_TYPE_OR_VALUE_EXISTS β€” an attribute type or attribute value specified already exists in the entry.
  • LDAP_INVALID_SYNTAX β€” an invalid attribute value was specified.
  • LDAP_NO_SUCH_OBJECT β€” the specified object does not exist in The Directory. capital-T capital-D The Directory, she's official.
  • LDAP_ALIAS_PROBLEM β€” an alias in The Directory points to a nonexistent entry.
  • LDAP_INVALID_DN_SYNTAX β€” a syntactically invalid DN was specified.
  • LDAP_IS_LEAF β€” the object specified is a leaf. πŸƒ a literal leaf.
  • LDAP_ALIAS_DEREF_PROBLEM β€” a problem was encountered when dereferencing an alias.
  • LDAP_INAPPROPRIATE_AUTH β€” inappropriate authentication was specified (e.g., LDAP_AUTH_SIMPLE was specified and the entry does not have a userPassword attribute).
  • LDAP_INVALID_CREDENTIALS β€” invalid credentials were presented (e.g., the wrong password). wrong password era 😭
  • LDAP_INSUFFICIENT_ACCESS β€” the user has insufficient access to perform the operation. bestie does not have the clearance.
  • LDAP_BUSY β€” the DSA is busy.
  • LDAP_UNAVAILABLE β€” the DSA is unavailable.
  • LDAP_UNWILLING_TO_PERFORM β€” the DSA is unwilling to perform the operation. not "can't". unwilling. respect the boundary πŸ’…
  • LDAP_LOOP_DETECT β€” a loop was detected.
  • LDAP_NAMING_VIOLATION β€” a naming violation occurred.
  • LDAP_OBJECT_CLASS_VIOLATION β€” an object class violation occurred (e.g., a "must" attribute was missing from the entry).
  • LDAP_NOT_ALLOWED_ON_NONLEAF β€” the operation is not allowed on a nonleaf object.
  • LDAP_NOT_ALLOWED_ON_RDN β€” the operation is not allowed on an RDN.
  • LDAP_ALREADY_EXISTS β€” the entry already exists. she was already there, you're late 🫢
  • LDAP_NO_OBJECT_CLASS_MODS β€” object class modifications are not allowed.
  • LDAP_OTHER β€” an unknown error occurred. the catch-all. the mystery box. the "idk her" of codes πŸ™ˆ

⭐ API ERROR CODES ⭐

this section is a complete list of API error codes recognized by the library β€” so every single one is right here, no crumbs left behind. ✨

note bestie: LDAP_SUCCESS indicates success of an API call in addition to representing the return of the LDAP 'success' resultCode. one code, two jobs, main character energy.
  • LDAP_SERVER_DOWN β€” the LDAP library can't contact the LDAP server. ghosted. πŸ“΅
  • LDAP_LOCAL_ERROR β€” some local error occurred. this is usually a failed dynamic memory allocation.
  • LDAP_ENCODING_ERROR β€” an error was encountered encoding parameters to send to the LDAP server.
  • LDAP_DECODING_ERROR β€” an error was encountered decoding a result from the LDAP server.
  • LDAP_TIMEOUT β€” a timelimit was exceeded while waiting for a result. we waited. it didn't come. ⏳
  • LDAP_AUTH_UNKNOWN β€” the authentication method specified to ldap_bind() is not known.
  • LDAP_FILTER_ERROR β€” an invalid filter was supplied to ldap_search() (e.g., unbalanced parentheses). parenthesis check bestie, fr fr
  • LDAP_PARAM_ERROR β€” an ldap routine was called with a bad parameter.
  • LDAP_NO_MEMORY β€” an memory allocation (e.g., malloc(3) or other dynamic memory allocator) call failed in an ldap library routine. (yes, the original says "an memory allocation" β€” we keep it, we don't fix it, we love her anyway πŸ’œ)
  • LDAP_USER_CANCELED β€” indicates the user cancelled the operation. valid. we've all been there.
  • LDAP_CONNECT_ERROR β€” indicates a connection problem.
  • LDAP_NOT_SUPPORTED β€” indicates the routine was called in a manner not supported by the library.
  • LDAP_CONTROL_NOT_FOUND β€” indicates the control provided is unknown to the client library.
  • LDAP_NO_RESULTS_RETURNED β€” indicates no results returned. nothing. empty. the void. πŸ’€
  • LDAP_MORE_RESULTS_TO_RETURN β€” indicates more results could be returned. she's not done yet πŸ‘€
  • LDAP_CLIENT_LOOP β€” indicates the library has detected a loop in its processing.
  • LDAP_REFERRAL_LIMIT_EXCEEDED β€” indicates the referral limit has been exceeded. too many referrals, this is not a doctor's office 🩺

🧚 DEPRECATED 🧚

okay so deprecated interfaces generally remain in the library β€” they're not gone, they're just on thin ice.

the macro LDAP_DEPRECATED can be defined to a non-zero value (e.g., -DLDAP_DEPRECATED=1) when compiling program designed to use deprecated interfaces. (yes, the original says "program" singular, we're keeping it, character for character queen πŸ‘‘)

the actual recommendation: it is recommended that developers writing new programs, or updating old programs, avoid use of deprecated interfaces. over time, it is expected that documentation (and, eventually, support) for deprecated interfaces to be eliminated. so like… don't build your whole personality on deprecated interfaces, bestie. they will leave. 😭

🌈 SEE ALSO 🌈

(yes, that's the whole list. she's concise. periodt.)


πŸ’œ ACKNOWLEDGEMENTS πŸ’œ

OpenLDAP Software is developed and maintained by The OpenLDAP Project <http://www.openldap.org/>. OpenLDAP Software is derived from the University of Michigan LDAP 3.3 Release. πŸŽ“ absolute legends, no cap.


and that's the page!! this was OpenLDAP 2.6.16, dated 2026/10/21 β€” go forth and translate your error codes with confidence bestie, you've got this πŸ’…βœ¨πŸ¦‹

πŸ“¦ where this page comes from