# RESOURCE\_LOCKED messages

**URL:** <https://discuss.elastic.co/t/resource-locked-messages/305628>\
**Category:** Logstash\
**Created:** [May 25, 2022, 4:02pm UTC](https://discuss.elastic.co/t/resource-locked-messages/305628 "2022-05-25T16:02:58Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![rnappert](https://avatars.discourse-cdn.com/v4/letter/r/b19c9b/32.png) [@rnappert](https://discuss.elastic.co/u/rnappert)\
**Post date:** [May 25, 2022, 4:02pm UTC](https://discuss.elastic.co/t/resource-locked-messages/305628/1 "2022-05-25T16:02:58Z")

</div>

I have a three Logstash instances running a fairly old release ( 6.2.3). Two are running in a standby mode, and one in a active mode. The node, which has the vip is considered the active node.  
All this said, all three instances are running, but only the active node processes records.  
After some restarts of all three nodes, I see now the following messages on all three nodes:  
[WARN][logstash.inputs.rabbitmq] Error while setting up connection for rabbitmq input! Will retry. {:message=\>"#method\<channel.close\>(reply-code=405, reply-text=RESOURCE\_LOCKED - cannot obtain exclusive access to locked queue '' in vhost '/', class-id=50, method-id=10)", :class=\>"MarchHare::ChannelAlreadyClosed", :location=\>"/opt/northstar/thirdparty/logstash/vendor/bundle/jruby/2.3.0/gems/march\_hare-3.1.1-java/lib/march\_hare/exceptions.rb:121:in `convert\_and\_reraise'"}

I have restarted the rabbitmq server (remote node) as well as the three logstash instances, but I can not resolve this issue.

Does anyone have an idea how to solve this issue?

Thanks

---

<div class="post-metadata">

**Author:** ![rnappert](https://avatars.discourse-cdn.com/v4/letter/r/b19c9b/32.png) [@rnappert](https://discuss.elastic.co/u/rnappert)\
**Post date:** [May 27, 2022, 2:21pm UTC](https://discuss.elastic.co/t/resource-locked-messages/305628/2 "2022-05-27T14:21:10Z")

</div>

Anyone?

---

<div class="post-metadata">

**Author:** ![Rios](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rios/32/95745_2.png) [@Rios](https://discuss.elastic.co/u/Rios)\
**Post date:** [May 27, 2022, 3:04pm UTC](https://discuss.elastic.co/t/resource-locked-messages/305628/3 "2022-05-27T15:04:51Z")

</div>

Are you using a persistent queue on disk?  
Can you show pipelines.yml?

Also might be something on Rabbit side, check [link1](https://stackoverflow.com/questions/36621344/cannot-obtain-exclusive-access-to-locked-queue) [link2](https://github.com/StackStorm/st2/issues/4164) [link3](https://stackoverflow.com/questions/57736210/how-to-define-a-binding-to-a-exclusive-auto-delete-queue-from-different-connecti)

---

<div class="post-metadata">

**Author:** ![rnappert](https://avatars.discourse-cdn.com/v4/letter/r/b19c9b/32.png) [@rnappert](https://discuss.elastic.co/u/rnappert)\
**Post date:** [May 27, 2022, 6:46pm UTC](https://discuss.elastic.co/t/resource-locked-messages/305628/4 "2022-05-27T18:46:29Z")

</div>

All the parameters are commented out (default settings), so there is no persistent queue on disk.  
For the pipeline in question, 5 workers are configured and batch size is set to 500

---

<div class="post-metadata">

**Author:** ![Rios](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rios/32/95745_2.png) [@Rios](https://discuss.elastic.co/u/Rios)\
**Post date:** [May 28, 2022, 7:54am UTC](https://discuss.elastic.co/t/resource-locked-messages/305628/5 "2022-05-28T07:54:50Z")

</div>

Then I would go for Rabbit side, check links.

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [May 28, 2022, 12:50pm UTC](https://discuss.elastic.co/t/resource-locked-messages/305628/6 "2022-05-28T12:50:19Z")

</div>

As @Rios already mentioned, this seems to be a issue on the RabbitMQ side, logstash is trying to connect and the rabbitmq server is returning the error you got.

But, can you share your logstash input configuration?

---

<div class="post-metadata">

**Author:** ![rnappert](https://avatars.discourse-cdn.com/v4/letter/r/b19c9b/32.png) [@rnappert](https://discuss.elastic.co/u/rnappert)\
**Post date:** [May 30, 2022, 2:58pm UTC](https://discuss.elastic.co/t/resource-locked-messages/305628/7 "2022-05-30T14:58:33Z")

</div>

The input for rabbitmq is nothing special:

input {

```
rabbitmq {
    host => "${MQ_HOST:localhost}"
    user => "${MQ_USERNAME:northstar}"
    password => "${MQ_PASSWORD}"
    port => "${MQ_PORT:5672}"
    exchange => <exchage-name>
    queue => <queue-name>
    key => <key-name>
    codec => thrift {
        classname => <class-name>
        file => <file-name>
        protocol_factory => "CompactProtocolFactory"
    }
}
...

```

}

I agree that the issue is probably on the rabbitmq side.

---

<div class="post-metadata">

**Author:** ![Rios](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rios/32/95745_2.png) [@Rios](https://discuss.elastic.co/u/Rios)\
**Post date:** [May 30, 2022, 7:02pm UTC](https://discuss.elastic.co/t/resource-locked-messages/305628/8 "2022-05-30T19:02:27Z")

</div>

From links above:

1. 

> Don't do the queue mirror for st2.trigger.watch\* queue fixed the issue.

> `rabbitmqctl set_policy ha-two '^(?!st2\.trigger\.watch\.).*' ' {"ha-mode":"exactly","ha-params":2,"ha-sync-mode":"automatic"}`

1. 

> [High concurrency brought in `cannot obtain exclusive access to locked queue`]]([Exclusive queues can be orphaned · Issue #1323 · rabbitmq/rabbitmq-server · GitHub](https://github.com/rabbitmq/rabbitmq-server/issues/1323))

2. 

> Don't use an exclusive queue, just use auto-delete. Exclusive queues are just that - exclusive to the connection that declares them.

---

<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:** [June 27, 2022, 7:03pm UTC](https://discuss.elastic.co/t/resource-locked-messages/305628/9 "2022-06-27T19:03:02Z")

</div>

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