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:
- a missing path raises
FsNotFoundError, which is also aFileNotFoundError(errno2,filenameset); - an existing path raises
FsExistsError(FileExistsError); NotADirectoryError,IsADirectoryErrorandPermissionErrorhave the same kind of counterpart (FsNotADirectoryError,FsIsADirectoryError,FsPermissionError);- a network failure raises
ServiceUnavailableError(ConnectionError), a timeoutOperationTimeoutError(TimeoutError); - a bad value raises
InvalidArgumentError(ValueError), a call on a closed clientClientClosedError(ValueError), and a missing data storeDataStoreNotFoundError(KeyError).
Either class can be caught
from lucidlink.exceptions import LucidLinkErrortry: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).
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.
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".
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.
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.
lucidlink.exceptions.ConnectError
ConnectError(*args: Any, name: str | None = None, **details: Any)Parameter | Description |
|---|---|
| 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.
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.
lucidlink.exceptions.DataStoreExistsError
DataStoreExistsError()A data store with this name already exists.
lucidlink.exceptions.DataStoreInUseError
DataStoreInUseError()The data store still has linked files (remove()). Unlink them first.
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.
lucidlink.exceptions.ExternalObjectNotFoundError
ExternalObjectNotFoundError()The external store has no such object (HTTP 404). Errno EIO: never a FileNotFoundError, because the filespace path itself exists.
lucidlink.exceptions.ExternalStoreError
ExternalStoreError(*args: Any, key: str | None = None, **details: Any)Parameter | Description |
|---|---|
| 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.
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.
lucidlink.exceptions.FilespaceError
FilespaceError(*args: Any, filespace_id: str | None = None)Parameter | Description |
|---|---|
| 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).
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.
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.
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.
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.
lucidlink.exceptions.FsDirectoryNotEmptyError
FsDirectoryNotEmptyError()The directory is not empty (ENOTEMPTY, as os.rmdir). No builtin subclass exists.
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, called on FsError itself returns the subclass of that errno (FsError(errno.ENOENT, is an FsNotFoundError); its subclasses are never redirected.
lucidlink.exceptions.FsExistsError
FsExistsError()The path already exists. Also a FileExistsError (EEXIST).
lucidlink.exceptions.FsIsADirectoryError
FsIsADirectoryError()A file was expected but the path is a directory. Also an IsADirectoryError (EISDIR).
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.
lucidlink.exceptions.FsNotADirectoryError
FsNotADirectoryError()A directory was expected. Also a NotADirectoryError (ENOTDIR).
lucidlink.exceptions.FsNotFoundError
FsNotFoundError()The path does not exist. Also a FileNotFoundError (ENOENT).
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).
lucidlink.exceptions.IncompatibleVersionError
IncompatibleVersionError()This client is too old, or the filespace or KeyStack version is not supported. Upgrade.
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.
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).
lucidlink.exceptions.LucidLinkDeprecationWarning
LucidLinkDeprecationWarning()A deprecated SDK feature was used. Emitted with stacklevel=2 so the warning points at the caller.
lucidlink.exceptions.LucidLinkError
LucidLinkError()Root of every error the SDK raises on purpose.
Catch it to handle "anything the SDK raised". Most subclasses also inherit a builtin (FileNotFoundError, ConnectionError, ValueError, …), so existing code that catches builtins keeps working.
Raised as itself for a failure this SDK version cannot classify: an HTTP status with no class, or an unknown native error, which the SDK also logs as a warning on the lucidlink logger.
lucidlink.exceptions.LucidLinkErrorGroup
LucidLinkErrorGroup(message: str, exceptions: Iterable[BaseException])Several failures from one call that works on several filespaces (Workspace.stop, Client.close, the fsspec close / sync_all), or from Filespace.unlink() / with exit when both the final sync (or closing the files still open) and unlinking fail: then the members are a FilespaceSyncError or a FilespaceError (a note names the sync or close failure) and the error from unlinking.
Also an ExceptionGroup. Every member is a LucidLinkError (a member of another type is wrapped in InternalError whose message is the original's type and text); a BaseException such as KeyboardInterrupt is never collected but escapes at once; a member that is not an exception instance raises InternalError. Handle with except*, or iterate group.exceptions.
derive(excs: Sequence[BaseException]) -> LucidLinkErrorGroup
A LucidLinkErrorGroup with the same message and attributes holding excs, as split(), subgroup() and except* build it.
lucidlink.exceptions.LucidLinkWarning
LucidLinkWarning()Base class of the SDK's own warnings. A warning that Python's own file objects also give keeps its builtin class: ResourceWarning for a file not closed, and RuntimeWarning for line buffering in binary mode.
lucidlink.exceptions.NotLoggedInError
NotLoggedInError()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).
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.
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).