# Logstash fails to connect to RabbitMQ, complains about auth issue

**URL:** <https://discuss.elastic.co/t/logstash-fails-to-connect-to-rabbitmq-complains-about-auth-issue/218741>\
**Category:** Logstash\
**Created:** [February 11, 2020, 9:26am UTC](https://discuss.elastic.co/t/logstash-fails-to-connect-to-rabbitmq-complains-about-auth-issue/218741 "2020-02-11T09:26:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![karlsson](https://avatars.discourse-cdn.com/v4/letter/k/7bcc69/32.png) [@karlsson](https://discuss.elastic.co/u/karlsson)\
**Post date:** [February 11, 2020, 9:26am UTC](https://discuss.elastic.co/t/logstash-fails-to-connect-to-rabbitmq-complains-about-auth-issue/218741/1 "2020-02-11T09:26:24Z")

</div>

I am deploying RabbitMQ with Elaasticsearch and Logstash using Docker Compose.

I can login with the user I create to RabbitMQ UI. However, the same credentials aren't good for Logstash:

`[2020-02-11T03:18:20,616][ERROR][logstash.inputs.rabbitmq] RabbitMQ connection error, will retry. {:error_message=>"Authentication with RabbitMQ failed or RabbitMQ version used does not support AMQP 0-9-1. Username: rabbit, vhost: /, password length: 6. Please check your configuration.", :exception=>"MarchHare::AuthenticationFailureError"}`

I am using environment variables in logstash configuration, smth like:

```
    input {
      rabbitmq {
        # determine whether to delete the queue when the last broker disconnects
        auto_delete => "false"

        # determine whether the queue is durable or not (survives restarts)
        durable => "true"

        # exchange this component binds the queue to
        exchange => "my.metric"

        # whether other clients will be allowed to connect
        exclusive => "false"

        # routing key
        key => "my.events"

        # host rabbitmq server host
        host => "${RABBIT_HOST}"

        # queue logstash will consume events from
        queue => "my.metrics.queue"

        # configure rabbitmq user and password
        user => "${RABBIT_USER}"
        password => "${RABBIT_PASS}"
      }
    }

```

Username and password are propagated to the container, and as far as I understand I can use envs in config files [https://www.elastic.co/guide/en/logstash/current/environment-variables.html](https://www.elastic.co/guide/en/logstash/current/environment-variables.html)

Logs say password length is 6 which isn't true.

Any hints on how I can solve this auth issue?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 10, 2020, 9:39am UTC](https://discuss.elastic.co/t/logstash-fails-to-connect-to-rabbitmq-complains-about-auth-issue/218741/2 "2020-03-10T09:39:56Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
