RabbitMQ rabbitmqctl command fails to initialize

rabbitmq

It seems I can run the rabbitmq-server command fine and it starts up but rabbitmqctl fails with an error so I can't stop it or do anything else.

~/rabbit/rabbitmq_server-3.7.15/sbin> rabbitmqctl
escript: exception error: undefined function rabbitmqctl_escript:main/1
  in function  escript:run/2 (escript.erl, line 758)
  in call from escript:start/1 (escript.erl, line 277)
  in call from init:start_em/1
  in call from init:do_boot/3

This is with Erlang/OTP 22 Erlang/OTP 22 [erts-10.4] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [hipe]

Am I missing a config or something?

Best Answer

This can happen if you have mismatched binaries. For example, let's say your system has outdated versions of RabbitMQ and/or Erlang, installed via your package manager. If you then download the current version of RabbitMQ, such as the generic binary release, and try to run it, your $PATH may point to the outdated version of Erlang elsewhere on your system.

The solution (particularly if you don't have root access), is to install the correct version of Erlang and the update your $PATH to ensure that the sbin directory under RabbitMQ and the erl executable of the newer Erlang are ahead of any other directory that might point to the older versions.

Related Topic