> For the complete documentation index, see [llms.txt](https://docs.sportradar.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sportradar.com/uof/error-handling/error-catalogue/unexpected-connection-driver-exception.md).

# Unexpected connection driver exception

**Error**

Customers may encounter the following error message when attempting to connect to the RabbitMQ server.

```
"Unexpected connection driver exception"
```

Example Log:

```shell
Unexpected connection driver exception for connection amqp://Qe1***eVM@3.33.235.167:5671//unifiedfeed/23793
javax.net.ssl.SSLException: Connection has been shutdown: javax.net.ssl.SSLException: java.net.SocketException: Connection reset
```

**Applies to**

UOF SDK Java

**Symptoms**

In the SDK execution logs, we can observe log entries: *Unexpected connection driver exception*. This is quite common error type during reconnection attempts and it is usually resolved by itself within 1 minute or so.

The SDK relies on the RabbitMQ client library for communication with the RabbitMQ server. This error typically is first instance of defense when identifying and recovering a lost connection with the RabbitMQ server. In other words, the RabbitMQ client often throws the "Unexpected connection driver exception" when the connection is lost. There are various ways the RabbitMQ client represents such failures and recoveries in the logs in terms of message ordering.

* One scenario is where the RabbitMQ does not immediately notify about the failure and throws an exception indicating a lost connection only after the connection is reestablished. This may result in the "Unexpected connection driver exception" occurring minutes later, after messages stop flowing through the SDK.  In this case, the SDK identifies a lack of communication with the server at the application level and triggers an Alive Violation before the RabbitMQ client notifies about the lost connection. As a result, the producer is initially marked as DOWN due to AliveViolation (which may later be changed to ConnectionDown).
* In another scenario, the RabbitMQ client promptly throws the exception upon detecting a lost connection, leading to the producer being marked as DOWN due to ConnectionDown. This status may later transition to AliveViolation if the connection does not recover immediately.

**Causes**

1. **Driver/Library Issues:** The driver/library used to connect to RabbitMQ may encounter unexpected conditions or errors due to bugs, misconfigurations, or incompatibility issues. The issue could stem from an incompatible version of the RabbitMQ library with the server. The SDK is rigorously tested with the RabbitMQ library it was initially shipped with. Therefore, using other versions of the RabbitMQ library may result in this or other issues.
2. **Network Problems:** Connectivity issues, DNS resolution failures, or firewall restrictions can lead to such exceptions.
3. **Resource Limitations:** Server resource constraints (such as memory or file descriptors) being reached can sometimes manifest as connection issues.

**Resolution**

* **Upgrade SDK:** Update to a version 2.0.53 or later, preferably version v3.x which uses much more contemporary rabbit library. The SDK versions v3.x are using rabbitMQ which is 3 major releases newer than the previous one. it is strongly recommended to be upgrade to v3.x version of the SDK. If the issue persists, try restarting the SDK.
* **Network Diagnostics**: Perform network diagnostics (like pinging the server, checking open ports, etc.) to ensure that there are no network-related issues.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.sportradar.com/uof/error-handling/error-catalogue/unexpected-connection-driver-exception.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
