rabbitmq_mqtt plugin fails to start

2,018 views
Skip to first unread message

A F-1

unread,
Aug 2, 2018, 4:45:33 PM8/2/18
to rabbitmq-users
Installed packages:
erlang-21.0.4-1.el7.centos.x86_64.rpm
rabbitmq-server-3.7.7-1.el7.noarch.rpm

Command + error message:
$ rabbitmq-plugins enable rabbitmq_mqtt
The following plugins have been configured:
  rabbitmq_auth_backend_http
  rabbitmq_management
  rabbitmq_management_agent
  rabbitmq_mqtt
  rabbitmq_web_dispatch
Applying plugin configuration to rabbit@host_name.com...
** (CaseClauseError) no case clause matching: {:could_not_start, :rabbitmq_mqtt, {:rabbitmq_mqtt, {{:shutdown, {:failed_to_start_child, :"rabbit_mqtt_listener_sup_:::1883", {:shutdown, {:failed_to_start_child, {:ranch_listener_sup, {:acceptor, {0, 0, 0, 0, 0, 0, 0, 0}, 1883}}, {:shutdown, {:failed_to_start_child, :ranch_acceptors_sup, {:listen_error, {:acceptor, {0, 0, 0, 0, 0, 0, 0, 0}, 1883}, :eaddrinuse}}}}}}}, {:rabbit_mqtt, :start, [:normal, []]}}}}
    (rabbitmqctl) lib/rabbitmq/cli/plugins/plugins_helpers.ex:176: RabbitMQ.CLI.Plugins.Helpers.update_enabled_plugins/2
    (rabbitmqctl) lib/rabbitmq/cli/plugins/plugins_helpers.ex:98: RabbitMQ.CLI.Plugins.Helpers.update_enabled_plugins/4
    (rabbitmqctl) lib/rabbitmq/cli/plugins/commands/enable_command.ex:98: anonymous fn/6 in RabbitMQ.CLI.Plugins.Commands.EnableCommand.do_run/2
    (elixir) lib/stream.ex:1282: anonymous fn/2 in Stream.iterate/2
    (elixir) lib/stream.ex:1466: Stream.do_unfold/4
    (elixir) lib/stream.ex:1536: Enumerable.Stream.do_each/4
    (elixir) lib/stream.ex:923: Stream.do_enum_transform/7
    (elixir) lib/stream.ex:1536: Enumerable.Stream.do_each/4

Checking for port 1883:
$ netstat -antulp  | grep 1883
tcp        0      0 127.0.0.1:1883          0.0.0.0:*               LISTEN      7404/beam.smp      

Thanks
Avi

Michael Klishin

unread,
Aug 2, 2018, 4:49:51 PM8/2/18
to rabbitm...@googlegroups.com
Something else uses port (the error is eaddrinuse), as netstat confirms. It could be a different RabbitMQ node,
possibly running in the background.

--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitmq-users@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
MK

Staff Software Engineer, Pivotal/RabbitMQ

Avi

unread,
Aug 2, 2018, 5:10:44 PM8/2/18
to rabbitmq-users
Michael

Thanks for looking into that.
I know what is using this port, I provided it at the bottom of my post, please see highlighted.
It is beam.smp which is part of RabbitMQ/Erlang.

Avi
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To post to this group, send email to rabbitm...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Michael Klishin

unread,
Aug 2, 2018, 5:45:59 PM8/2/18
to rabbitm...@googlegroups.com
So what is your question?

Shut that process down or otherwise make sure you don't have two processes running.
RabbitMQ won't start two listeners on the same port (unless explicitly configured).


To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitmq-users@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Avi

unread,
Aug 2, 2018, 5:54:10 PM8/2/18
to rabbitmq-users
Sorry.

The process which uses port 1883 is Erlang related.
It starts when I run service rabbitmq-server start and it stops when I issue a stop.
Hence, plugin rabbitmq_mqtt would not start.

I presume that I need rabbitmq_mqtt plugin in order to take MQTT traffic.
Am I wrong?
Otherwise, I will not attempt to enable that plugin.

Thanks
Avi

$ ps -ef | grep -v grep | grep beam
rabbitmq  7404     1  0 20:29 ?        00:00:24 /usr/lib64/erlang/erts-10.0.4/bin/beam.smp

Michael Klishin

unread,
Aug 2, 2018, 5:57:25 PM8/2/18
to rabbitm...@googlegroups.com
That process is an Erlang VM, most likely started by RabbitMQ.

Start a node and run `rabbitmq-plugins list` and see if the MQTT plugin is already enabled.
Enabling a plugin on a running node in most cases a no-op, so it can be that
somehow you end up with 2 nodes (the 2nd one fails to start).

If the plugin is already enabled, there is no need to enable it again.

To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitmq-users@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Michael Klishin

unread,
Aug 2, 2018, 5:57:51 PM8/2/18
to rabbitm...@googlegroups.com
`rabbitmqctl status` will contain the OS PID of the node, which can be compared to what
netstat or ss report.

Michael Klishin

unread,
Aug 2, 2018, 6:00:02 PM8/2/18
to rabbitm...@googlegroups.com
I just tried enabling `rabbitmq_mqtt` several times on a node that already had it enabled.
It's indeed a no-op.

`rabbitmqctl status` will also list active listeners (server sockets the node is bound to). Use it to determine
whether it's the MQTT plugin or something else has been configured to use port 1883 (which is pretty unlikely).

Avi

unread,
Aug 2, 2018, 6:20:26 PM8/2/18
to rabbitmq-users
Michael

I got it to work.
I upgraded from 3.6.5 to 3.7.7 and I mis-configured file rabbitmq.conf.
Thanks again for your help and patience.

Avi
MK

Staff Software Engineer, Pivotal/RabbitMQ

Michael Klishin

unread,
Aug 2, 2018, 6:22:11 PM8/2/18
to rabbitm...@googlegroups.com
No worries. Thank you reporting back to the list!

To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitmq-users@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Mohd Ilyas Zargar

unread,
Feb 10, 2020, 3:02:17 PM2/10/20
to rabbitmq-users
when i try to enable mqtt plugin as follows, i rcv a trace rather starting it

ubuntu@hms-rabitmq-01:~$ sudo rabbitmq-plugins enable rabbitmq_mqtt
Enabling plugins on node rabbit@hms-rabitmq-01:
rabbitmq_mqtt
The following plugins have been configured:
  rabbitmq_management
  rabbitmq_management_agent
  rabbitmq_mqtt
  rabbitmq_web_dispatch
Applying plugin configuration to rabbit@hms-rabitmq-01...
Stack trace:

** (CaseClauseError) no case clause matching: {:badrpc, {:EXIT, :noproc}}
    (rabbitmqctl) lib/rabbitmq/cli/plugins/plugins_helpers.ex:219: RabbitMQ.CLI.Plugins.Helpers.update_enabled_plugins/2
    (rabbitmqctl) lib/rabbitmq/cli/plugins/plugins_helpers.ex:116: RabbitMQ.CLI.Plugins.Helpers.update_enabled_plugins/4
    (rabbitmqctl) lib/rabbitmq/cli/plugins/commands/enable_command.ex:130: anonymous fn/6 in RabbitMQ.CLI.Plugins.Commands.EnableCommand.do_run/2
    (elixir) lib/stream.ex:1298: anonymous fn/2 in Stream.iterate/2
    (elixir) lib/stream.ex:1482: Stream.do_unfold/4
    (elixir) lib/stream.ex:1553: Enumerable.Stream.do_each/4
    (elixir) lib/stream.ex:933: Stream.do_enum_transform/7
    (elixir) lib/stream.ex:1553: Enumerable.Stream.do_each/4

{:case_clause, {:badrpc, {:EXIT, :noproc}}}


And Thereby whole rabbitmq stops working
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitm...@googlegroups.com.

To post to this group, send email to rabbitm...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Luke Bakken

unread,
Feb 11, 2020, 10:59:22 AM2/11/20
to rabbitmq-users
Hello,

We need more information -

* RabbitMQ version, Erlang version, operating system
* RabbitMQ logs

Please start a new discussion with the below message as well as the requested information : https://groups.google.com/forum/#!newtopic/rabbitmq-users

Luke
Reply all
Reply to author
Forward
0 new messages