---
title: "Get Index Errors Operation"
url: "https://docs.ravendb.net/6.2/client-api/operations/maintenance/indexes/get-index-errors"
version: "6.2"
language: "python"
---

# Get Index Errors Operation

> Client language: Python. Also available for [C#](https://docs.ravendb.net/6.2/client-api/operations/maintenance/indexes/get-index-errors.md), [Java](https://docs.ravendb.net/6.2/client-api/operations/maintenance/indexes/get-index-errors.java.md), [PHP](https://docs.ravendb.net/6.2/client-api/operations/maintenance/indexes/get-index-errors.php.md), [Node.js](https://docs.ravendb.net/6.2/client-api/operations/maintenance/indexes/get-index-errors.nodejs.md).
>
> RavenDB publishes an official agent skill for coding assistants at https://docs.ravendb.net/skills/ravendb/SKILL.md (also installable with `npx skills add ravendb/skills`). The skill describes itself as: "Read this before writing any RavenDB query, client call or /databases/ request. Covers server setup, document modelling, the Node.js, .NET and Python clients, RQL, indexes, vector search and AI agents. Code written from recall tends to run and return the wrong rows, because RQL resembles SQL and the clients take field names as plain strings."

> **Note**
>
> - Use `GetIndexErrorsOperation` to get errors encountered during indexing.
>
> - The index errors will be retrieved only from the server node defined by the current [client-configuration](https://docs.ravendb.net/6.2/client-api/configuration/load-balance/overview.md#client-logic-for-choosing-a-node).
>
> - To learn about clearing index errors, see [delete index errors](https://docs.ravendb.net/6.2/client-api/operations/maintenance/indexes/delete-index-errors.python.md).
>
> - In this page:
>   - [Get errors for all indexes](#get-errors-for-all-indexes)
>   - [Get errors for specific indexes](#get-errors-for-specific-indexes)
>   - [Syntax](#syntax)

## Get errors for all indexes

```python
# Define the get index errors operation
get_index_errors_op = GetIndexErrorsOperation()

# Execute the operation by passing it to maintenance.send
index_errors = store.maintenance.send(get_index_errors_op)

# index_errors will contain errors for ALL indexes
```

## Get errors for specific indexes

```python
# Define the get index errors operation for specific indexes
get_index_errors_op = GetIndexErrorsOperation("Orders/Totals")

# Execute the operation by passing it to maintenance.send
# An exception will be thrown if any of the specified indexes do not exist
index_errors = store.maintenance.send(get_index_errors_op)

# index_errors will contain errors only for index "Orders/Totals"
```

## Syntax

```python
class GetIndexErrorsOperation(MaintenanceOperation[List[IndexErrors]]):
  def __init__(self, *index_names: str):  # If no index_names provided, get errors for all indexes
      ...
```

| Parameters | Type | Description |
| - | - | - |
| **\*index\_names** | `str` | List of index names to get errors for |

| Return value of<br />`store.maintenance.send(GetIndexErrorsOperation)` | Description |
| - | - |
| `List[IndexErrors]` | List of `IndexErrors` classes - see definition below.<br />An exception is thrown if any of the specified indexes doesn't exist. |

```python
class IndexErrors:
  def __init__(self, name: Optional[str] = None, errors: Optional[List[IndexingError]] = None):
      self.name = name  # Index name
      self.errors = errors  # List of errors for this index
```

```python
class IndexingError:
  def __init__(
      self,
      error: Optional[str] = None,
      timestamp: Optional[datetime.datetime] = None,
      document: Optional[str] = None,
      action: Optional[str] = None,
  ):
      # Error message
      self.error = error

      # Time of error
      self.timestamp = timestamp

      # If action is 'Map'    - field will contain the document ID
      # If action is 'Reduce' - field will contain the Reduce key value
      # For all other actions - field will be None
      self.document = document

      # Area where error has occurred, e.g. Map/Reduce/Analyzer/Memory/etc.
      self.action = action
```

## See also

- [What are Indexes](https://docs.ravendb.net/6.2/indexes/what-are-indexes.python.md)
- [Creating and Deploying Indexes](https://docs.ravendb.net/6.2/indexes/creating-and-deploying.md)
- [Debugging Index Errors](https://docs.ravendb.net/6.2/indexes/troubleshooting/debugging-index-errors.md)
- [Index Administration](https://docs.ravendb.net/6.2/indexes/index-administration.md)
- [How to Reset Index](https://docs.ravendb.net/6.2/client-api/operations/maintenance/indexes/reset-index.python.md)
- [Delete index errors](https://docs.ravendb.net/6.2/client-api/operations/maintenance/indexes/delete-index-errors.python.md)
