> For the complete documentation index, see [llms.txt](https://docs.cennso.com/components/dpr/latest/llms.txt) (all documentation: [llms.txt](https://docs.cennso.com/llms.txt)). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cennso.com/components/dpr/latest/troubleshooting/result-codes.md).

# Diameter error Result-Codes

Every Diameter answer has a `Result-Code` Attribute-Value Pair (AVP). When the Diameter Proxy (DPR) cannot forward a request, it generates the answer with a Result-Code AVP that describes the reason of the failure. This document lists the error Result-Codes that DPR generates, with their meaning and the recommended action.

> [!NOTE]
> Result-Codes that are not listed in this document come from an upstream Diameter agent. DPR forwards such requests and returns the agent's response to the client unchanged. To see those codes, read the documentation of the upstream agent and [RFC 6733](https://www.rfc-editor.org/rfc/rfc6733).

In addition to the Result-Code AVP in the Diameter response, DPR records each code from this document in the `result_code` label of the **diameter_proxy_send_counter** metric. For more information, see the [Metrics](https://docs.cennso.com/components/dpr/latest/observability/metrics.md) document.

## Protocol errors

Protocol errors relate to routing or relaying a request, and a relay agent can retry the request against another peer. The following table lists the protocol errors that DPR returns:

| Code | Name | Description | Recommended action |
| --- | --- | --- | --- |
| 3002 | DIAMETER_UNABLE_TO_DELIVER | DPR cannot deliver the request to any upstream Diameter agent that serves the destination realm in the incoming request. DPR returns this code when the request to the selected peer times out, or when all peers configured for the realm are marked `down`. | In the DPR logs, check that the upstream Diameter agents are reachable. To do so, check that the most recent  entry for the peer is `Diameter event up`. For how DPR selects peers and marks them unavailable, see the [Transports and routing configuration](https://docs.cennso.com/components/dpr/latest/configuration/routing.md) guide. |
| 3003 | DIAMETER_REALM_NOT_SERVED | The `Destination-Realm` in the request does not match any realm in DPR's routing configuration. | Verify the `Destination-Realm` in the request and the **diameter_proxy.realms** entries in DPR's configuration. See the [Transports and routing configuration](https://docs.cennso.com/components/dpr/latest/configuration/routing.md) guide. |

## Permanent failures

A permanent failure means DPR rejected the request, and a retry of the same request fails again. The following table lists the permanent failures that DPR returns:

| Code | Name | Description | Recommended action |
| --- | --- | --- | --- |
| 5001 | DIAMETER_AVP_UNSUPPORTED | The request contains an AVP that is marked mandatory (M-bit set) and that DPR's dictionary does not support. | Inspect the message that the peer sent. If the peer should not send this AVP, discuss it with the operators of the sending Diameter agent. If DPR must support the AVP, request the change from the DPR maintainers, because it requires an update to DPR's dictionary and a new DPR image. |
| 5004 | DIAMETER_INVALID_AVP_VALUE | An AVP carries a value that is invalid or does not match its definition. | Inspect the invalid AVP in the message that the peer sent. Contact the operators of the sending Diameter agent about the invalid value. |
| 5005 | DIAMETER_MISSING_AVP | The request does not contain a required AVP. | Make sure the peer includes all AVPs that are mandatory for the command. |
| 5007 | DIAMETER_CONTRADICTING_AVPS | The request contains two or more AVPs that cannot occur together. | Review the message that the peer sent. Contact the operators of the sending Diameter agent to remove the contradicting AVPs. |
| 5008 | DIAMETER_AVP_NOT_ALLOWED | The request contains an AVP that is not allowed in this command. | Review the message that the peer sent. Contact the operators of the sending Diameter agent about not allowed value.|
| 5009 | DIAMETER_AVP_OCCURS_TOO_MANY_TIMES | An AVP occurs in the request more times than its definition allows. | Review the message that the peer sent. Contact the operators of the sending Diameter agent. |
| 5012 | DIAMETER_UNABLE_TO_COMPLY | DPR returns this code in two cases:   - The request does not contain a `Destination-Realm` AVP, so DPR cannot make a routing decision.   - Diameter agent cannot handle the forwarded request. | Make sure the peer includes a `Destination-Realm` AVP in the request. For how DPR routes on the `Destination-Realm`, see the [Transports and routing configuration](https://docs.cennso.com/components/dpr/latest/configuration/routing.md) guide. |
| 5014 | DIAMETER_INVALID_AVP_LENGTH | The length field of an AVP does not match the AVP value. | Review the message encoding on the peer. Contact the operators of the sending Diameter agent. |
