Exceptions & Errors

Errors.

exception freeiam.errors.AdminlimitExceeded(args: dict[str, str | int | list[tuple[str, int, bytes]]] | None = None)[source]

Bases: LdapError

Adminlimit exceeded.

exc_class

alias of ADMINLIMIT_EXCEEDED

exception freeiam.errors.AffectsMultipleDSAs(args: dict[str, str | int | list[tuple[str, int, bytes]]] | None = None)[source]

Bases: LdapError

Affects multiple Directory System Agent.

exc_class

alias of AFFECTS_MULTIPLE_DSAS

exception freeiam.errors.AliasDerefProblem(args: dict[str, str | int | list[tuple[str, int, bytes]]] | None = None)[source]

Bases: LdapError

A problem was encountered when dereferencing an alias.

exc_class

alias of ALIAS_DEREF_PROBLEM

exception freeiam.errors.AliasProblem(args: dict[str, str | int | list[tuple[str, int, bytes]]] | None = None)[source]

Bases: LdapError

An alias in the directory points to a nonexistent entry.

exc_class

alias of ALIAS_PROBLEM

exception freeiam.errors.AlreadyExists(args: dict[str, str | int | list[tuple[str, int, bytes]]] | None = None)[source]

Bases: LdapError

The entry already exists. E.g. the DN specified with add() already exists in the DIT.

exc_class

alias of ALREADY_EXISTS

exception freeiam.errors.AssertionFailed(args: dict[str, str | int | list[tuple[str, int, bytes]]] | None = None)[source]

Bases: LdapError

Assertion failed.

exc_class

alias of ASSERTION_FAILED

exception freeiam.errors.AuthMethodNotSupported(args: dict[str, str | int | list[tuple[str, int, bytes]]] | None = None)[source]

Bases: LdapError

Authentication method is not supported.

exc_class

alias of AUTH_METHOD_NOT_SUPPORTED

exception freeiam.errors.AuthUnknown(args: dict[str, str | int | list[tuple[str, int, bytes]]] | None = None)[source]

Bases: LdapError

The authentication method specified to bind() is not known.

exc_class

alias of AUTH_UNKNOWN

exception freeiam.errors.Busy(args: dict[str, str | int | list[tuple[str, int, bytes]]] | None = None)[source]

Bases: LdapError

The DSA is busy.

exc_class

alias of BUSY

exception freeiam.errors.CancelOperation[source]

Bases: Error

Cancel a running operation.

exception freeiam.errors.Cancelled(args: dict[str, str | int | list[tuple[str, int, bytes]]] | None = None)[source]

Bases: LdapError

Cancelled.

exc_class

alias of CANCELLED

exception freeiam.errors.CannotCancel(args: dict[str, str | int | list[tuple[str, int, bytes]]] | None = None)[source]

Bases: LdapError

Cannot cancel.

exc_class

alias of CANNOT_CANCEL

exception freeiam.errors.ClientLoop(args: dict[str, str | int | list[tuple[str, int, bytes]]] | None = None)[source]

Bases: LdapError

Client loop.

exc_class

alias of CLIENT_LOOP

exception freeiam.errors.CompareFalse(args: dict[str, str | int | list[tuple[str, int, bytes]]] | None = None)[source]

Bases: LdapError

A compare operation returned False.

exc_class

alias of COMPARE_FALSE

exception freeiam.errors.CompareTrue(args: dict[str, str | int | list[tuple[str, int, bytes]]] | None = None)[source]

Bases: LdapError

A compare operation returned true.

exc_class

alias of COMPARE_TRUE

exception freeiam.errors.ConfidentialityRequired(args: dict[str, str | int | list[tuple[str, int, bytes]]] | None = None)[source]

Bases: LdapError

Indicates that the session is not protected by a protocol such as Transport Layer Security (TLS).

which provides session confidentiality.

exc_class

alias of CONFIDENTIALITY_REQUIRED

exception freeiam.errors.ConnectError(args: dict[str, str | int | list[tuple[str, int, bytes]]] | None = None)[source]

Bases: LdapError

Connect error.

exc_class

alias of CONNECT_ERROR

exception freeiam.errors.ConstraintViolation(args: dict[str, str | int | list[tuple[str, int, bytes]]] | None = None)[source]

Bases: LdapError

An attribute value specified or an operation started violates some server-side constraint.

(e.g., a postalAddress has too many lines or a line that is too long or a password is expired).

exc_class

alias of CONSTRAINT_VIOLATION

exception freeiam.errors.ControlNotFound(args: dict[str, str | int | list[tuple[str, int, bytes]]] | None = None)[source]

Bases: LdapError

Control was not found.

exc_class

alias of CONTROL_NOT_FOUND

exception freeiam.errors.DecodingError(args: dict[str, str | int | list[tuple[str, int, bytes]]] | None = None)[source]

Bases: LdapError

An error was encountered decoding a result from the LDAP server.

exc_class

alias of DECODING_ERROR

exception freeiam.errors.EncodingError(args: dict[str, str | int | list[tuple[str, int, bytes]]] | None = None)[source]

Bases: LdapError

An error was encountered encoding parameters to send to the LDAP server.

exc_class

alias of ENCODING_ERROR

exception freeiam.errors.Error[source]

Bases: Exception

Base Error.

exception freeiam.errors.FilterError(args: dict[str, str | int | list[tuple[str, int, bytes]]] | None = None)[source]

Bases: LdapError

The filter syntax is invalid e.g. due to unbalanced parentheses.

exc_class

alias of FILTER_ERROR

exception freeiam.errors.InappropriateAuthentication(args: dict[str, str | int | list[tuple[str, int, bytes]]] | None = None)[source]

Bases: LdapError

Inappropriate authentication was specified.

(e.g. if the user has no userPassword attribute on a simple bind)

exc_class

alias of INAPPROPRIATE_AUTH

exception freeiam.errors.InappropriateMatching(args: dict[str, str | int | list[tuple[str, int, bytes]]] | None = None)[source]

Bases: LdapError

The filter type is not supported for the specified attribute.

exc_class

alias of INAPPROPRIATE_MATCHING

exception freeiam.errors.InsufficientAccess(args: dict[str, str | int | list[tuple[str, int, bytes]]] | None = None)[source]

Bases: LdapError

The user has insufficient access to perform the operation.

exc_class

alias of INSUFFICIENT_ACCESS

exception freeiam.errors.InvalidCredentials(args: dict[str, str | int | list[tuple[str, int, bytes]]] | None = None)[source]

Bases: LdapError

Invalid credentials were presented during bind() or simple_bind(). (e.g., a wrong password).

exc_class

alias of INVALID_CREDENTIALS

exception freeiam.errors.InvalidDN(args: dict[str, str | int | list[tuple[str, int, bytes]]] | None = None)[source]

Bases: LdapError

A syntactically invalid DN was specified.

exc_class

alias of INVALID_DN_SYNTAX

exception freeiam.errors.InvalidFilter[source]

Bases: Error

Invalid Filter Syntax.

exception freeiam.errors.InvalidSyntax(args: dict[str, str | int | list[tuple[str, int, bytes]]] | None = None)[source]

Bases: LdapError

An attribute value specified by the client did not comply to the syntax defined in the server-side schema.

exc_class

alias of INVALID_SYNTAX

exception freeiam.errors.IsLeaf(args: dict[str, str | int | list[tuple[str, int, bytes]]] | None = None)[source]

Bases: LdapError

The object specified is a leaf of the directory tree.

exc_class

alias of IS_LEAF

exception freeiam.errors.LdapError(args: dict[str, str | int | list[tuple[str, int, bytes]]] | None = None)[source]

Bases: Error

LDAP Error wrapper base class.

property controls: list[ResponseControl] | None

List of LDAP Control instances attached to the error.

property description: str | None

String giving a description of the error class, as provided by calling OpenLDAP’s ldap_err2string on the result.

property errno: int | None

The C errno, usually set by system calls or libc rather than the LDAP libraries.

exc_class

alias of LDAPError

classmethod from_ldap_exception(exc: LDAPError) Self[source]

Get instance from the correct child exception.

property info: str | None

String containing more information that the server may have sent.

The value is server-specific: for example, the OpenLDAP server may send different info messages than Active Directory or 389-DS

property matched: str | None

Truncated form of the name provided or alias. dereferenced for the lowest entry (object or alias) that was matched.

property result: int | None

Numeric code of the error class.

classmethod wrap(hide_parent_exception: bool = True) ContextManager[None][source]

Context manager to wrap LDAP exceptions.

exception freeiam.errors.LocalError(args: dict[str, str | int | list[tuple[str, int, bytes]]] | None = None)[source]

Bases: LdapError

Some local error occurred. Usually caused by failed memory allocation.

exc_class

alias of LOCAL_ERROR

exception freeiam.errors.LoopDetected(args: dict[str, str | int | list[tuple[str, int, bytes]]] | None = None)[source]

Bases: LdapError

A loop was detected.

exc_class

alias of LOOP_DETECT

exception freeiam.errors.MoreResultsToReturn(args: dict[str, str | int | list[tuple[str, int, bytes]]] | None = None)[source]

Bases: LdapError

More results to return.

exc_class

alias of MORE_RESULTS_TO_RETURN

exception freeiam.errors.NamingViolation(args: dict[str, str | int | list[tuple[str, int, bytes]]] | None = None)[source]

Bases: LdapError

A naming violation occurred. This is raised e.g. if the LDAP server has constraints about the tree naming.

exc_class

alias of NAMING_VIOLATION

exception freeiam.errors.NoMemory(args: dict[str, str | int | list[tuple[str, int, bytes]]] | None = None)[source]

Bases: LdapError

No memory.

exc_class

alias of NO_MEMORY

exception freeiam.errors.NoObjectClassMods(args: dict[str, str | int | list[tuple[str, int, bytes]]] | None = None)[source]

Bases: LdapError

Modifying the objectClass attribute as requested is not allowed (e.g. modifying structural object class of existing entry).

exc_class

alias of NO_OBJECT_CLASS_MODS

exception freeiam.errors.NoResultsReturned(args: dict[str, str | int | list[tuple[str, int, bytes]]] | None = None)[source]

Bases: LdapError

No results returned.

exc_class

alias of NO_RESULTS_RETURNED

exception freeiam.errors.NoSuchAttribute(args: dict[str, str | int | list[tuple[str, int, bytes]]] | None = None)[source]

Bases: LdapError

The attribute type specified does not exist in the entry.

exc_class

alias of NO_SUCH_ATTRIBUTE

exception freeiam.errors.NoSuchObject(*args: Any, **kwargs: Any)[source]

Bases: LdapError

The specified object does not exist in the directory.

property base_dn: freeiam.ldap.dn.DN | None

Get search base DN.

exc_class

alias of NO_SUCH_OBJECT

exception freeiam.errors.NoSuchOperation(args: dict[str, str | int | list[tuple[str, int, bytes]]] | None = None)[source]

Bases: LdapError

No such operation.

exc_class

alias of NO_SUCH_OPERATION

exception freeiam.errors.NoUniqueEntry(args: dict[str, str | int | list[tuple[str, int, bytes]]] | None = None)[source]

Bases: LdapError

No unique entry.

exc_class

alias of NO_UNIQUE_ENTRY

exception freeiam.errors.NotAllowedOnNonleaf(args: dict[str, str | int | list[tuple[str, int, bytes]]] | None = None)[source]

Bases: LdapError

The operation is not allowed on a non-leaf object.

exc_class

alias of NOT_ALLOWED_ON_NONLEAF

exception freeiam.errors.NotAllowedOnRDN(args: dict[str, str | int | list[tuple[str, int, bytes]]] | None = None)[source]

Bases: LdapError

The operation is not allowed on an RDN.

exc_class

alias of NOT_ALLOWED_ON_RDN

exception freeiam.errors.NotSupported(args: dict[str, str | int | list[tuple[str, int, bytes]]] | None = None)[source]

Bases: LdapError

Not supported.

exc_class

alias of NOT_SUPPORTED

exception freeiam.errors.NotUnique[source]

Bases: Error

More than one unique search result.

property results: list[freeiam.ldap._wrapper.Result]

The non unique search results.

exception freeiam.errors.ObjectClassViolation(args: dict[str, str | int | list[tuple[str, int, bytes]]] | None = None)[source]

Bases: LdapError

An object class violation occurred.

When the LDAP server checked the data sent by the client against the server-side schema (e.g. a “must” attribute was missing in the entry data)

exc_class

alias of OBJECT_CLASS_VIOLATION

exception freeiam.errors.OperationsError(args: dict[str, str | int | list[tuple[str, int, bytes]]] | None = None)[source]

Bases: LdapError

An operations error occurred.

exc_class

alias of OPERATIONS_ERROR

exception freeiam.errors.Other(args: dict[str, str | int | list[tuple[str, int, bytes]]] | None = None)[source]

Bases: LdapError

An unclassified error occurred.

exc_class

alias of OTHER

exception freeiam.errors.ParamError(args: dict[str, str | int | list[tuple[str, int, bytes]]] | None = None)[source]

Bases: LdapError

An LDAP routine was called with a bad parameter.

exc_class

alias of PARAM_ERROR

exception freeiam.errors.PartialResults(args: dict[str, str | int | list[tuple[str, int, bytes]]] | None = None)[source]

Bases: LdapError

Only partial results were returned.

This exception is raised if a referral is received when using LDAPv2. This exception should never be seen with LDAPv3.

exc_class

alias of PARTIAL_RESULTS

exception freeiam.errors.ProtocolError(args: dict[str, str | int | list[tuple[str, int, bytes]]] | None = None)[source]

Bases: LdapError

A violation of the LDAP protocol was detected.

exc_class

alias of PROTOCOL_ERROR

exception freeiam.errors.ProxiedAuthorizationDenied(args: dict[str, str | int | list[tuple[str, int, bytes]]] | None = None)[source]

Bases: LdapError

Proxied authorization was denied.

exc_class

alias of PROXIED_AUTHORIZATION_DENIED

exception freeiam.errors.ProxyAuthZFailure(args: dict[str, str | int | list[tuple[str, int, bytes]]] | None = None)[source]

Bases: LdapError

X-Proxy Authorization failure.

exc_class

alias of X_PROXY_AUTHZ_FAILURE

exception freeiam.errors.Referral(args: dict[str, str | int | list[tuple[str, int, bytes]]] | None = None)[source]

Bases: LdapError

Referral.

exc_class

alias of REFERRAL

exception freeiam.errors.ReferralLimitExceeded(args: dict[str, str | int | list[tuple[str, int, bytes]]] | None = None)[source]

Bases: LdapError

Referral limit exceeded.

exc_class

alias of REFERRAL_LIMIT_EXCEEDED

exception freeiam.errors.ResultsTooLarge(args: dict[str, str | int | list[tuple[str, int, bytes]]] | None = None)[source]

Bases: LdapError

The result does not fit into a UDP packet.

This happens only when using UDP-based CLDAP (connection-less LDAP) which is not supported anyway.

exc_class

alias of RESULTS_TOO_LARGE

exception freeiam.errors.SASLBindInProgress(args: dict[str, str | int | list[tuple[str, int, bytes]]] | None = None)[source]

Bases: LdapError

SASL bind in progress.

exc_class

alias of SASL_BIND_IN_PROGRESS

exception freeiam.errors.ServerDown(args: dict[str, str | int | list[tuple[str, int, bytes]]] | None = None)[source]

Bases: LdapError

The LDAP library can’t contact the LDAP server.

exc_class

alias of SERVER_DOWN

exception freeiam.errors.SizelimitExceeded(args: dict[str, str | int | list[tuple[str, int, bytes]]] | None = None)[source]

Bases: LdapError

An LDAP size limit was exceeded. This could be due to a sizelimit configuration on the LDAP server.

exc_class

alias of SIZELIMIT_EXCEEDED

exception freeiam.errors.StrongAuthNotSupported(args: dict[str, str | int | list[tuple[str, int, bytes]]] | None = None)[source]

Bases: LdapError

The LDAP server does not support strong authentication.

exc_class

alias of STRONG_AUTH_NOT_SUPPORTED

exception freeiam.errors.StrongAuthRequired(args: dict[str, str | int | list[tuple[str, int, bytes]]] | None = None)[source]

Bases: LdapError

Strong authentication is required for the operation.

exc_class

alias of STRONG_AUTH_REQUIRED

exception freeiam.errors.Success(args: dict[str, str | int | list[tuple[str, int, bytes]]] | None = None)[source]

Bases: LdapError

Success.

exc_class

alias of SUCCESS

exception freeiam.errors.TimelimitExceeded(args: dict[str, str | int | list[tuple[str, int, bytes]]] | None = None)[source]

Bases: LdapError

An LDAP time limit was exceeded.

exc_class

alias of TIMELIMIT_EXCEEDED

exception freeiam.errors.Timeout(args: dict[str, str | int | list[tuple[str, int, bytes]]] | None = None)[source]

Bases: LdapError

A timelimit was exceeded while waiting for a result from the server.

exc_class

alias of TIMEOUT

exception freeiam.errors.TooLate(args: dict[str, str | int | list[tuple[str, int, bytes]]] | None = None)[source]

Bases: LdapError

Too late.

exc_class

alias of TOO_LATE

exception freeiam.errors.TypeOrValueExists(args: dict[str, str | int | list[tuple[str, int, bytes]]] | None = None)[source]

Bases: LdapError

An attribute type or attribute value specified already exists in the entry.

exc_class

alias of TYPE_OR_VALUE_EXISTS

exception freeiam.errors.Unavailable(args: dict[str, str | int | list[tuple[str, int, bytes]]] | None = None)[source]

Bases: LdapError

The DSA is unavailable.

exc_class

alias of UNAVAILABLE

exception freeiam.errors.UnavailableCriticalExtension(args: dict[str, str | int | list[tuple[str, int, bytes]]] | None = None)[source]

Bases: LdapError

Indicates that the LDAP server was unable to satisfy a request.

Because one or more critical extensions were not available. Either the server does not support the control or the control is not appropriate for the operation type.

exc_class

alias of UNAVAILABLE_CRITICAL_EXTENSION

exception freeiam.errors.UndefinedType(args: dict[str, str | int | list[tuple[str, int, bytes]]] | None = None)[source]

Bases: LdapError

An attribute type used is not defined in the server-side schema.

exc_class

alias of UNDEFINED_TYPE

exception freeiam.errors.UnwillingToPerform(args: dict[str, str | int | list[tuple[str, int, bytes]]] | None = None)[source]

Bases: LdapError

The DSA is unwilling to perform the operation.

exc_class

alias of UNWILLING_TO_PERFORM

exception freeiam.errors.UserCancelled(args: dict[str, str | int | list[tuple[str, int, bytes]]] | None = None)[source]

Bases: LdapError

The operation was cancelled via the abandon() method.

exc_class

alias of USER_CANCELLED

exception freeiam.errors.VLVError(args: dict[str, str | int | list[tuple[str, int, bytes]]] | None = None)[source]

Bases: LdapError

Virtual List View control error.

exc_class

alias of VLV_ERROR