---
title: Errors
description: Errors in the dltHub Runtime Python SDK (dlthub_sdk)
keywords: [dlthub, runtime, python sdk, dlthub_sdk, api]
---
# Errors

<!-- generated from dlthub-client 0.33.1, do not edit -->

New to the SDK? [Getting started](getting-started.md) shows how to connect and use it.

## `DlthubError` {#dlthuberror}

Base for every error that the SDK raises.

**Attributes**

| Name | Type | Description |
| --- | --- | --- |
| `message` | <code>str</code> | Human-readable description. |
| `code` | <code>str &#124; None</code> | Stable error code of the runtime, when the response carried one. Unlike `message`, it does not change between releases. |
| `status` | <code>int &#124; None</code> | HTTP status that the server returned, when known. |
| `fields` | <code>tuple[<a href="#fielderror">FieldError</a>, ...]</code> | Per-field reasons, when the runtime reported any. |
| `client_update` | <code><a href="#clientupdate">ClientUpdate</a> &#124; None</code> | Set when the failing response advertised a minimum client version newer than the installed one. This is a likely cause of the failure. |

## `ApiError` {#apierror}

Subclass of [`DlthubError`](#dlthuberror).

The runtime rejected the request or returned an unusable response.

## `BadRequest` {#badrequest}

Subclass of [`ApiError`](#apierror).

The runtime rejected the request itself. The same request fails again.

`message` says why. `code` names the reason when the runtime gave one, and
`fields` carries the per-field reasons when the runtime named any. The SDK
also raises it before it sends a request, when an argument cannot form one,
for example an ID that is not a UUID. `status` is then `None`.

## `InvalidResponse` {#invalidresponse}

Subclass of [`ApiError`](#apierror).

A response did not parse, or broke an invariant that the SDK depends on.

## `ServerError` {#servererror}

Subclass of [`ApiError`](#apierror).

The server failed to handle the request. A retry can succeed.

## `Conflict` {#conflict}

Subclass of [`DlthubError`](#dlthuberror).

The current state does not allow the call, for example an archived workspace.

`code` names the reason when the runtime gave one (`workspace_archived`,
`upstream_not_fresh`, ...), and `message` describes it. The set of reasons
grows with the runtime, so `code` is more specific than this class.

## `NotAuthenticated` {#notauthenticated}

Subclass of [`DlthubError`](#dlthuberror).

The credential is missing, malformed, or rejected.

## `DataplaneTokenRejected` {#dataplanetokenrejected}

Subclass of [`NotAuthenticated`](#notauthenticated).

The data plane rejected the short-lived token that the runtime issued for it.

The runtime accepted the credential of the caller, which got that token, so a
renewed or new credential does not help. For regular calls, the SDK already
got a new token and retried once. The SDK does not retry an upload.

## `NotAuthorized` {#notauthorized}

Subclass of [`DlthubError`](#dlthuberror).

The caller is authenticated but lacks the access that the call needs.

`message` says what is missing.

## `NotFound` {#notfound}

Subclass of [`DlthubError`](#dlthuberror).

The addressed resource does not exist.

**Attributes**

| Name | Type | Description |
| --- | --- | --- |
| `kind` | <code>EntityKind</code> | The kind of entity that the call looked for. |
| `ref` | <code>str &#124; None</code> | The ID or name that the call did not find, or `None` when the call addressed no particular one. |
| `code` | <code>str &#124; None</code> | Stable error code of the runtime, when the response carried one. |
| `status` | <code>int &#124; None</code> | HTTP status that the server returned, when known. |
| `fields` | <code>tuple[<a href="#fielderror">FieldError</a>, ...]</code> | Per-field reasons, when the runtime reported any. |
| `client_update` | <code><a href="#clientupdate">ClientUpdate</a> &#124; None</code> | As for [`DlthubError`](#dlthuberror). |

## `ScopeMissing` {#scopemissing}

Subclass of [`DlthubError`](#dlthuberror).

The call needs an organization or workspace that the caller did not give.

An example is `runtime.workspaces.list()` with no `organization_id`, at
connect time or as an argument.

## `TransportError` {#transporterror}

Subclass of [`DlthubError`](#dlthuberror).

The request did not produce a response.

This error cannot tell if the request reached the runtime. As a result, the
outcome of a mutation is unknown.

## `ConnectionFailed` {#connectionfailed}

Subclass of [`TransportError`](#transporterror).

The SDK did not reach the runtime.

## `TransportTimeout` {#transporttimeout}

Subclass of [`TransportError`](#transporterror).

An upload or log stream exceeded its time limit.

Other requests have no client-side timeout.

## `UnboundEntity` {#unboundentity}

Subclass of [`DlthubError`](#dlthuberror).

The object was constructed directly, so it cannot call the runtime.

Only an object that the SDK returns can call the runtime. The class is also an
`AttributeError`, so `hasattr` keeps working.

## `WaitTimeout` {#waittimeout}

Subclass of [`DlthubError`](#dlthuberror).

The awaited state did not settle before the deadline. Nothing failed.

## `ClientUpdate` {#clientupdate}

The runtime requires a newer `dlthub-client` than the installed one.

**Attributes**

| Name | Type | Description |
| --- | --- | --- |
| `installed` | <code>str</code> | The installed version. |
| `minimum` | <code>str</code> | The lowest version that the runtime supports. |

### `ClientUpdate.from_headers()` {#clientupdate-from_headers}

```python
from_headers(headers: Mapping[str, str]) -> ClientUpdate | None
```

Read the minimum client version of the runtime from one response.

**Arguments**

| Name | Type | Description |
| --- | --- | --- |
| `headers` | <code>Mapping[str, str]</code> | The response headers, looked up case-insensitively. |

**Returns:** <code><a href="#clientupdate">ClientUpdate</a> &#124; None</code> — The update, or `None` when the installed version is not older than the advertised minimum, or the response advertised none.

## `FieldError` {#fielderror}

One reason that the runtime gave for a rejected request.

**Attributes**

| Name | Type | Description |
| --- | --- | --- |
| `key` | <code>str &#124; None</code> | The field at fault, when the runtime named one. |
| `message` | <code>str</code> | What is wrong with it. |
