> For the complete documentation index, see [llms.txt](https://docs.openiam.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.openiam.com/troubleshooting/message-broker/3-rabbitmq-connection-timeout.md).

# RabbitMQ connection timeout issue

Why no OpenIAM service starts when RabbitMQ's own hostname does not resolve, and how to match the Mnesia hostname to the server.

| Symptom                                                                                  | Likely cause                                                                   | Resolution                                             |
| ---------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------ | ------------------------------------------------------ |
| **No** OpenIAM service comes up, and every service log ends in an `AmqpTimeoutException` | The RabbitMQ server's hostname does not resolve, so Erlang cannot reach Mnesia | Resolve both the server and the Mnesia hostname, below |
| `rabbitmqctl status` takes a long time to return                                         | The same unresolved hostname — the delay is the lookup timing out              | The same                                               |

## Symptom

None of the OpenIAM services reach a running state. Their logs carry a bean-creation failure whose root cause is an AMQP timeout:

{% code overflow="wrap" %}

```
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'auditLogHelper': Unsatisfied dependency expressed through field 'queue'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'AuditLogQueue' defined in class path resource [org/openiam/config/AuditVHostConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.openiam.mq.constants.queue.audit.AuditLogQueue]: Factory method 'auditLogQueue' threw exception; nested exception is org.springframework.amqp.AmqpTimeoutException: java.util.concurrent.TimeoutException.
```

{% endcode %}

The failing bean varies with whichever service you read — what identifies this problem is the `AmqpTimeoutException` at the bottom of it, in every service at once.

## Why it happens

The RabbitMQ server's hostname is not resolving, so Erlang cannot connect to Mnesia, the broker's own database. `rabbitmqctl status` returning only after a long delay is the same lookup timing out, and is the quickest confirmation.

## Resolution

{% stepper %}
{% step %}
**Add the RabbitMQ server's hostname to `/etc/hosts`.**
{% endstep %}

{% step %}
**Check the Mnesia hostname matches the server's.** List `/var/lib/rabbitmq/mnesia` — the directory and pid file are named `rabbit@` followed by the hostname Mnesia believes it has.

<figure><img src="https://2965242200-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0uHWHRgcad6P03ehqgmX%2Fuploads%2Fgit-blob-e2f67fb7c80f78771969c20477c7ebf6031a2d3d%2F3-timeout-issue.png?alt=media" alt="A terminal listing of /var/lib/rabbitmq/mnesia, where the directory and pid file are named rabbit@ followed by the server hostname"><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**If the two differ, add the Mnesia hostname to `/etc/hosts` as well.** Both names have to resolve — the server's, and whatever Mnesia recorded for itself.
{% endstep %}
{% endstepper %}


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.openiam.com/troubleshooting/message-broker/3-rabbitmq-connection-timeout.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
