# Error handling

{% hint style="warning" %}
In order for the consumer offset mapping functionality to work, both of the following requirements must be met:

* K2K must be configured to publish offset mappings.
* The `k2k-offset-mapping` application must be configured and deployed.

Without both components active, consumer group offsets on the target cluster will not be translated.
{% endhint %}

The K2K Offset Mapping application may encounter situations during operation that are symptomatic of a configuration or environmental problem. Its error handling configuration provides control over how the application should respond to these specific conditions.

* &#x20;**`fail` :** Stops the application immediately upon error detection, preventing any further offset synchronization. This is the safest option and is recommended for most deployments.
* &#x20;**`ignore`:** Logs the error and allows the application to continue operating. This should be used with caution, as ignoring persistent errors can lead to incorrect offset translations or obscure serious underlying problems.

| Scenario                  | Description                                                                                                                                                                                                                                                                               |
| ------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Duplicate offset mappings | Defines the behavior when a single record has two associated offset mappings. This can occur when two K2K instances with different [Records routing](/latest/k2k/configuration/records-routing.md) configurations the same source topics between the same source and target cluster pair. |
| Active consumer on target | Defines the behavior when an offset commit to the target cluster fails because a consumer application is actively registered in the target consumer group.                                                                                                                                |

```yaml
errorHandling:
  onMultipleTargetCommittedOffsets: "fail"
  onActiveConsumerGroupCommit: "fail"
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.lenses.io/latest/k2k/k2k-offset-mapping/error-handling.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
