> For the complete documentation index, see [llms.txt](https://docs.cennso.com/components/cdf/4.2/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/cdf/4.2/troubleshooting.md).

# Troubleshooting

## Archive service is configured but unreachable

If a separate archive service is configured but not present, no CDRs are archived, and you receive an error message indicating that the service cannot be reached. There is no performance loss, but the variation increases in the CDR/s rate to the Charging Gateway Function (CGF). The average number of CDR/s sent to CGF stays the same, but instead of being around 1,000 ±100 (under normal conditions), it can fluctuate by ±300.

```mermaid
sequenceDiagram
CDF ->> NATS : CDR
CDF ->> NATS : key-value data
CDF -x Archive : CDR
Note right of Archive : Connection down
```

When the archive service is brought back, the CDF resumes archiving CDRs starting from that point in time.

For more information on troubleshooting NATS, read the official [NATS documentation](https://docs.nats.io/running-a-nats-service/configuration/clustering/jetstream_clustering/troubleshooting).

## KV store service is unreachable

When a KV store service is down, CDF experiences a slight performance drop. However, this impact is still less severe than if the KV store is hosted on the same service as other NATS services. If the KV store service is brought back before CDF stops for any reason, there is no loss of CDF operational state.

```mermaid
sequenceDiagram
CDF ->> NATS : CDR
CDF ->> KV Store : key-value data
Note right of KV Store : Connection down
```
For more information on troubleshooting NATS, read the official [NATS documentation](https://docs.nats.io/running-a-nats-service/configuration/clustering/jetstream_clustering/troubleshooting).

## GTP Prime sequence number

“GTP Prime sequence number” is included in the messages created towards CGF.
This value is a 16-bit number which wraps around at 65536.
The following diagrams show case various potential error scenarios and their consequences.
For brevity, CDF Sender is only called CDF.

### No connection available

```mermaid
sequenceDiagram
Work Queue ->> CDF : CDR1
Note right of CDF : No connection available
CDF ->> Work Queue : CDR1 nack
```
This should protect CDF Sender from the described situation of consuming all available GTP Prime Sequence numbers.

### No response case

```mermaid
sequenceDiagram
Work Queue ->> CDF : CDR1
CDF ->> CGF : GTP1 (for CDR1)
CDF ->> CGF : GTP1 (for CDR1), retry
Note right of CDF : Configured number of retries later
CDF ->> Work Queue : CDR1 nack
```
This should protect CDF Sender from the described situation of consuming all available GTP Prime Sequence numbers.

### Response timeout too short for CGF

```mermaid
sequenceDiagram
Work Queue ->> CDF : CDR1
CDF ->> CGF : GTP1 (for CDR1)
CDF ->> CGF : GTP1 (for CDR1), retry
Note right of CDF : Configured number of retries later
CDF ->> Work Queue : CDR1 nack
Work Queue ->> CDF : CDR2
CDF ->> CGF : GTP2 (for CDR2)
CGF ->> CDF : GTP1 (for CDR1)
CDF ->> Work Queue : CDR2 nack
```
This should protect CDF Sender from the described situation of consuming all available GTP Prime Sequence numbers.

### Wrong acknowledgement

```mermaid
sequenceDiagram
Work Queue ->> CDF : CDR1
CDF ->> CGF : GTP1 (for CDR1)
CDF ->> CGF : GTP1 (for CDR1), retry
CDF ->> Work Queue : CDR1 nack
Work Queue ->> CDF : CDR2
CDF ->> CGF : GTP2 (for CDR2)
CDF ->> CGF : GTP2 (for CDR2), retry
CDF ->> Work Queue : CDR2 nack
Note right of Work Queue : Many CDR later
Work Queue ->> CDF : CDR65535
CDF ->> CGF : GTP65535 (for CDR65535)
CDF ->> CGF : GTP65535 (for CDR65535), retry
CDF ->> Work Queue : CDR65535 nack
Work Queue ->> CDF : CDR65536
CDF ->> CGF : GTP1 (for CDR65536)
CGF ->> CDF : GTP1 (for CDR1)
CDF ->> Work Queue : CDR65536 ack
```
It is possible to acknowledge a CDR to NATS Work Queue without having received a response for this CDR from CGF.
When the configured response timeout is longer than the CGF response time, this is not a problem.
With normal values for retries (1 time) and response timeout (1 second), this happens if CGF takes more than 36 hours to respond.
