Skip to main content

exceptions

LucidLink Python Library - Exception Classes

Every error the SDK raises on purpose is a LucidLinkError, except where a Python convention applies: TypeError for an argument of the wrong type, io.UnsupportedOperation and the ValueError of a closed file on a file stream, LookupError for an unknown encoding, NotImplementedError from the fsspec adapter where fsspec expects it, and ImportError for a missing optional dependency. Where a condition has a builtin Python meaning, the class also inherits that builtin, so existing code keeps working:

Either class can be caught

from lucidlink.exceptions import LucidLinkError
try:    data = FsUtils(filespace.file_system).read_bytes("/missing.txt")except FileNotFoundError as e:    print("no such file:", e.filename)except LucidLinkError as e:    print("SDK error:", e)

Credentials and access failures are deliberately not OSError subclasses: AuthenticationError (fix the token), AccessDeniedError (ask for access) and DataStoreCredentialsError (fix the data store's credentials). Data tools such as fsspec treat any OSError as "the path is missing", which would hide those failures.

Retry ServiceUnavailableError, RateLimitedError and ExternalStoreUnavailableError later. A failure this SDK version cannot classify is a plain LucidLinkError.

A method's Raises lists only the errors specific to that call. ServiceUnavailableError and OperationTimeoutError can come from any call that reaches LucidLink services, and InternalError from any call; they are not repeated there. Errors common to every call on an object, such as ClientClosedError once its Client is closed, are described on its class, or on its module for lucidlink.connect.

Every FilespaceError carries filespace_id, the id of the filespace the error is about, when known. Messages are for humans and are not a contract.

Calls that close several filespaces (Workspace.stop, Client.close, the fsspec close) report every failure at once through LucidLinkErrorGroup, an ExceptionGroup whose members are all LucidLinkError instances (use except* or group.exceptions).

exception

lucidlink.exceptions.AccessDeniedError

AccessDeniedError()

Authenticated, but not allowed: not an admin, no access to the filespace.

Deliberately not an OSError. When the denied call names a path, the SDK raises FsPermissionError instead.

exception

lucidlink.exceptions.AuthenticationError

AuthenticationError()

The token is invalid, expired or revoked. Get a new token.

Deliberately not an OSError, so file-system tools never read it as "the path is missing".

exception

lucidlink.exceptions.ClientClosedError

ClientClosedError()

The Client is closed: a call on it after close(), or a call that needs it on an object obtained through it (its class says which); also a call on a closed fsspec LucidLinkFileSystem. Create a new one.

Also a ValueError.

exception

lucidlink.exceptions.ClientError

ClientError()

A Client lifecycle or state problem: it could not start or stop, or a call is not valid in its current state (e.g. logging in again with a different token), or a hub reply asked the native client to terminate, or the process was forked while a client ran in its parent. A call on a closed client raises the subclass ClientClosedError.

exception

lucidlink.exceptions.ConnectError

ConnectError(*args: Any, name: str | None = None, **details: Any)

Parameter

Description

name

The data store the error concerns, when known. Also an attribute of the error.

name

Description

The data store the error concerns, when known. Also an attribute of the error.

A Connect data-store operation failed, also when another client holds the data-store lock (retry) or the filespace has the maximum number of data stores.

exception

lucidlink.exceptions.DataStoreCredentialsError

DataStoreCredentialsError()

The external store rejected the data store's credentials (HTTP 401 / 403 on link, read or rekey). Rekey the data store with working credentials.

Deliberately not an OSError, like AuthenticationError.

exception

lucidlink.exceptions.DataStoreExistsError

DataStoreExistsError()

A data store with this name already exists.

exception

lucidlink.exceptions.DataStoreInUseError

DataStoreInUseError()

The data store still has linked files (remove()). Unlink them first.

exception

lucidlink.exceptions.DataStoreNotFoundError

DataStoreNotFoundError()

No data store with this name. Also a KeyError (so a Mapping of data stores can raise it from __getitem__); str() is the plain message, without KeyError's quotes.

exception

lucidlink.exceptions.ExternalObjectNotFoundError

ExternalObjectNotFoundError()

The external store has no such object (HTTP 404). Errno EIO: never a FileNotFoundError, because the filespace path itself exists.

exception

lucidlink.exceptions.ExternalStoreError

ExternalStoreError(*args: Any, key: str | None = None, **details: Any)

Parameter

Description

key

The object key or URL in the external store, when known. Also an attribute of the error.

key

Description

The object key or URL in the external store, when known. Also an attribute of the error.

The external store behind a Connect file failed (an S3 bucket, an HTTP server). Also an FsError (OSError, EIO): filename is the file's path in the filespace.

exception

lucidlink.exceptions.ExternalStoreUnavailableError

ExternalStoreUnavailableError()

The external store is unreachable, throttles (HTTP 429) or failed (5xx). Retry later. Also a ConnectionError.

exception

lucidlink.exceptions.FilespaceAlreadyLinkedError

FilespaceAlreadyLinkedError()

The filespace is already linked, with a cache size other than the one asked for (see Workspace.link_filespace()), or the runtime reports it as linked although the SDK is not tracking it. Unlink it first.

exception

lucidlink.exceptions.FilespaceError

FilespaceError(*args: Any, filespace_id: str | None = None)

Parameter

Description

filespace_id

The id of the filespace the error is about, when known. Also an attribute of the error.

filespace_id

Description

The id of the filespace the error is about, when known. Also an attribute of the error.

A Filespace lifecycle or state problem, also when LucidLink services have no endpoint for the filespace yet (e.g. it is still being created) or the filespace cancelled the operation (e.g. while it was being unlinked).

exception

lucidlink.exceptions.FilespaceInternalError

FilespaceInternalError()

The filespace hit an internal error and the SDK unlinked it without a final sync; everything else keeps working. Link it again to recover.

exception

lucidlink.exceptions.FilespaceNotFoundError

FilespaceNotFoundError()

No filespace with this id: link_filespace() with an unknown id.

Also a KeyError; str() is the plain message, without KeyError's quotes.

exception

lucidlink.exceptions.FilespaceNotLinkedError

FilespaceNotLinkedError()

The Filespace is no longer linked: it was unlinked, or the SDK unlinked it after an internal error. Link it again.

exception

lucidlink.exceptions.FilespaceSyncError

FilespaceSyncError()

The final sync on unlink() or with exit failed, or the SDK unlinked the filespace after an internal error before the final sync: pending changes may not have reached LucidLink services. They stay in the local cache only, and with ephemeral storage are lost when the client is closed. The filespace is unlinked anyway, unless unlinking failed as well: then both errors arrive together in a LucidLinkErrorGroup. A note names the underlying failure: the failed sync, or the FilespaceInternalError that made the SDK unlink the filespace.

exception

lucidlink.exceptions.FsDirectoryNotEmptyError

FsDirectoryNotEmptyError()

The directory is not empty (ENOTEMPTY, as os.rmdir). No builtin subclass exists.

exception

lucidlink.exceptions.FsError

FsError()

A path-level file-system operation failed.

Also an OSError: errno, strerror, filename (also readable as path) and filename2 (for two-path calls such as move) are set, and str() has the stdlib shape [Errno <n>] <message>: '<path>'. Raised directly, with errno EIO, for failures with no more specific class, and with errno EBUSY (another client holds a lock on the path), ELOOP (a symbolic link), EFBIG (the maximum file size is reached), EINVAL (e.g. a directory moved into itself) or ENOSYS (hard links not supported) for those conditions. A failing external store behind a Connect file is an ExternalStoreError, which is also an FsError.

Like OSError(errno, ...), FsError(errno, strerror[, filename, ...]) called on FsError itself returns the subclass of that errno (FsError(errno.ENOENT, ...) is an FsNotFoundError); its subclasses are never redirected.

exception

lucidlink.exceptions.FsExistsError

FsExistsError()

The path already exists. Also a FileExistsError (EEXIST).

exception

lucidlink.exceptions.FsIsADirectoryError

FsIsADirectoryError()

A file was expected but the path is a directory. Also an IsADirectoryError (EISDIR).

exception

lucidlink.exceptions.FsNoSpaceError

FsNoSpaceError()

No space (ENOSPC): a filespace limit was reached (entries, storage, data, or external-file size or count; raise the limit), or the local disk is full. The message says which.

exception

lucidlink.exceptions.FsNotADirectoryError

FsNotADirectoryError()

A directory was expected. Also a NotADirectoryError (ENOTDIR).

exception

lucidlink.exceptions.FsNotFoundError

FsNotFoundError()

The path does not exist. Also a FileNotFoundError (ENOENT).

exception

lucidlink.exceptions.FsPermissionError

FsPermissionError()

The operation on this path is not permitted. Also a PermissionError.

errno is EACCES (no access to the path) or EPERM (e.g. a hard link to a directory); or EROFS when the file or the filespace is read-only (code that checks errno == EACCES does not see that case).

exception

lucidlink.exceptions.IncompatibleVersionError

IncompatibleVersionError()

This client is too old, or the filespace or KeyStack version is not supported. Upgrade.

exception

lucidlink.exceptions.InternalError

InternalError()

A bug, a failed assertion, corrupted data or a broken native contract. Report it. A failure this SDK version cannot classify is a plain LucidLinkError instead.

exception

lucidlink.exceptions.InvalidArgumentError

InvalidArgumentError()

A bad argument value (native InvalidArgument, or Python-side validation).

Also a ValueError. Wrong argument types raise the builtin TypeError instead. Also raised for invalid storage settings (StorageConfig, storage mode), fsspec options, or a configuration the native runtime rejects (including an unreachable cache location).

exception

lucidlink.exceptions.NotLoggedInError

NotLoggedInError()

The Client is not logged in. Call login() first.

exception

lucidlink.exceptions.OperationTimeoutError

OperationTimeoutError()

The operation timed out, or a service answered 408. For a mutating call the outcome is unknown.

Also a TimeoutError (ETIMEDOUT).

exception

lucidlink.exceptions.RateLimitedError

RateLimitedError()

LucidLink services answered 429. Back off, then retry.

A sibling of ServiceUnavailableError, deliberately not a ConnectionError: the service is reachable and asked the caller to slow down.

exception

lucidlink.exceptions.ServiceUnavailableError

ServiceUnavailableError()

LucidLink services, the hub or a store are unreachable or answered 5xx. Retry later.

Also a ConnectionError. errno is None (an ECONNREFUSED would wrongly claim a ConnectionRefusedError); filename is set when the failed call named a path.

exception

lucidlink.exceptions.UnsupportedOperationError

UnsupportedOperationError()

The operation is not available here: Connect on a filespace without it, a data-store kind the filespace version does not support, an unsupported native operation.

Deliberately not a NotImplementedError (that is a RuntimeError).