> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-parallel-read-in-order-multi-part.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> System table containing error codes with the number of times they have been triggered.

# system.errors

<Info>
  **Querying in ClickHouse Cloud**

  The data in this system table is held locally on each node in ClickHouse Cloud. Obtaining a complete view of all data, therefore, requires the `clusterAllReplicas` function. See [here](/reference/system-tables/overview#system-tables-in-clickhouse-cloud) for further details.
</Info>

<h2 id="description">
  Description
</h2>

Contains error codes with the number of times they have been triggered.

To show all possible error codes, including ones which were not triggered, set setting [system\_events\_show\_zero\_values](/reference/settings/session-settings/system#system_events_show_zero_values) to 1.

<h2 id="columns">
  Columns
</h2>

* `name` ([String](/reference/data-types/string)) — Name of the error (errorCodeToName).
* `code` ([Int32](/reference/data-types/int-uint)) — Code number of the error.
* `value` ([UInt64](/reference/data-types/int-uint)) — The number of times this error happened.
* `last_error_time` ([DateTime](/reference/data-types/datetime)) — The time when the last error happened.
* `last_error_message` ([String](/reference/data-types/string)) — Message for the last error.
* `last_error_format_string` ([String](/reference/data-types/string)) — Format string for the last error.
* `last_error_trace` ([Array(UInt64)](/reference/data-types/array)) — A stack trace of the last error. On ELF platforms except FreeBSD, addresses inside the main ClickHouse binary are stored as physical file offsets, and other addresses are virtual memory addresses inside the ClickHouse server process.
* `remote` ([UInt8](/reference/data-types/int-uint)) — Remote exception (i.e. received during one of the distributed queries).
* `query_id` ([String](/reference/data-types/string)) — Id of a query that caused an error (if available).
* `last_error_symbols` ([Array(LowCardinality(String))](/reference/data-types/array)) — Demangled symbol names corresponding to last\_error\_trace.
* `last_error_lines` ([Array(LowCardinality(String))](/reference/data-types/array)) — File names with line numbers corresponding to last\_error\_trace.

Counters for some errors may increase during successful query execution. It's not recommended to use this table for server monitoring purposes unless you are sure that corresponding error can not be a false positive.

`last_error_symbols` and `last_error_lines` are resolved from the binary's symbol table and debug info.
`last_error_symbols` is populated wherever the symbol table is available (Linux and macOS builds).
`last_error_lines` additionally requires DWARF debug info - read directly from the binary on Linux, or from a co-located `.dSYM` bundle on macOS - so it is empty when that debug info is not available. Both arrays are empty on platforms without introspection support (for example FreeBSD).

<h2 id="example">
  Example
</h2>

```sql title="Query" theme={null}
SELECT name, code, value
FROM system.errors
WHERE value > 0
ORDER BY code ASC
LIMIT 1

┌─name─────────────┬─code─┬─value─┐
│ CANNOT_OPEN_FILE │   76 │     1 │
└──────────────────┴──────┴───────┘
```

```sql title="Response" theme={null}
WITH arrayMap(x -> demangle(addressToSymbol(x)), last_error_trace) AS all
SELECT name, arrayStringConcat(all, '\n') AS res
FROM system.errors
LIMIT 1
SETTINGS allow_introspection_functions=1\G
```
